Skip to content

Commit 606075c

Browse files
committed
Add workflow yml for validate.
1 parent b756a5e commit 606075c

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/Validate-GPU.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Validate-GPU
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
8+
env:
9+
PR_ID: ${{ github.event.pull_request.number }}
10+
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
11+
work_dir: /graphnet
12+
ci_scripts: /graphnet/tools/ci
13+
TASK: GraphNet-CI-${{ github.event.pull_request.number }}-Validate
14+
BRANCH: ${{ github.event.pull_request.base.ref }}
15+
CI_name: ci-graphnet-validate
16+
CFS_DIR: /home/data/cfs
17+
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
18+
docker_image: "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/ci/paddle:4251d0b615371e0d0ed9040d7455e2b4" # cuda11.7
19+
20+
defaults:
21+
run:
22+
shell: bash
23+
24+
jobs:
25+
validate:
26+
name: Validate
27+
if: ${{ inputs.can-skip != 'true' }}
28+
runs-on:
29+
group: BD_BJ-V100
30+
steps:
31+
- name: Check docker image and run container
32+
env:
33+
CACHE_DIR: /home/data/cfs/.cache
34+
run: |
35+
container_name=${TASK}-${core_index}-$(date +%Y%m%d-%H%M%S)
36+
echo "container_name=${container_name}" >> ${{ github.env }}
37+
docker container ls -a --filter "name=GraphNet-CI-*-Validate-${core_index}*" --format "{{.ID}}" | xargs -r docker rm -f
38+
docker run -d -t --gpus all --name ${container_name} --shm-size=128g \
39+
-v "/home/data/cfs:/home/data/cfs" \
40+
-v "/home/data/cfs/.cache:/root/.cache" \
41+
-v "/home/data/cfs/.ccache:/root/.ccache" \
42+
-v "/dev/shm:/dev/shm" \
43+
-v ${{ github.workspace }}:/graphnet \
44+
-e python \
45+
-e core_index \
46+
-e BRANCH \
47+
-e PR_ID \
48+
-e COMMIT_ID \
49+
-e work_dir \
50+
-e no_proxy \
51+
-e CI_name \
52+
-e CACHE_DIR \
53+
-e GITHUB_API_TOKEN \
54+
-e CFS_DIR \
55+
-w /graphnet --network host ${docker_image}
56+
57+
- name: Run check
58+
env:
59+
work_dir: ${{ github.workspace }}
60+
run: |
61+
docker exec -t ${{ env.container_name }} /bin/bash -c '
62+
source ${{ github.workspace }}/../../../proxy
63+
bash ${ci_scripts}/check_validate.sh
64+
'
65+
66+
- name: Terminate and delete the container
67+
if: always()
68+
run: |
69+
set +e
70+
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
71+
docker rm -f ${{ env.container_name }}

0 commit comments

Comments
 (0)