Skip to content

Commit 8dcda1b

Browse files
committed
Add vllm_branch and vllm_commit to workflow dispatch
Signed-off-by: Huy Do <huydhn@gmail.com>
1 parent 02ca3ce commit 8dcda1b

File tree

1 file changed

+37
-27
lines changed

1 file changed

+37
-27
lines changed

.github/workflows/vllm-benchmark.yml

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ on:
55
# Run every 2 hours
66
- cron: '0 */2 * * *'
77
workflow_dispatch:
8+
inputs:
9+
vllm_branch:
10+
required: true
11+
type: string
12+
default: main
13+
vllm_commit:
14+
required: false
15+
type: string
816
pull_request:
917
paths:
1018
- .github/workflows/vllm-benchmark.yml
@@ -27,7 +35,7 @@ jobs:
2735
with:
2836
repository: vllm-project/vllm
2937
path: vllm-benchmarks/vllm
30-
ref: main
38+
ref: ${{ inputs.vllm_branch || 'main' }}
3139
fetch-depth: 0
3240

3341
- uses: actions/setup-python@v5
@@ -50,35 +58,38 @@ jobs:
5058
- name: Check for last benchmark commit
5159
working-directory: vllm-benchmarks
5260
env:
53-
HEAD_BRANCH: main
61+
HEAD_BRANCH: ${{ inputs.vllm_branch || 'main' }}
62+
HEAD_SHA: ${{ inputs.vllm_commit || '' }}
5463
DOCKER_IMAGE_PREFIX: public.ecr.aws/q9t5s3a7/vllm-ci-postmerge-repo
5564
run: |
5665
set -eux
5766
58-
pushd vllm
59-
# Looking back the latest 100 commits is enough
60-
for i in {0..99}
61-
do
62-
# Check if the image is there, if it doesn't then check an older one
63-
# because the commit is too recent
64-
HEAD_SHA=$(git rev-parse --verify HEAD~${i})
65-
DOCKER_IMAGE="${DOCKER_IMAGE_PREFIX}:${HEAD_SHA}"
66-
67-
# No Docker image available yet because the commit is too recent
68-
if ! docker manifest inspect "${DOCKER_IMAGE}"; then
69-
continue
70-
fi
71-
72-
NOT_EXIST=0
73-
S3_PATH="v3/vllm-project/vllm/${HEAD_BRANCH}/${HEAD_SHA}/${GPU_DEVICE}/benchmark_results.json"
74-
aws s3api head-object --bucket ossci-benchmarks --key ${S3_PATH} || NOT_EXIST=1
75-
76-
if [[ ${NOT_EXIST} == "1" ]]; then
77-
echo "Found a vLLM commit ${HEAD_SHA} that hasn't been benchmarked yet"
78-
break
79-
fi
80-
done
81-
popd
67+
if [[ -z "${HEAD_SHA}" ]]; then
68+
pushd vllm
69+
# Looking back the latest 100 commits is enough
70+
for i in {0..99}
71+
do
72+
# Check if the image is there, if it doesn't then check an older one
73+
# because the commit is too recent
74+
HEAD_SHA=$(git rev-parse --verify HEAD~${i})
75+
DOCKER_IMAGE="${DOCKER_IMAGE_PREFIX}:${HEAD_SHA}"
76+
77+
# No Docker image available yet because the commit is too recent
78+
if ! docker manifest inspect "${DOCKER_IMAGE}"; then
79+
continue
80+
fi
81+
82+
NOT_EXIST=0
83+
S3_PATH="v3/vllm-project/vllm/${HEAD_BRANCH}/${HEAD_SHA}/${GPU_DEVICE}/benchmark_results.json"
84+
aws s3api head-object --bucket ossci-benchmarks --key ${S3_PATH} || NOT_EXIST=1
85+
86+
if [[ ${NOT_EXIST} == "1" ]]; then
87+
echo "Found a vLLM commit ${HEAD_SHA} that hasn't been benchmarked yet"
88+
break
89+
fi
90+
done
91+
popd
92+
fi
8293
8394
echo "HEAD_SHA=$HEAD_SHA" >> $GITHUB_ENV
8495
@@ -133,7 +144,6 @@ jobs:
133144
working-directory: vllm-benchmarks
134145
env:
135146
BENCHMARK_RESULTS: vllm/benchmarks/results
136-
HEAD_BRANCH: main
137147
run: |
138148
set -eux
139149

0 commit comments

Comments
 (0)