From 31775a2ff6bd838380d15c8bca254eb5afd575c5 Mon Sep 17 00:00:00 2001 From: Kaise Cheng Date: Mon, 23 Jun 2025 14:13:17 +0100 Subject: [PATCH] Standardize image artifact name Standardize the arch in image artifact name to amd64 (instead of x86_64), and arm64 (instead of aarch64) --- .buildkite/scripts/dra/build_docker.sh | 5 ++++- .buildkite/scripts/dra/common.sh | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.buildkite/scripts/dra/build_docker.sh b/.buildkite/scripts/dra/build_docker.sh index 0c89b56e5..0a5ee1998 100755 --- a/.buildkite/scripts/dra/build_docker.sh +++ b/.buildkite/scripts/dra/build_docker.sh @@ -29,6 +29,9 @@ rake artifact:dockerfiles || error "artifact:dockerfiles build failed." STACK_VERSION="$(./$(dirname "$0")/../common/qualified-version.sh)" info "Build complete, setting STACK_VERSION to $STACK_VERSION." +# standardize $ARCH for image name +normalize_arch + info "Saving tar.gz for docker images" save_docker_tarballs "${ARCH}" "${STACK_VERSION}" @@ -44,7 +47,7 @@ done # Upload 'docker-build-context.tar.gz' files only when build x86_64, otherwise they will be # overwritten when building aarch64 (or viceversa). -if [ "$ARCH" != "aarch64" ]; then +if [ "$ARCH" != "arm64" ]; then for image in logstash logstash-oss logstash-wolfi logstash-ironbank; do buildkite-agent artifact upload "build/${image}-${STACK_VERSION}-docker-build-context.tar.gz" done diff --git a/.buildkite/scripts/dra/common.sh b/.buildkite/scripts/dra/common.sh index 1ff6c5f8b..51c62cf51 100755 --- a/.buildkite/scripts/dra/common.sh +++ b/.buildkite/scripts/dra/common.sh @@ -22,6 +22,21 @@ function save_docker_tarballs { done } +# normalized $ARCH should be either "amd64" or "arm64" +function normalize_arch { + case "$ARCH" in + x86_64|amd64) + ARCH="amd64" + ;; + aarch64|arm64) + ARCH="arm64" + ;; + *) + error "Unsupported architecture: $ARCH" + ;; + esac +} + # Since we are using the system jruby, we need to make sure our jvm process # uses at least 1g of memory, If we don't do this we can get OOM issues when # installing gems. See https://github.com/elastic/logstash/issues/5179