Skip to content

Commit 16d5f1e

Browse files
committed
update
Signed-off-by: Junpu Fan <junpu@amazon.com>
1 parent f5e61e3 commit 16d5f1e

File tree

1 file changed

+28
-15
lines changed

1 file changed

+28
-15
lines changed

.github/workflows/pr-vllm-rayserve.yml

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
vllm-rayserve-ec2:
3636
- "docker/vllm/Dockerfile.rayserve"
3737
38-
build:
38+
build-image:
3939
needs: [check-changes]
4040
if: needs.check-changes.outputs.vllm-rayserve-ec2 == 'true'
4141
runs-on:
@@ -45,31 +45,41 @@ jobs:
4545
- uses: actions/checkout@v5
4646
- run: .github/scripts/runner_setup.sh
4747
- run: .github/scripts/buildkitd.sh
48-
- name: Build vllm-rayserve-ec2 image
49-
id: build
50-
shell: bash
48+
- name: ECR login
5149
run: |
5250
aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com
53-
IMAGE_TAG=${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/ci:vllm-0.10.2-gpu-py312-cu128-ubuntu22.04-rayserve-ec2-pr-${{ github.event.pull_request.number }}
51+
52+
- name: Resolve image URI for build
53+
run: |
54+
IMAGE_URI=${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/ci:vllm-0.10.2-gpu-py312-cu128-ubuntu22.04-rayserve-ec2-pr-${{ github.event.pull_request.number }}
55+
echo "Image URI to build: $IMAGE_URI"
56+
echo "IMAGE_URI=$IMAGE_URI" >> $GITHUB_ENV
57+
58+
- name: Build image
59+
run: |
5460
docker buildx build --progress plain \
5561
--build-arg CACHE_REFRESH="$(date +"%Y-%m-%d")" \
5662
--cache-to=type=inline \
57-
--cache-from=type=registry,ref=$IMAGE_TAG \
58-
--tag $IMAGE_TAG \
63+
--cache-from=type=registry,ref=$IMAGE_URI \
64+
--tag $IMAGE_URI \
5965
--target vllm-rayserve-ec2 \
6066
-f docker/vllm/Dockerfile.rayserve .
61-
docker push $IMAGE_TAG
62-
docker rmi $IMAGE_TAG
63-
echo $IMAGE_TAG > image_uri.txt
67+
68+
- name: Docker Push and save IMAGE_URI
69+
run: |
70+
docker push $IMAGE_URI
71+
docker rmi $IMAGE_URI
72+
echo $IMAGE_URI > image_uri.txt
73+
6474
- name: Upload image URI
6575
uses: actions/upload-artifact@v4
6676
with:
6777
name: vllm-rayserve-ec2-image-uri
6878
path: image_uri.txt
6979

70-
test:
71-
needs: [build]
72-
if: needs.build.result == 'success'
80+
test-image:
81+
needs: [build-image]
82+
if: needs.build-image.result == 'success'
7383
runs-on:
7484
- codebuild-runner-${{ github.run_id }}-${{ github.run_attempt }}
7585
fleet:x86-g6xl-runner
@@ -98,9 +108,12 @@ jobs:
98108
echo "Resolved image URI: $IMAGE_URI"
99109
echo "IMAGE_URI=$IMAGE_URI" >> $GITHUB_ENV
100110
101-
- name: Pull image
111+
- name: ECR login
102112
run: |
103113
aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com
114+
115+
- name: Pull image
116+
run: |
104117
docker pull $IMAGE_URI
105118
106119
- name: Start container
@@ -144,4 +157,4 @@ jobs:
144157
run: |
145158
docker rm -f ${CONTAINER_ID} || true
146159
docker image prune -a --force --filter "until=24h"
147-
docker system df -v
160+
docker system df

0 commit comments

Comments
 (0)