main
sh 34 lines 865 Bytes
Raw
1 #!/bin/bash
2 set -e
3
4 if [[ $# -lt 3 ]]; then
5 echo "Usage: $0 <registry> <repo> <commit>"
6 exit 1
7 fi
8
9 REGISTRY=$1
10 REPO=$2
11 BUILDKITE_COMMIT=$3
12 IMAGE="$REGISTRY/$REPO:$BUILDKITE_COMMIT-hpu"
13
14 # authenticate with AWS ECR
15 aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin "$REGISTRY" || true
16
17 # skip build if image already exists
18 if docker manifest inspect "$IMAGE" >/dev/null 2>&1; then
19 echo "Image found"
20 else
21 echo "Image not found, proceeding with build..."
22 # build
23 docker build \
24 --file tests/pytorch_ci_hud_benchmark/Dockerfile.hpu \
25 --build-arg max_jobs=16 \
26 --build-arg buildkite_commit="$BUILDKITE_COMMIT" \
27 --tag "$IMAGE" \
28 --progress plain \
29 https://github.com/vllm-project/vllm-gaudi.git
30 # push
31 docker push "$IMAGE"
32 fi
33
34 .buildkite/scripts/annotate-image-build.sh "$IMAGE"