Skip to content

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 19 commits into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build & Publish vLLM Docker

on:
push:
branches:
- main
Copy link
Collaborator

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

workflow_dispatch:

permissions:
id-token: write
contents: read

concurrency:
group: deployment
cancel-in-progress: false

jobs:
build-and-push:
runs-on: ubuntu-22.04
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: Authenticate to GCP
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SA_EMAIL }}

- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
with:
install_components: "beta"

- name: Configure Docker credential helper
run: |
gcloud --quiet auth configure-docker ${REGION}-docker.pkg.dev
gcloud --quiet auth configure-docker gcr.io

- 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: Build & Push to Staging, Prod, and GCR
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile_internal
platforms: linux/amd64
push: true
build-args: |
HF_HOME=/huggingface/cache
tags: |
${REGION}-docker.pkg.dev/${{ env.STAGING_PROJECT }}/${{ env.REPO }}/${{ env.IMAGE }}:${{ steps.tags.outputs.sha }}
${REGION}-docker.pkg.dev/${{ env.STAGING_PROJECT }}/${{ env.REPO }}/${{ env.IMAGE }}:latest
${REGION}-docker.pkg.dev/${{ env.STAGING_PROJECT }}/${{ env.REPO }}/${{ env.IMAGE }}:${{ steps.tags.outputs.sha }}
${REGION}-docker.pkg.dev/${{ env.PROD_PROJECT }}/${{ env.REPO }}/${{ env.IMAGE }}:latest
gcr.io/${{ env.PROD_PROJECT }}/vllm/${{ env.IMAGE }}:${{ steps.tags.outputs.sha }}
gcr.io/${{ env.PROD_PROJECT }}/vllm/${{ env.IMAGE }}:latest

10 changes: 10 additions & 0 deletions docker/Dockerfile_internal
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 . /tmp/vllm
RUN pip uninstall -y vllm
RUN pip install /tmp/vllm
RUN rm -rf /tmp/vllm
RUN python3 -c "import vllm; print('Custom vLLM loaded successfully')"


ENV HF_HOME=/huggingface/cache
Loading