From 75003f34e84b3243fd3bc95547a16111f7d569e8 Mon Sep 17 00:00:00 2001 From: Sahithi Chigurupati <58884509+csahithi@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:42:55 -0700 Subject: [PATCH] [CI] Push multiarch manifests as nightly builds (#25764) Signed-off-by: Sahithi Chigurupati --- .buildkite/release-pipeline.yaml | 16 +++++++---- .buildkite/scripts/cleanup-nightly-builds.sh | 29 ++++++++++++++++++-- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/.buildkite/release-pipeline.yaml b/.buildkite/release-pipeline.yaml index 7677d783fabc2..9cee502015c74 100644 --- a/.buildkite/release-pipeline.yaml +++ b/.buildkite/release-pipeline.yaml @@ -150,11 +150,16 @@ steps: queue: cpu_queue_postmerge commands: - "aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/q9t5s3a7" - - "docker pull public.ecr.aws/q9t5s3a7/vllm-release-repo:$BUILDKITE_COMMIT" - - "docker tag public.ecr.aws/q9t5s3a7/vllm-release-repo:$BUILDKITE_COMMIT vllm/vllm-openai:nightly" - - "docker tag public.ecr.aws/q9t5s3a7/vllm-release-repo:$BUILDKITE_COMMIT vllm/vllm-openai:nightly-$BUILDKITE_COMMIT" - - "docker push vllm/vllm-openai:nightly" - - "docker push vllm/vllm-openai:nightly-$BUILDKITE_COMMIT" + - "docker pull public.ecr.aws/q9t5s3a7/vllm-release-repo:$BUILDKITE_COMMIT-x86_64" + - "docker pull public.ecr.aws/q9t5s3a7/vllm-release-repo:$BUILDKITE_COMMIT-aarch64" + - "docker tag public.ecr.aws/q9t5s3a7/vllm-release-repo:$BUILDKITE_COMMIT-x86_64 vllm/vllm-openai:nightly-x86_64" + - "docker tag public.ecr.aws/q9t5s3a7/vllm-release-repo:$BUILDKITE_COMMIT-aarch64 vllm/vllm-openai:nightly-aarch64" + - "docker push vllm/vllm-openai:nightly-x86_64" + - "docker push vllm/vllm-openai:nightly-aarch64" + - "docker manifest create vllm/vllm-openai:nightly vllm/vllm-openai:nightly-x86_64 vllm/vllm-openai:nightly-aarch64 --amend" + - "docker manifest create vllm/vllm-openai:nightly-$BUILDKITE_COMMIT vllm/vllm-openai:nightly-x86_64 vllm/vllm-openai:nightly-aarch64 --amend" + - "docker manifest push vllm/vllm-openai:nightly" + - "docker manifest push vllm/vllm-openai:nightly-$BUILDKITE_COMMIT" # Clean up old nightly builds (keep only last 14) - "bash .buildkite/scripts/cleanup-nightly-builds.sh" plugins: @@ -163,3 +168,4 @@ steps: password-env: DOCKERHUB_TOKEN env: DOCKER_BUILDKIT: "1" + DOCKERHUB_USERNAME: "vllmbot" diff --git a/.buildkite/scripts/cleanup-nightly-builds.sh b/.buildkite/scripts/cleanup-nightly-builds.sh index 1a82f7d085233..f02a128c67726 100755 --- a/.buildkite/scripts/cleanup-nightly-builds.sh +++ b/.buildkite/scripts/cleanup-nightly-builds.sh @@ -8,20 +8,41 @@ set -ex # DockerHub API endpoint for vllm/vllm-openai repository REPO_API_URL="https://hub.docker.com/v2/repositories/vllm/vllm-openai/tags" -# Get DockerHub token from environment +# Get DockerHub credentials from environment if [ -z "$DOCKERHUB_TOKEN" ]; then echo "Error: DOCKERHUB_TOKEN environment variable is not set" exit 1 fi +if [ -z "$DOCKERHUB_USERNAME" ]; then + echo "Error: DOCKERHUB_USERNAME environment variable is not set" + exit 1 +fi + +# Get DockerHub bearer token +echo "Getting DockerHub bearer token..." +set +x +BEARER_TOKEN=$(curl -s -X POST \ + -H "Content-Type: application/json" \ + -d "{\"username\": \"$DOCKERHUB_USERNAME\", \"password\": \"$DOCKERHUB_TOKEN\"}" \ + "https://hub.docker.com/v2/users/login" | jq -r '.token') +set -x + +if [ -z "$BEARER_TOKEN" ] || [ "$BEARER_TOKEN" = "null" ]; then + echo "Error: Failed to get DockerHub bearer token" + exit 1 +fi + # Function to get all tags from DockerHub get_all_tags() { local page=1 local all_tags="" while true; do - local response=$(curl -s -H "Authorization: Bearer $DOCKERHUB_TOKEN" \ + set +x + local response=$(curl -s -H "Authorization: Bearer $BEARER_TOKEN" \ "$REPO_API_URL?page=$page&page_size=100") + set -x # Get both last_updated timestamp and tag name, separated by | local tags=$(echo "$response" | jq -r '.results[] | select(.name | startswith("nightly-")) | "\(.last_updated)|\(.name)"') @@ -43,7 +64,9 @@ delete_tag() { echo "Deleting tag: $tag_name" local delete_url="https://hub.docker.com/v2/repositories/vllm/vllm-openai/tags/$tag_name" - local response=$(curl -s -X DELETE -H "Authorization: Bearer $DOCKERHUB_TOKEN" "$delete_url") + set +x + local response=$(curl -s -X DELETE -H "Authorization: Bearer $BEARER_TOKEN" "$delete_url") + set -x if echo "$response" | jq -e '.detail' > /dev/null 2>&1; then echo "Warning: Failed to delete tag $tag_name: $(echo "$response" | jq -r '.detail')"