Skip to content

Commit 7ba08d6

Browse files
committed
Containerize vLLM CI test + profiling workflows for OSDC runners
OSDC/ARC runners are ephemeral pods with no Docker daemon, so the old 'docker run --gpus all + docker exec' pattern cannot work on them. Run the vLLM CI image via the job-level container: key with options '--gpus all' instead (the GPU is injected by the runner pod), matching pytorch/pytorch _linux-test.yml (test-osdc) and pytorch/helion. - vllm-ci-test.yml / vllm-profiling.yml: add an ubuntu-latest 'resolve-image' pre-job that runs 'docker manifest inspect' (needs a daemon the pod lacks) to pick the latest available vLLM CI image and pass it down as the container image. Drop the GPU_FLAG/docker run/docker exec wrapper and the /tmp/workspace bind-mount; run the scripts directly in the container. - vllm-profiling.yml: assume the upload IAM role via OIDC before the S3 upload (ephemeral pods have no host instance role); pass the resolved vLLM commit through as S3_HEAD_SHA. - run_vllm_profiling.sh: use $GITHUB_WORKSPACE instead of the hardcoded /tmp/workspace bind-mount path.
1 parent a7a54a0 commit 7ba08d6

3 files changed

Lines changed: 121 additions & 210 deletions

File tree

.github/scripts/run_vllm_profiling.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ print_configuration() {
1212
}
1313

1414
setup_workspace() {
15-
WORKSPACE_DIR="/tmp/workspace"
15+
# On OSDC/ARC the job runs inside a container and the repo is checked out at
16+
# $GITHUB_WORKSPACE rather than the old docker-run bind mount at /tmp/workspace.
17+
WORKSPACE_DIR="${GITHUB_WORKSPACE:-/tmp/workspace}"
1618
cd "${WORKSPACE_DIR}"
1719

1820
echo "Creating profiling directory: ${VLLM_TORCH_PROFILER_DIR}"

.github/workflows/vllm-ci-test.yml

Lines changed: 49 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,17 @@ concurrency:
2525
cancel-in-progress: true
2626

2727
jobs:
28-
test:
29-
name: Run vLLM tests
28+
# OSDC/ARC runners are ephemeral pods with no Docker daemon, so the vLLM CI
29+
# image is run via the job-level container: key (see the test job) and must be
30+
# resolved up front. docker manifest inspect needs a daemon, so do it here on a
31+
# GitHub-hosted runner and pass the resolved image down.
32+
resolve-image:
33+
name: Resolve vLLM CI image
34+
runs-on: ubuntu-latest
3035
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'pytorch' }}
31-
strategy:
32-
fail-fast: false
33-
matrix:
34-
include:
35-
# TODO (huydhn): Figure out later if we need to scale this up to multiple runners
36-
- runs-on: mt-l-x86iamx-88-900-h100-4
37-
device-name: cuda
38-
permissions:
39-
id-token: write
40-
contents: read
41-
runs-on: ${{ matrix.runs-on }}
42-
environment: pytorch-x-vllm
36+
outputs:
37+
docker-image: ${{ steps.resolve.outputs.docker-image }}
4338
steps:
44-
- name: Checkout repository
45-
uses: actions/checkout@v4
46-
4739
- name: Checkout vLLM repository
4840
uses: actions/checkout@v4
4941
with:
@@ -52,11 +44,12 @@ jobs:
5244
ref: ${{ inputs.vllm_branch || 'main' }}
5345
fetch-depth: 0
5446

