summaryrefslogtreecommitdiff
path: root/.gitlab-ci
diff options
context:
space:
mode:
authorDavid Heidelberg <david.heidelberg@collabora.com>2023-04-09 22:28:23 +0200
committerMarge Bot <emma+marge@anholt.net>2023-04-18 14:49:10 +0000
commit135039f5264f250689515498e190ca7eda57997c (patch)
treee7be49e4e2386dfc19686ec8e595d5767150a324 /.gitlab-ci
parent2dcd6bed6a97a5b8f6a1de36c176e7424170fa9b (diff)
downloadmesa-135039f5264f250689515498e190ca7eda57997c.tar.gz
ci: do not retry on forks to get the upstream kernel and rootfs
This commit introduces multiple changes: 1. Now we check for mainline artifacts only when NOT running on the mainline branch 2. if we run on the fork and get 404-like error, it doesn't retry. Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com> Signed-off-by: David Heidelberg <david.heidelberg@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22386>
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x.gitlab-ci/container/lava_build.sh6
-rwxr-xr-x.gitlab-ci/lava/lava-submit.sh17
2 files changed, 13 insertions, 10 deletions
diff --git a/.gitlab-ci/container/lava_build.sh b/.gitlab-ci/container/lava_build.sh
index 249c6e91cde..1a133a7dcf5 100755
--- a/.gitlab-ci/container/lava_build.sh
+++ b/.gitlab-ci/container/lava_build.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# shellcheck disable=SC1091 # The relative paths in this file only become valid at runtime.
# shellcheck disable=SC2034 # Variables are used in scripts called from here
# shellcheck disable=SC2086 # we want word splitting
@@ -11,13 +11,13 @@ export DEBIAN_FRONTEND=noninteractive
check_minio()
{
MINIO_PATH="${MINIO_HOST}/mesa-lava/$1/${DISTRIBUTION_TAG}/${DEBIAN_ARCH}"
- if curl -L --retry 4 -f --retry-all-errors --retry-delay 60 -s -X HEAD \
+ if curl -L --retry 4 -f --retry-delay 60 -s -X HEAD \
"https://${MINIO_PATH}/done"; then
+ echo "Remote files are up-to-date, skip rebuilding them."
exit
fi
}
-# If remote files are up-to-date, skip rebuilding them
check_minio "${FDO_UPSTREAM_REPO}"
check_minio "${CI_PROJECT_PATH}"
diff --git a/.gitlab-ci/lava/lava-submit.sh b/.gitlab-ci/lava/lava-submit.sh
index 29d045a6815..b359ab5d151 100755
--- a/.gitlab-ci/lava/lava-submit.sh
+++ b/.gitlab-ci/lava/lava-submit.sh
@@ -1,15 +1,18 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -e
set -x
-# Try to use the kernel and rootfs built in mainline first, so we're more
-# likely to hit cache
-if curl -s -X HEAD -L --retry 4 -f --retry-all-errors --retry-delay 60 \
- "https://${BASE_SYSTEM_MAINLINE_HOST_PATH}/done"; then
- BASE_SYSTEM_HOST_PATH="${BASE_SYSTEM_MAINLINE_HOST_PATH}"
-else
+# If we run in the fork (not from mesa or Marge-bot), reuse mainline kernel and rootfs, if exist.
+BASE_SYSTEM_HOST_PATH="${BASE_SYSTEM_MAINLINE_HOST_PATH}"
+if [ "$CI_PROJECT_PATH" != "$FDO_UPSTREAM_REPO" ]; then
+ if ! curl -s -X HEAD -L --retry 4 -f --retry-delay 60 \
+ "https://${BASE_SYSTEM_MAINLINE_HOST_PATH}/done"; then
+ echo "Using kernel and rootfs from the fork, cached from mainline is unavailable."
BASE_SYSTEM_HOST_PATH="${BASE_SYSTEM_FORK_HOST_PATH}"
+ else
+ echo "Using the cached mainline kernel and rootfs."
+ fi
fi
rm -rf results