Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docker container clean up #131

Merged
merged 6 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading