Skip to content

Commit 0457cf9

Browse files
committed
Add workflow yml for validate.
1 parent b756a5e commit 0457cf9

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/Validate-GPU.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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+
TASK: GraphNet-CI-${{ github.event.pull_request.number }}-Validate
12+
BRANCH: ${{ github.event.pull_request.base.ref }}
13+
CI_name: ci-graphnet-validate
14+
CFS_DIR: /home/data/cfs
15+
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
16+
docker_image: "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/ci/paddle:4251d0b615371e0d0ed9040d7455e2b4" # cuda11.7
17+
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
jobs:
23+
validate:
24+
name: Validate
25+
if: ${{ inputs.can-skip != 'true' }}
26+
runs-on:
27+
group: BD_BJ-V100
28+
steps:
29+
- name: Check docker image and run container
30+
env:
31+
work_dir: ${{ github.workspace }}
32+
CACHE_DIR: /home/data/cfs/.cache
33+
run: |
34+
container_name=${TASK}-${core_index}-$(date +%Y%m%d-%H%M%S)
35+
echo "container_name=${container_name}" >> ${{ github.env }}
36+
docker container ls -a --filter "name=GraphNet-CI-*-Validate-${core_index}*" --format "{{.ID}}" | xargs -r docker rm -f
37+
docker run -d -t --gpus all --name ${container_name} --shm-size=128g \
38+
-v "/home/data/cfs:/home/data/cfs" \
39+
-v "/home/data/cfs/.cache:/root/.cache" \
40+
-v "/home/data/cfs/.ccache:/root/.ccache" \
41+
-v "/dev/shm:/dev/shm" \
42+
-v ${{ github.workspace }}/../../..:${{ github.workspace }}/../../.. \
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+
git config --global --add safe.directory ${work_dir}
64+
pwd
65+
ls /graphnet
66+
bash ${work_dir}/tools/ci/check_validate.sh
67+
'
68+
69+
- name: Terminate and delete the container
70+
if: always()
71+
run: |
72+
set +e
73+
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
74+
docker rm -f ${{ env.container_name }}

0 commit comments

Comments
 (0)