Skip to content

Commit

Permalink
add docker container clean up in CI (#131)
Browse files Browse the repository at this point in the history
Signed-off-by: chensuyue <[email protected]>
  • Loading branch information
chensuyue authored May 14, 2024
1 parent 2887cad commit c6b6a32
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ChatQnA_gaudi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: ChatQnA E2E test on Gaudi

on:
pull_request:
pull_request_target:
branches: [main]
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
paths:
Expand Down Expand Up @@ -37,7 +37,17 @@ jobs:
AISE_CLUSTER_01_2_IP: ${{ secrets.AISE_CLUSTER_01_2_IP }}
run: |
cd ${{ github.workspace }}/ChatQnA/tests
bash test_chatqna_on_gaudi.sh
timeout 20m bash test_chatqna_on_gaudi.sh
- name: Clean Up Container
if: cancelled() || failure()
run: |
cd ${{ github.workspace }}/ChatQnA/microservice/gaudi
container_list=$(cat docker_compose.yaml | grep container_name | cut -d':' -f2)
for container_name in $container_list; do
cid=$(docker ps -aq --filter "name=$container_name")
if [[ ! -z "$cid" ]]; then docker stop $cid && docker rm $cid && sleep 1s; fi
done
- name: Publish pipeline artifact
if: ${{ !cancelled() }}
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/ChatQnA_xeon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name: ChatQnA E2E test on Xeon

on:
pull_request:
pull_request_target:
branches: [main]
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
paths:
Expand Down Expand Up @@ -37,7 +37,17 @@ jobs:
AISE_CLUSTER_01_2_IP: ${{ secrets.AISE_CLUSTER_01_2_IP }}
run: |
cd ${{ github.workspace }}/ChatQnA/tests
bash test_chatqna_on_xeon.sh
timeout 20m bash test_chatqna_on_xeon.sh
- name: Clean Up Container
if: cancelled() || failure()
run: |
cd ${{ github.workspace }}/ChatQnA/microservice/xeon
container_list=$(cat docker_compose.yaml | grep container_name | cut -d':' -f2)
for container_name in $container_list; do
cid=$(docker ps -aq --filter "name=$container_name")
if [[ ! -z "$cid" ]]; then docker stop $cid && docker rm $cid && sleep 1s; fi
done
- name: Publish pipeline artifact
if: ${{ !cancelled() }}
Expand Down
2 changes: 1 addition & 1 deletion ChatQnA/tests/test_chatqna_on_gaudi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function check_microservices() {
-X POST \
-d '{"text":"hello"}' \
-H 'Content-Type: application/json' > ${LOG_PATH}/embeddings.log
sleep 5s
sleep 10s

curl http://${ip_address}:7000/v1/retrieval \
-X POST \
Expand Down
2 changes: 1 addition & 1 deletion ChatQnA/tests/test_chatqna_on_xeon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function check_microservices() {
-X POST \
-d '{"text":"hello"}' \
-H 'Content-Type: application/json' > ${LOG_PATH}/embeddings.log
sleep 5s
sleep 10s

test_embedding=$(python -c "import random; embedding = [random.uniform(-1, 1) for _ in range(768)]; print(embedding)")
curl http://${ip_address}:7000/v1/retrieval \
Expand Down

0 comments on commit c6b6a32

Please sign in to comment.