From 5a70ad78131d6822e6c44283f918fa6a408b4529 Mon Sep 17 00:00:00 2001 From: simon-mo Date: Tue, 20 Feb 2024 10:33:44 -0800 Subject: [PATCH] remove only the rocm container --- .github/workflows/rocm.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rocm.yml b/.github/workflows/rocm.yml index 725aa9f14757e..46461173abf36 100644 --- a/.github/workflows/rocm.yml +++ b/.github/workflows/rocm.yml @@ -23,15 +23,14 @@ jobs: docker build -t rocm -f Dockerfile.rocm . - name: Run Sanity Test run: | - # detele any existing container - docker rm -f $(docker ps -a -q) - # run the container - docker run -d --p 8000:8000 rocm - # wait for the server to start + remove_docker_container() { + docker rm -f rocm || true + } + trap remove_docker_container EXIT + + remove_docker_container + docker run -d --p 8000:8000 -n rocm rocm while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8000)" != "200" ]; do sleep 1; done - # run the sanity test python examples/openai_completion_client.py - # remove the container - docker rm -f $(docker ps -a -q)