Skip to content

Commit c693242

Browse files
committed
add build job
1 parent 261be6e commit c693242

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

.github/workflows/pr-vllm.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,46 @@ jobs:
3333
with:
3434
filters: |
3535
vllm-ec2:
36-
- "docker/vllm/Dockerfile"
36+
- "docker/vllm/Dockerfile"
37+
38+
build-image:
39+
needs: [check-changes]
40+
if: needs.check-changes.outputs.vllm-ec2 == 'true'
41+
runs-on:
42+
- codebuild-runner-${{ github.run_id }}-${{ github.run_attempt }}
43+
fleet:x86-build-runner
44+
steps:
45+
- uses: actions/checkout@v5
46+
- run: .github/scripts/runner_setup.sh
47+
- run: .github/scripts/buildkitd.sh
48+
- name: ECR login
49+
run: |
50+
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
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.11.0-gpu-py312-cu128-ubuntu22.04-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: |
60+
docker buildx build --progress plain \
61+
--build-arg CACHE_REFRESH="$(date +"%Y-%m-%d")" \
62+
--cache-to=type=inline \
63+
--cache-from=type=registry,ref=$IMAGE_URI \
64+
--tag $IMAGE_URI \
65+
--target vllm-ec2 \
66+
-f docker/vllm/Dockerfile .
67+
68+
- name: Docker Push and save image URI artifact
69+
run: |
70+
docker push $IMAGE_URI
71+
docker rmi $IMAGE_URI
72+
echo $IMAGE_URI > image_uri.txt
73+
74+
- name: Upload image URI artifact
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: vllm-ec2-image-uri
78+
path: image_uri.txt

0 commit comments

Comments
 (0)