From 9418c8ec8dddd73a7fb0a4a1180118d49a8e5ebe Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 9 Jul 2020 16:14:14 +0200 Subject: [PATCH] gitlab-ci: Don't rebuild kernels and rootfs if they have been already built in mainline Use the ones from mainline if possible to save cycles rebuilding the same files. Signed-off-by: Tomeu Vizoso Part-of: --- .gitlab-ci/container/lava_arm.sh | 15 ++++++++++----- .gitlab-ci/lava-gitlab-ci.yml | 9 ++++++++- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci/container/lava_arm.sh b/.gitlab-ci/container/lava_arm.sh index ec3bf52b9f4..8751d2ecbdb 100755 --- a/.gitlab-ci/container/lava_arm.sh +++ b/.gitlab-ci/container/lava_arm.sh @@ -3,12 +3,17 @@ set -e set -o xtrace +check_minio() +{ + MINIO_PATH="minio-packet.freedesktop.org/mesa-lava/$1/${DISTRIBUTION_TAG}/${DEBIAN_ARCH}" + if wget -q --method=HEAD "https://${MINIO_PATH}/done"; then + exit + fi +} + # If remote files are up-to-date, skip rebuilding them -MINIO_PATH=minio-packet.freedesktop.org/mesa-lava/${CI_PROJECT_PATH}/${DISTRIBUTION_TAG}/${DEBIAN_ARCH} -DONE_FILE=https://${MINIO_PATH}/done -if wget -q --method=HEAD ${DONE_FILE}; then - exit -fi +check_minio "mesa/mesa" +check_minio "${CI_PROJECT_PATH}" . .gitlab-ci/container/container_pre_build.sh diff --git a/.gitlab-ci/lava-gitlab-ci.yml b/.gitlab-ci/lava-gitlab-ci.yml index 5f7a919ab20..6d9e3cb68b4 100644 --- a/.gitlab-ci/lava-gitlab-ci.yml +++ b/.gitlab-ci/lava-gitlab-ci.yml @@ -32,9 +32,16 @@ kernel+rootfs_armhf: GIT_STRATEGY: none # testing doesn't build anything from source ENV_VARS: "DEQP_PARALLEL=6" DEQP_VERSION: gles2 - ARTIFACTS_URL: "https://minio-packet.freedesktop.org/mesa-lava/${CI_PROJECT_PATH}/${DISTRIBUTION_TAG}/${ARCH}" + ARTIFACTS_PREFIX: "https://minio-packet.freedesktop.org/mesa-lava/" MESA_URL: "https://minio-packet.freedesktop.org/artifacts/${CI_PROJECT_PATH}/${CI_PIPELINE_ID}/mesa-${ARCH}.tar.gz" script: + # Try to use the kernel and rootfs built in mainline first, to save cycles + - > + if wget -q --method=HEAD "${ARTIFACTS_PREFIX}/mesa/mesa/${DISTRIBUTION_TAG}/${ARCH}/done"; then + ARTIFACTS_URL="${ARTIFACTS_PREFIX}/mesa/mesa/${DISTRIBUTION_TAG}/${ARCH}" + else + ARTIFACTS_URL="${ARTIFACTS_PREFIX}/${CI_PROJECT_PATH}/${DISTRIBUTION_TAG}/${ARCH}" + fi - > artifacts/generate_lava.py \ --template artifacts/lava-deqp.yml.jinja2 \ -- 2.30.2