From 5388e58e1f968eefdd109682e0a194730e52e467 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 15 Feb 2024 13:37:26 -0800 Subject: [PATCH] buildkite: don't customize runtime name Use the same runtime name for all jobs. The runtime name is passed to test and if it is different each time, test results are not cached and test are re-run even without code changes. PiperOrigin-RevId: 607439704 --- .buildkite/hooks/post-command | 3 +-- .buildkite/hooks/pre-command | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.buildkite/hooks/post-command b/.buildkite/hooks/post-command index ab4f9690a..0753d0155 100644 --- a/.buildkite/hooks/post-command +++ b/.buildkite/hooks/post-command @@ -56,8 +56,7 @@ if test "${BUILDKITE_COMMAND_EXIT_STATUS}" -ne "0"; then set -x dmesg -kT | tail -n 50 # LINT.IfChange - runtime="buildkite_runtime_${BUILDKITE_BRANCH}-${BUILDKITE_BUILD_ID}" - runtime="$(echo "$runtime" | sed -r 's~[^-_a-z0-9]+~_~g')" + runtime="buildkite_runtime" # LINT.ThenChange(pre-command) if [ -d "/tmp/${runtime}/" ]; then tar -czf "/tmp/${BUILDKITE_JOB_ID}.tar.gz" -C /tmp/ "${runtime}" diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index 40ad254dc..95483e7ae 100644 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -64,13 +64,12 @@ if [[ "${BUILDKITE_BRANCH}" =~ ^test/ ]]; then # LINT.ThenChange(../../tools/make_release.sh) fi -# Set the system-wide Docker runtime name after the BuildKite branch name. -# Remove any slashes and other characters that are not supported in Docker -# runtime names. The runtime name must be a single valid path component. # LINT.IfChange -export RUNTIME="buildkite_runtime_${BUILDKITE_BRANCH}-${BUILDKITE_BUILD_ID}" -export RUNTIME="$(echo "$RUNTIME" | sed -r 's~[^-_a-z0-9]+~_~g')" +export RUNTIME="buildkite_runtime" # LINT.ThenChange(post-command) +if [ -d "/tmp/${RUNTIME}/" ]; then + sudo rm -rf "/tmp/${RUNTIME}/" +fi # If running in a container, set the reload command appropriately. if [[ -x /tmp/buildkite-reload-host-docker/reload ]]; then