gitlab-ci: Don't rebuild kernels and rootfs if they have been already built in mainline
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Thu, 9 Jul 2020 14:14:14 +0000 (16:14 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 9 Jul 2020 18:23:37 +0000 (18:23 +0000)
Use the ones from mainline if possible to save cycles rebuilding the same files.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5822>

.gitlab-ci/container/lava_arm.sh
.gitlab-ci/lava-gitlab-ci.yml

index ec3bf52b9f462d60f39facf1091f29bd0ca6cc9a..8751d2ecbdbd5edb54fd72b5474a2769b4cc6731 100755 (executable)
@@ -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
 
index 5f7a919ab203a9481be6d3bb2ef00a3a0e4f03be..6d9e3cb68b4453bf46148a8b487b9db731e734b5 100644 (file)
@@ -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 \