Skip to content

Commit 69eaec8

Browse files
committed
Add workflow yml for validate.
1 parent b756a5e commit 69eaec8

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.github/workflows/Validate-GPU.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
ls ${{ github.workspace }}
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 }}/../../..:${{ github.workspace }}/../../.. \
44+
-v ${{ github.workspace }}:/graphnet \
45+
-e python \
46+
-e core_index \
47+
-e BRANCH \
48+
-e PR_ID \
49+
-e COMMIT_ID \
50+
-e work_dir \
51+
-e no_proxy \
52+
-e CI_name \
53+
-e CACHE_DIR \
54+
-e GITHUB_API_TOKEN \
55+
-e CFS_DIR \
56+
-w /graphnet --network host ${docker_image}
57+
58+
- name: Run check
59+
env:
60+
work_dir: ${{ github.workspace }}
61+
run: |
62+
docker exec -t ${{ env.container_name }} /bin/bash -c '
63+
source ${{ github.workspace }}/../../../proxy
64+
git config --global --add safe.directory ${work_dir}
65+
pwd
66+
ls /graphnet
67+
ls ${work_dir}
68+
bash ${work_dir}/tools/ci/check_validate.sh
69+
'
70+
71+
- name: Terminate and delete the container
72+
if: always()
73+
run: |
74+
set +e
75+
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
76+
docker rm -f ${{ env.container_name }}

0 commit comments

Comments
 (0)