Skip to content

Commit 77c704f

Browse files
authored
add commit-id to distinguish image and container for each PR (#85)
Current CI does not distinguish PR during image build and container launch If multiple CI triggered, it will overwrite other PR's docker image. In this commit, I propose to use difference name for each PR docker/container. Signed-off-by: Chendi.Xue <[email protected]>
1 parent ab65f9b commit 77c704f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/pre-merge.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: |
3737
echo "Attempting to build Docker image..."
3838
# Ensure this image is accessible from GitHub Actions (e.g., public registry or authenticated private registry).
39-
docker build --no-cache -t hpu-plugin-v1-test-env-pre-merge -f - . <<EOF
39+
docker build --no-cache -t hpu-plugin-v1-test-env-pre-merge-${{ github.event.pull_request.head.sha }} -f - . <<EOF
4040
FROM 1.22-619-pt2.7.1:latest
4141
4242
COPY ./ /workspace/vllm-gaudi
@@ -80,16 +80,16 @@ jobs:
8080
- name: Run pytest in tests/unit_tests
8181
run: |
8282
EXITCODE=1
83-
remove_docker_containers() { docker rm -f hpu-plugin-v1-test-unit-tests || true; }
83+
remove_docker_containers() { docker rm -f hpu-plugin-v1-test-unit-tests-${{ github.event.pull_request.head.sha }} || true; }
8484
trap 'remove_docker_containers; exit $EXITCODE;' EXIT
8585
remove_docker_containers
8686
8787
echo "Running HPU plugin v1 unit tests"
88-
docker run --rm --runtime=habana --name=hpu-plugin-v1-test-unit-tests --network=host \
88+
docker run --rm --runtime=habana --name=hpu-plugin-v1-test-unit-tests-${{ github.event.pull_request.head.sha }} --network=host \
8989
-e HABANA_VISIBLE_DEVICES=all \
9090
-e HF_HOME=/workspace/hf_cache \
9191
-v /mnt/hf_cache:/workspace/hf_cache \
92-
hpu-plugin-v1-test-env-pre-merge \
92+
hpu-plugin-v1-test-env-pre-merge-${{ github.event.pull_request.head.sha }} \
9393
/bin/bash -c "pytest -vvv --durations=10 --durations-min=1.0 /workspace/vllm-gaudi/tests/unit_tests"
9494
9595
EXITCODE=$?
@@ -104,16 +104,16 @@ jobs:
104104
- name: Run test scripts
105105
run: |
106106
EXITCODE=1
107-
remove_docker_containers() { docker rm -f hpu-plugin-v1-e2e-tests || true; }
107+
remove_docker_containers() { docker rm -f hpu-plugin-v1-test-e2e-tests-${{ github.event.pull_request.head.sha }} || true; }
108108
trap 'remove_docker_containers; exit $EXITCODE;' EXIT
109109
remove_docker_containers
110110
111111
echo "Running HPU plugin v1 e2e tests"
112-
docker run --rm --runtime=habana --name=hpu-plugin-v1-test-pre-merge --network=host \
112+
docker run --rm --runtime=habana --name=hpu-plugin-v1-test-e2e-tests-${{ github.event.pull_request.head.sha }} --network=host \
113113
-e HABANA_VISIBLE_DEVICES=all \
114114
-e HF_HOME=/workspace/hf_cache \
115115
-v /mnt/hf_cache:/workspace/hf_cache \
116-
hpu-plugin-v1-test-env-pre-merge \
116+
hpu-plugin-v1-test-env-pre-merge-${{ github.event.pull_request.head.sha }} \
117117
/bin/bash "/workspace/vllm-gaudi/tests/full_tests/ci_gsm8k_tests.sh"
118118
119119
EXITCODE=$?

0 commit comments

Comments
 (0)