55-
- name: Set Docker registry
56-
shell: bash
47+
- name: Resolve the latest available vLLM CI image
48+
id: resolve
49+
working-directory: vllm
5750
env:
5851
HEAD_BRANCH: ${{ inputs.vllm_branch || 'main' }}
59-
DEVICE_NAME: ${{ matrix.device-name }}
52+
HEAD_SHA: ${{ inputs.vllm_commit || '' }}
6053
run: |
6154
set -eux
6255
@@ -67,67 +60,59 @@ jobs:
6760
DOCKER_IMAGE_PREFIX=public.ecr.aws/q9t5s3a7/vllm-ci-test-repo
6861
fi
6962
70-
DOCKER_IMAGE_SUFFIX=""
71-
if [[ "${DEVICE_NAME}" == "rocm" ]]; then
72-
DOCKER_IMAGE_PREFIX=docker.io/rocm/vllm-ci
73-
elif [[ "${DEVICE_NAME}" == "cpu" ]]; then
74-
DOCKER_IMAGE_SUFFIX=-cpu
75-
fi
76-
echo "DOCKER_IMAGE_PREFIX=$DOCKER_IMAGE_PREFIX" >> $GITHUB_ENV
77-
echo "DOCKER_IMAGE_SUFFIX=$DOCKER_IMAGE_SUFFIX" >> $GITHUB_ENV
78-
79-
- name: Check for available Docker image
80-
working-directory: vllm
81-
env:
82-
HEAD_BRANCH: ${{ inputs.vllm_branch || 'main' }}
83-
HEAD_SHA: ${{ inputs.vllm_commit || '' }}
84-
run: |
85-
set -eux
86-
8763
if [[ -z "${HEAD_SHA}" ]]; then
8864
# Looking back the latest 100 commits is enough
89-
for i in {0..99}
90-
do
65+
for i in {0..99}; do
9166
# Check if the image is there, if it doesn't then check an older one
9267
# because the commit is too recent
9368
HEAD_SHA=$(git rev-parse --verify HEAD~${i})
94-
DOCKER_IMAGE="${DOCKER_IMAGE_PREFIX}:${HEAD_SHA}${DOCKER_IMAGE_SUFFIX}"
95-
96-
# No Docker image available yet because the commit is too recent
69+
DOCKER_IMAGE="${DOCKER_IMAGE_PREFIX}:${HEAD_SHA}"
9770
if docker manifest inspect "${DOCKER_IMAGE}"; then
9871
break
9972
fi
10073
done
10174
fi
10275
103-
echo "HEAD_SHA=$HEAD_SHA" >> $GITHUB_ENV
76+
echo "docker-image=${DOCKER_IMAGE_PREFIX}:${HEAD_SHA}" >> "${GITHUB_OUTPUT}"
77+
78+
test:
79+
name: Run vLLM tests
80+
needs: resolve-image
81+
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'pytorch' }}
82+
strategy:
83+
fail-fast: false
84+
matrix:
85+
include:
86+
# TODO (huydhn): Figure out later if we need to scale this up to multiple runners
87+
- runs-on: mt-l-x86iamx-88-900-h100-4
88+
device-name: cuda
89+
permissions:
90+
id-token: write
91+
contents: read
92+
runs-on: ${{ matrix.runs-on }}
93+
environment: pytorch-x-vllm
94+
# OSDC/ARC runners run the workload inside this container; the GPU is exposed
95+
# by the runner pod, the same pattern as pytorch/pytorch _linux-test.yml
96+
# (test-osdc) and pytorch/helion.
97+
container:
98+
image: ${{ needs.resolve-image.outputs.docker-image }}
99+
options: --gpus all
100+
steps:
101+
- name: GPU health check
102+
run: nvidia-smi || true
104103

105-
- name: Setup CUDA GPU_FLAG for docker run
106-
if: matrix.device-name == 'cuda'
104+
- name: Install git
107105
run: |
108-
echo "GPU_FLAG=--gpus all -e NVIDIA_DRIVER_CAPABILITIES=all" >> "${GITHUB_ENV}"
106+
# The vLLM CI image may not ship git, which actions/checkout needs
107+
(command -v git || (apt-get update && apt-get install -y git)) || true
108+
git config --global --add safe.directory '*' || true
109109
110-
- name: Setup ROCm
111-
if: matrix.device-name == 'rocm'
112-
uses: pytorch/pytorch/./.github/actions/setup-rocm@main
110+
- name: Checkout repository
111+
uses: actions/checkout@v4
113112

114113
- name: Run vLLM tests
115114
env:
116115
HF_TOKEN: ${{ secrets.HF_TOKEN }}
117-
DOCKER_IMAGE: ${{ env.DOCKER_IMAGE_PREFIX }}:${{ env.HEAD_SHA }}${{ env.DOCKER_IMAGE_SUFFIX }}
118116
run: |
119117
set -eux
120-
121-
container_name=$(docker run \
122-
${GPU_FLAG:-} \
123-
-e HF_TOKEN \
124-
--ipc=host \
125-
--tty \
126-
--detach \
127-
--security-opt seccomp=unconfined \
128-
--shm-size=4g \
129-
-v "${GITHUB_WORKSPACE}:/tmp/workspace" \
130-
-w /tmp/workspace \
131-
"${DOCKER_IMAGE}"
132-
)
133-
docker exec -t "${container_name}" bash -c "bash .github/scripts/run_vllm_tests.sh"
118+
bash .github/scripts/run_vllm_tests.sh

0 commit comments

Comments
 (0)