update CodeGen CI workflow for microservice(#159)

Signed-off-by: chensuyue <suyue.chen@intel.com>
This commit is contained in:
chen, suyue
2024-05-20 19:44:03 +08:00
committed by GitHub
parent 3efa905e7e
commit 4b16f4088e
2 changed files with 74 additions and 10 deletions

57
.github/workflows/CodeGen_gaudi.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: CodeGen E2E test on Gaudi
on:
pull_request_target:
branches: [main]
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
paths:
- CodeGen/microservice/gaudi/**
- CodeGen/tests/test_codegen_on_gaudi.sh
- "!**.md"
- "!**/ui/**"
- .github/workflows/CodeGen_gaudi.yml
workflow_dispatch:
# If there is a new commit, the previous jobs will be canceled
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
CodeGen-Gaudi:
runs-on: aise-cluster
steps:
- name: Clean Up Working Directory
run: sudo rm -rf ${{github.workspace}}/*
- name: Checkout out Repo
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Run Test
env:
HUGGINGFACEHUB_API_TOKEN: ${{ secrets.HUGGINGFACEHUB_API_TOKEN }}
AISE_CLUSTER_01_2_IP: ${{ secrets.AISE_CLUSTER_01_2_IP }}
run: |
cd ${{ github.workspace }}/CodeGen/tests
timeout 20m bash test_codegen_on_gaudi.sh
- name: Clean Up Container
if: cancelled() || failure()
run: |
cd ${{ github.workspace }}/CodeGen/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() }}
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/CodeGen/tests/*.log

View File

@@ -1,17 +1,18 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: CodeGen-test
name: CodeGen E2E test on Xeon
on:
pull_request_target:
branches: [main]
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
paths:
- CodeGen/**
- CodeGen/microservice/xeon/**
- CodeGen/tests/test_codegen_on_xeon.sh
- "!**.md"
- "!**/ui/**"
- .github/workflows/CodeGen.yml
- .github/workflows/CodeGen_xeon.yml
workflow_dispatch:
# If there is a new commit, the previous jobs will be canceled
@@ -20,12 +21,8 @@ concurrency:
cancel-in-progress: true
jobs:
CodeGen:
CodeGen-Xeon:
runs-on: aise-cluster
strategy:
matrix:
job_name: ["codegen"]
fail-fast: false
steps:
- name: Clean Up Working Directory
run: sudo rm -rf ${{github.workspace}}/*
@@ -38,13 +35,23 @@ jobs:
- name: Run Test
env:
HUGGINGFACEHUB_API_TOKEN: ${{ secrets.HUGGINGFACEHUB_API_TOKEN }}
AISE_CLUSTER_01_2_IP: ${{ secrets.AISE_CLUSTER_01_2_IP }}
run: |
cd ${{ github.workspace }}/CodeGen/tests
bash test_${{ matrix.job_name }}_inference.sh
timeout 20m bash test_codegen_on_xeon.sh
- name: Clean Up Container
if: cancelled() || failure()
run: |
cd ${{ github.workspace }}/CodeGen/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() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.job_name }}
path: ${{ github.workspace }}/CodeGen/tests/*.log