Skip to content

Add label to build

Add label to build #12

name: vLLM_RAYSERVE_AUTO_RELEASE
on:
# schedule run must be on the default branch
# https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#schedule
# schedule:
# # Runs at 10:00 AM PST/PDT on Monday and Wednesday
# # Note: GitHub Actions uses UTC time. PST is UTC-8, PDT is UTC-7
# # Using 17:00 UTC = 10:00 AM PDT (most of the year) / 9:00 AM PST (winter)
# - cron: '00 17 * * 1,3' # Monday and Wednesday at 10:00 AM PDT / 9:00 AM PST
pull_request:
branches: [main]
types: [opened, reopened, synchronize]
paths:
- "**vllm**"
- "!docs/**"
permissions:
contents: read
pull-requests: read
env:
# CI environment configuration
FORCE_COLOR: "1"
# Config file paths
RAYSERVE_CONFIG: ".github/config/vllm-rayserve.yml"
jobs:
gatekeeper:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-gate-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
- name: Checkout base branch (safe)
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.base.sha }}
fetch-depth: 1
- name: Run permission gate (from base)
uses: ./.github/actions/pr-permission-gate
load-config:
needs: [gatekeeper]
if: success()
runs-on: ubuntu-latest
outputs:
rayserve-config: ${{ steps.load.outputs.rayserve-config }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Load configurations
id: load
uses: ./.github/actions/load-config
with:
config-files: ${{ env.RAYSERVE_CONFIG }}
# ===================================================
# =============== vLLM RayServe jobs ================
# ===================================================
build-vllm-rayserve-image:
needs: [load-config]
runs-on:
- codebuild-runner-${{ github.run_id }}-${{ github.run_attempt }}
fleet:x86-build-runner
buildspec-override:true
concurrency:
group: ${{ github.workflow }}-build-vllm-rayserve-image-${{ github.event.pull_request.number }}
cancel-in-progress: true
outputs:
ci-image: ${{ steps.build.outputs.image-uri }}
steps:
- uses: actions/checkout@v5
- name: Parse RayServe config
id: config
run: |
echo '${{ needs.load-config.outputs.rayserve-config }}' > config.json
echo "framework=$(jq -r '.common.framework' config.json)" >> $GITHUB_OUTPUT
echo "framework-version=$(jq -r '.common.framework_version' config.json)" >> $GITHUB_OUTPUT
echo "container-type=$(jq -r '.common.job_type' config.json)" >> $GITHUB_OUTPUT
echo "python-version=$(jq -r '.common.python_version' config.json)" >> $GITHUB_OUTPUT
echo "cuda-version=$(jq -r '.common.cuda_version' config.json)" >> $GITHUB_OUTPUT
echo "os-version=$(jq -r '.common.os_version' config.json)" >> $GITHUB_OUTPUT
echo "device-type=$(jq -r '.common.device_type // "gpu"' config.json)" >> $GITHUB_OUTPUT
echo "arch-type=$(jq -r '.common.arch_type // "x86"' config.json)" >> $GITHUB_OUTPUT
echo "contributor=$(jq -r '.common.contributor // "None"' config.json)" >> $GITHUB_OUTPUT
echo "customer-type=$(jq -r '.common.customer_type // ""' config.json)" >> $GITHUB_OUTPUT
- name: Build image
id: build
uses: ./.github/actions/build-image
with:
framework: ${{ steps.config.outputs.framework }}
target: vllm-rayserve-ec2
base-image: vllm/vllm-openai:v${{ steps.config.outputs.framework-version }}
framework-version: ${{ steps.config.outputs.framework-version }}
container-type: ${{ steps.config.outputs.container-type }}
aws-account-id: ${{ vars.CI_AWS_ACCOUNT_ID }}
aws-region: ${{ vars.AWS_REGION }}
tag-pr: ${{ steps.config.outputs.framework }}-${{ steps.config.outputs.framework-version }}-${{ steps.config.outputs.device-type }}-${{ steps.config.outputs.python-version }}-${{ steps.config.outputs.cuda-version }}-${{ steps.config.outputs.os-version }}-rayserve-ec2-pr-${{ github.event.pull_request.number }}
dockerfile-path: docker/${{ steps.config.outputs.framework }}/Dockerfile
arch-type: ${{ steps.config.outputs.arch-type }}
device-type: ${{ steps.config.outputs.device-type }}
cuda-version: ${{ steps.config.outputs.cuda-version }}
python-version: ${{ steps.config.outputs.python-version }}
os-version: ${{ steps.config.outputs.os-version }}
contributor: ${{ steps.config.outputs.contributor }}
customer-type: ${{ steps.config.outputs.customer-type }}
set-rayserve-test-environment:
needs: [build-vllm-rayserve-image, load-config]
if: |
always() && !failure() && !cancelled()
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-set-rayserve-test-environment-${{ github.event.pull_request.number }}
cancel-in-progress: true
outputs:
aws-account-id: ${{ steps.set-env.outputs.AWS_ACCOUNT_ID }}
image-uri: ${{ steps.set-env.outputs.IMAGE_URI }}
framework-version: ${{ steps.config.outputs.framework-version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Parse RayServe config
id: config
run: |
echo '${{ needs.load-config.outputs.rayserve-config }}' > config.json
echo "framework-version=$(jq -r '.common.framework_version' config.json)" >> $GITHUB_OUTPUT
echo "prod-image=$(jq -r '.common.prod_image' config.json)" >> $GITHUB_OUTPUT
- name: Set test environment
id: set-env
run: |
if [[ "${{ needs.build-vllm-rayserve-image.result }}" == "success" ]]; then
AWS_ACCOUNT_ID=${{ vars.CI_AWS_ACCOUNT_ID }}
IMAGE_URI=${{ needs.build-vllm-rayserve-image.outputs.ci-image }}
else
AWS_ACCOUNT_ID=${{ vars.PROD_AWS_ACCOUNT_ID }}
IMAGE_URI=${{ vars.PROD_AWS_ACCOUNT_ID }}.dkr.ecr.${{ vars.AWS_REGION }}.amazonaws.com/${{ steps.config.outputs.prod-image }}
fi
echo "Image URI to test: ${IMAGE_URI}"
echo "AWS_ACCOUNT_ID=${AWS_ACCOUNT_ID}" >> ${GITHUB_OUTPUT}
echo "IMAGE_URI=${IMAGE_URI}" >> ${GITHUB_OUTPUT}
vllm-rayserve-regression-test:
needs: [build-vllm-rayserve-image, set-rayserve-test-environment]
if: success()
runs-on:
- codebuild-runner-${{ github.run_id }}-${{ github.run_attempt }}
fleet:x86-g6xl-runner
buildspec-override:true
concurrency:
group: ${{ github.workflow }}-vllm-rayserve-regression-test-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
- name: Checkout DLC source
uses: actions/checkout@v5
- name: Container pull
uses: ./.github/actions/ecr-authenticate
with:
aws-account-id: ${{ needs.set-rayserve-test-environment.outputs.aws-account-id }}
aws-region: ${{ vars.AWS_REGION }}
image-uri: ${{ needs.set-rayserve-test-environment.outputs.image-uri }}
- name: Checkout vLLM tests
uses: actions/checkout@v5
with:
repository: vllm-project/vllm
ref: v${{ needs.set-rayserve-test-environment.outputs.framework-version }}
path: vllm_source
- name: Start container
run: |
CONTAINER_ID=$(docker run -d -it --rm --gpus=all --entrypoint /bin/bash \
-v ${HOME}/.cache/huggingface:/root/.cache/huggingface \
-v ${HOME}/.cache/vllm:/root/.cache/vllm \
-v .:/workdir --workdir /workdir \
-e HF_TOKEN=${{ secrets.HUGGING_FACE_HUB_TOKEN }} \
${{ needs.set-rayserve-test-environment.outputs.image-uri }})
echo "CONTAINER_ID=$CONTAINER_ID" >> $GITHUB_ENV
- name: Setup for vLLM tests
run: |
docker exec ${CONTAINER_ID} scripts/vllm/vllm_0_10_2_test_setup.sh
- name: Run vLLM tests
run: |
docker exec ${CONTAINER_ID} scripts/vllm/vllm_regression_test.sh
vllm-rayserve-cuda-test:
needs: [build-vllm-rayserve-image, set-rayserve-test-environment]
if: success()
runs-on:
- codebuild-runner-${{ github.run_id }}-${{ github.run_attempt }}
fleet:x86-g6xl-runner
buildspec-override:true
concurrency:
group: ${{ github.workflow }}-vllm-rayserve-cuda-test-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
- name: Checkout DLC source
uses: actions/checkout@v5
- name: Container pull
uses: ./.github/actions/ecr-authenticate
with:
aws-account-id: ${{ needs.set-rayserve-test-environment.outputs.aws-account-id }}
aws-region: ${{ vars.AWS_REGION }}
image-uri: ${{ needs.set-rayserve-test-environment.outputs.image-uri }}
- name: Checkout vLLM tests
uses: actions/checkout@v5
with:
repository: vllm-project/vllm
ref: v${{ needs.set-rayserve-test-environment.outputs.framework-version }}
path: vllm_source
- name: Start container
run: |
CONTAINER_ID=$(docker run -d -it --rm --gpus=all --entrypoint /bin/bash \
-v ${HOME}/.cache/huggingface:/root/.cache/huggingface \
-v ${HOME}/.cache/vllm:/root/.cache/vllm \
-v .:/workdir --workdir /workdir \
-e HF_TOKEN=${{ secrets.HUGGING_FACE_HUB_TOKEN }} \
${{ needs.set-rayserve-test-environment.outputs.image-uri }})
echo "CONTAINER_ID=$CONTAINER_ID" >> $GITHUB_ENV
- name: Setup for vLLM tests
run: |
docker exec ${CONTAINER_ID} scripts/vllm/vllm_0_10_2_test_setup.sh
- name: Run vLLM tests
run: |
docker exec ${CONTAINER_ID} scripts/vllm/vllm_cuda_test.sh
vllm-rayserve-example-test:
needs: [build-vllm-rayserve-image, set-rayserve-test-environment]
if: success()
runs-on:
- codebuild-runner-${{ github.run_id }}-${{ github.run_attempt }}
fleet:x86-g6xl-runner
buildspec-override:true
concurrency:
group: ${{ github.workflow }}-vllm-rayserve-example-test-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
- name: Checkout DLC source
uses: actions/checkout@v5
- name: Container pull
uses: ./.github/actions/ecr-authenticate
with:
aws-account-id: ${{ needs.set-rayserve-test-environment.outputs.aws-account-id }}
aws-region: ${{ vars.AWS_REGION }}
image-uri: ${{ needs.set-rayserve-test-environment.outputs.image-uri }}
- name: Checkout vLLM tests
uses: actions/checkout@v5
with:
repository: vllm-project/vllm
ref: v${{ needs.set-rayserve-test-environment.outputs.framework-version }}
path: vllm_source
- name: Start container
run: |
CONTAINER_ID=$(docker run -d -it --rm --gpus=all --entrypoint /bin/bash \
-v ${HOME}/.cache/huggingface:/root/.cache/huggingface \
-v ${HOME}/.cache/vllm:/root/.cache/vllm \
-v .:/workdir --workdir /workdir \
-e HF_TOKEN=${{ secrets.HUGGING_FACE_HUB_TOKEN }} \
${{ needs.set-rayserve-test-environment.outputs.image-uri }})
echo "CONTAINER_ID=$CONTAINER_ID" >> $GITHUB_ENV
- name: Setup for vLLM tests
run: |
docker exec ${CONTAINER_ID} scripts/vllm/vllm_0_10_2_test_setup.sh
- name: Run vLLM tests
run: |
docker exec ${CONTAINER_ID} scripts/vllm/vllm_rayserve_examples_test.sh
generate-rayserve-release-spec:
needs: [load-config, build-vllm-rayserve-image, vllm-rayserve-regression-test, vllm-rayserve-cuda-test, vllm-rayserve-example-test]
if: |
always() && !failure() && !cancelled() &&
needs.build-vllm-rayserve-image.result == 'success' &&
needs.vllm-rayserve-regression-test.result == 'success' &&
needs.vllm-rayserve-cuda-test.result == 'success' &&
needs.vllm-rayserve-example-test.result == 'success'
runs-on: ubuntu-latest
outputs:
release-spec: ${{ steps.generate.outputs.release-spec }}
should-release: ${{ steps.check-release.outputs.should-release }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Check if release is enabled
id: check-release
run: |
echo '${{ needs.load-config.outputs.rayserve-config }}' > config.json
RELEASE_ENABLED=$(jq -r '.release.release // false' config.json)
echo "Release enabled: ${RELEASE_ENABLED}"
echo "should-release=${RELEASE_ENABLED}" >> $GITHUB_OUTPUT
- name: Generate release spec
id: generate
if: steps.check-release.outputs.should-release == 'true'
uses: ./.github/actions/generate-release-spec
with:
config-json: ${{ needs.load-config.outputs.rayserve-config }}
release-rayserve-image:
needs: [load-config, build-vllm-rayserve-image, generate-rayserve-release-spec]
if: needs.generate-rayserve-release-spec.outputs.should-release == 'true'
uses: ./.github/workflows/reusable-release-image.yml
with:
source-image-uri: ${{ needs.build-vllm-rayserve-image.outputs.ci-image }}
release-spec: ${{ needs.generate-rayserve-release-spec.outputs.release-spec }}
environment: ${{ fromJson(needs.load-config.outputs.rayserve-config).release.environment }}
aws-region: ${{ vars.AWS_REGION }}
runner-fleet: default-runner