From c2366f01fd194c9aef91153e3050af30c57bb95a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Sat, 16 May 2020 17:17:23 +0200 Subject: [PATCH] gitlab-ci: x86_test-base image as common base for x86_test-gl/vk Making use of the relatively recent FDO_BASE_IMAGE feature of the templates, the x86_test-base image contents are shared as a separate layer by the x86_test-gl/vk images (meaning the former only needs to be downloaded once for either or both of the latter). This should be more efficient in terms of overall network bandwidth and storage, in particular if the base image changes less often than the -gl/vk ones. v2: * List x86_test-base in needs: along with x86_test-gl/vk (see parent commit) * Always put $STABLE/TESTING_EPHEMERAL on separate lines, will make it easier to add any non-ephemeral packages Reviewed-by: Eric Anholt # v1 Part-of: --- .gitlab-ci.yml | 28 +++++++-- .gitlab-ci/container/x86_test-base.sh | 69 ++++++++++++++++++++ .gitlab-ci/container/x86_test-gl.sh | 90 +++++---------------------- .gitlab-ci/container/x86_test-vk.sh | 84 +++++-------------------- 4 files changed, 124 insertions(+), 147 deletions(-) create mode 100644 .gitlab-ci/container/x86_test-base.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c3b2c0351aa..6e28b4713db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,7 @@ include: stages: - container + - container-2 - meson-x86_64 - scons - meson-misc @@ -145,17 +146,34 @@ x86_build: needs: - x86_build +# Debian 10 based x86 test image base +x86_test-base: + extends: x86_build + variables: + FDO_DISTRIBUTION_TAG: &x86_test-base "2020-05-23" + +.use-x86_test-base: + extends: + - x86_build + - .ci-run-policy + stage: container-2 + variables: + BASE_TAG: *x86_test-base + FDO_BASE_IMAGE: "$CI_REGISTRY_IMAGE/debian/x86_test-base:$BASE_TAG" + needs: + - x86_test-base + # Debian 10 based x86 test image for GL x86_test-gl: - extends: x86_build + extends: .use-x86_test-base variables: - FDO_DISTRIBUTION_TAG: &x86_test-gl "2020-05-18" + FDO_DISTRIBUTION_TAG: &x86_test-gl "2020-05-23" # Debian 10 based x86 test image for VK x86_test-vk: - extends: x86_build + extends: .use-x86_test-base variables: - FDO_DISTRIBUTION_TAG: &x86_test-vk "2020-05-18" + FDO_DISTRIBUTION_TAG: &x86_test-vk "2020-05-23" # Debian 9 based x86 build image (old LLVM) x86_build_old: @@ -622,6 +640,7 @@ meson-mingw32-x86_64: needs: - x86_build - meson-testing + - x86_test-base - x86_test-gl .test-vk: @@ -633,6 +652,7 @@ meson-mingw32-x86_64: needs: - x86_build - meson-testing + - x86_test-base - x86_test-vk .piglit-test: diff --git a/.gitlab-ci/container/x86_test-base.sh b/.gitlab-ci/container/x86_test-base.sh new file mode 100644 index 00000000000..e79384537ea --- /dev/null +++ b/.gitlab-ci/container/x86_test-base.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +set -e +set -o xtrace + +export DEBIAN_FRONTEND=noninteractive + +apt-get install -y \ + ca-certificates \ + gnupg + +# Upstream LLVM package repository +apt-key add .gitlab-ci/container/llvm-snapshot.gpg.key +echo "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-9 main" >/etc/apt/sources.list.d/llvm9.list + +sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list +echo 'deb https://deb.debian.org/debian testing main' >/etc/apt/sources.list.d/testing.list + +apt-get update + +# Don't use newer packages from testing by default +cat >/etc/apt/preferences </etc/apt/sources.list.d/llvm9.list - -sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list -echo 'deb https://deb.debian.org/debian testing main' >/etc/apt/sources.list.d/testing.list - -apt-get update - -# Don't use newer packages from testing by default -cat >/etc/apt/preferences </etc/apt/sources.list.d/llvm9.list - -sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list -echo 'deb https://deb.debian.org/debian testing main' >/etc/apt/sources.list.d/testing.list - -apt-get update - -# Don't use newer packages from testing by default -cat >/etc/apt/preferences <