forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 0
Add vLLM Docker Github Action #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
468c4d3
init draft of ga
rohingarg-c c4bb715
finished ga/dockerfile setup
rohingarg-c 35329a3
add manual trigger for workflow
rohingarg-c 97c3441
temp add pull req as trigger
rohingarg-c 99adfb3
fixed REGION env variable
rohingarg-c f97a939
add cleanup steps to free up disk space
rohingarg-c 7da60f0
turned off cache to optimize disk usage
rohingarg-c 8fe521c
Update Dockerfile_internal to copy to /mnt/
rohingarg-c 63428b5
use larger runner
rohingarg-c eae87fd
rollback runner change and make cleaning more aggressive
rohingarg-c a3616b6
add more disk cleanup steps
rohingarg-c 42b88b1
update to use correct larger runner
rohingarg-c f86b244
add caching back, clean up the cleaning code
rohingarg-c 954ec60
add fail-fast false
rohingarg-c 7477482
added flag to prevent recompilation of CUDA kernels
rohingarg-c 66ee42f
add separate auth steps for staging & prod, remove disk space cleanup…
rohingarg-c 9853776
share image between staging and prod
rohingarg-c 3f58af3
fix build
rohingarg-c 50c776c
remove pull request trigger
rohingarg-c File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: Build & Publish vLLM Docker | ||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
permissions: | ||
id-token: write | ||
contents: read | ||
concurrency: | ||
group: deployment | ||
cancel-in-progress: false | ||
jobs: | ||
build-and-push: | ||
strategy: | ||
fail-fast: false | ||
runs-on: large_ubuntu_4cpu | ||
timeout-minutes: 360 | ||
env: | ||
REGION: us-central1 | ||
REPO: vllm | ||
IMAGE: vllm-forked | ||
STAGING_PROJECT: character-ai-staging | ||
PROD_PROJECT: character-ai | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Check disk space | ||
run: | | ||
sudo dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -nr | head | ||
df . -h | ||
sudo du /usr/ -hx -d 4 --threshold=1G | sort -hr | head | ||
|
||
- name: Determine tags | ||
id: tags | ||
run: | | ||
SHA=$(git rev-parse --short=7 HEAD) | ||
echo "sha=$SHA" >> $GITHUB_OUTPUT | ||
echo "tags=${SHA},latest" >> $GITHUB_OUTPUT | ||
|
||
- name: Authenticate to GCP Staging | ||
uses: google-github-actions/auth@v2 | ||
with: | ||
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER_STAGING }} | ||
service_account: ${{ secrets.GCP_SA_EMAIL_STAGING }} | ||
|
||
- name: "Set up Cloud SDK" | ||
uses: "google-github-actions/setup-gcloud@v2" | ||
with: | ||
install_components: "beta" | ||
|
||
- name: Configure Docker credential helper for build | ||
run: | | ||
gcloud --quiet auth configure-docker ${{ env.REGION }}-docker.pkg.dev | ||
|
||
# Build the image locally first | ||
- name: Build Docker image | ||
run: | | ||
docker build \ | ||
-f ./docker/Dockerfile_internal \ | ||
--build-arg HF_HOME=/huggingface/cache \ | ||
-t local-image:${{ steps.tags.outputs.sha }} \ | ||
. | ||
|
||
# Tag and push to staging | ||
- name: Tag and Push to Staging | ||
run: | | ||
docker tag local-image:${{ steps.tags.outputs.sha }} ${{ env.REGION }}-docker.pkg.dev/${{ env.STAGING_PROJECT }}/${{ env.REPO }}/${{ env.IMAGE }}:${{ steps.tags.outputs.sha }} | ||
docker tag local-image:${{ steps.tags.outputs.sha }} ${{ env.REGION }}-docker.pkg.dev/${{ env.STAGING_PROJECT }}/${{ env.REPO }}/${{ env.IMAGE }}:latest | ||
|
||
docker push ${{ env.REGION }}-docker.pkg.dev/${{ env.STAGING_PROJECT }}/${{ env.REPO }}/${{ env.IMAGE }}:${{ steps.tags.outputs.sha }} | ||
docker push ${{ env.REGION }}-docker.pkg.dev/${{ env.STAGING_PROJECT }}/${{ env.REPO }}/${{ env.IMAGE }}:latest | ||
|
||
# Re-authenticate to prod for prod pushes | ||
- name: Authenticate to GCP Prod | ||
uses: google-github-actions/auth@v2 | ||
with: | ||
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER_PROD }} | ||
service_account: ${{ secrets.GCP_SA_EMAIL_PROD }} | ||
|
||
- name: "Set up Cloud SDK for Prod" | ||
uses: "google-github-actions/setup-gcloud@v2" | ||
with: | ||
install_components: "beta" | ||
|
||
- name: Configure Docker credential helper for Prod | ||
run: | | ||
gcloud --quiet auth configure-docker ${{ env.REGION }}-docker.pkg.dev | ||
gcloud --quiet auth configure-docker gcr.io | ||
|
||
# Push same image to prod | ||
- name: Push to Prod and GCR | ||
run: | | ||
docker tag local-image:${{ steps.tags.outputs.sha }} ${{ env.REGION }}-docker.pkg.dev/${{ env.PROD_PROJECT }}/${{ env.REPO }}/${{ env.IMAGE }}:${{ steps.tags.outputs.sha }} | ||
docker tag local-image:${{ steps.tags.outputs.sha }} ${{ env.REGION }}-docker.pkg.dev/${{ env.PROD_PROJECT }}/${{ env.REPO }}/${{ env.IMAGE }}:latest | ||
docker tag local-image:${{ steps.tags.outputs.sha }} gcr.io/${{ env.PROD_PROJECT }}/vllm/${{ env.IMAGE }}:${{ steps.tags.outputs.sha }} | ||
docker tag local-image:${{ steps.tags.outputs.sha }} gcr.io/${{ env.PROD_PROJECT }}/vllm/${{ env.IMAGE }}:latest | ||
|
||
docker push ${{ env.REGION }}-docker.pkg.dev/${{ env.PROD_PROJECT }}/${{ env.REPO }}/${{ env.IMAGE }}:${{ steps.tags.outputs.sha }} | ||
docker push ${{ env.REGION }}-docker.pkg.dev/${{ env.PROD_PROJECT }}/${{ env.REPO }}/${{ env.IMAGE }}:latest | ||
docker push gcr.io/${{ env.PROD_PROJECT }}/vllm/${{ env.IMAGE }}:${{ steps.tags.outputs.sha }} | ||
docker push gcr.io/${{ env.PROD_PROJECT }}/vllm/${{ env.IMAGE }}:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM us-central1-docker.pkg.dev/character-ai/vllm/vllm-forked:latest as builder | ||
|
||
COPY . /mnt/vllm | ||
RUN pip uninstall -y vllm | ||
RUN VLLM_USE_PRECOMPILED=1 pip install /mnt/vllm | ||
RUN rm -rf /mnt/vllm | ||
RUN python3 -c "import vllm; print('Custom vLLM loaded successfully')" | ||
|
||
|
||
ENV HF_HOME=/huggingface/cache |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would we be able to temporarily enable on: pull_request: just to test this PR out before merging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done