Skip to content

Commit 4e34d94

Browse files
authored
Use the right Docker image for non-main commits (#45)
* Use the right Docker image for non-main commits Signed-off-by: Huy Do <huydhn@gmail.com> * Debug Signed-off-by: Huy Do <huydhn@gmail.com> * Fix the logic to detect branch name Signed-off-by: Huy Do <huydhn@gmail.com> --------- Signed-off-by: Huy Do <huydhn@gmail.com>
1 parent 046a22c commit 4e34d94

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

.github/scripts/upload_benchmark_results.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,16 @@ def get_git_metadata(repo_dir: str) -> Tuple[str, str]:
131131
hexsha,
132132
committed_date,
133133
)
134-
except TypeError:
135-
# This is a detached HEAD, default the branch to main
134+
except TypeError as e:
135+
# This is a detached HEAD, try to find out where the commit comes from
136+
for head in repo.heads:
137+
info(f"Check commits from {head.name}")
138+
for commit in repo.iter_commits(head):
139+
if commit.hexsha == hexsha:
140+
return repo_name, head.name, hexsha, committed_date
141+
142+
warning(f"Found no branch name, default to main: {e}")
143+
# We couldn't find the branch name
136144
return repo_name, "main", hexsha, committed_date
137145

138146

.github/workflows/vllm-benchmark.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,18 @@ jobs:
139139
140140
- name: Set Docker registry
141141
shell: bash
142+
env:
143+
HEAD_BRANCH: ${{ inputs.vllm_branch || 'main' }}
142144
run: |
143-
DOCKER_IMAGE_PREFIX=public.ecr.aws/q9t5s3a7/vllm-ci-postmerge-repo
145+
set -eux
146+
147+
# Mimic the logic from vllm ci-infra test template
148+
if [[ "${HEAD_BRANCH}" == "main" ]]; then
149+
DOCKER_IMAGE_PREFIX=public.ecr.aws/q9t5s3a7/vllm-ci-postmerge-repo
150+
else
151+
DOCKER_IMAGE_PREFIX=public.ecr.aws/q9t5s3a7/vllm-ci-test-repo
152+
fi
153+
144154
DOCKER_IMAGE_SUFFIX=""
145155
if [[ "${DEVICE_NAME}" == "rocm" ]]; then
146156
DOCKER_IMAGE_PREFIX=docker.io/rocm/vllm-ci
@@ -284,7 +294,7 @@ jobs:
284294
sudo chown -R ${UID} "${BENCHMARK_RESULTS}"
285295
ls -lah "${BENCHMARK_RESULTS}"
286296
287-
SANITIZED_DEVICE_TYPE=$(echo "${DEVICE_TYPE// /_}" | sed "s/[^[:alpha:].-]/_/g")
297+
SANITIZED_DEVICE_TYPE=$(echo "${DEVICE_TYPE// /_}" | sed "s/[^[:alnum:].-]/_/g")
288298
python3 .github/scripts/upload_benchmark_results.py \
289299
--repo vllm-benchmarks/vllm \
290300
--benchmark-name "vLLM benchmark" \

0 commit comments

Comments
 (0)