1
+ name : Unittest GPU CE
2
+
3
+ on :
4
+ schedule :
5
+ - cron : " 0 16 * * 0"
6
+
7
+ concurrency :
8
+ group : unittest-${{ github.workflow }}
9
+ cancel-in-progress : true
10
+
11
+ env :
12
+ COMMIT_ID : ${{ github.event.pull_request.head.sha }}
13
+ TASK : PaddleFormers-CE-unittest-gpu
14
+ ce_scripts : /workspace/PaddleFormers/scripts/unit_test
15
+ BRANCH : ${{ github.event.pull_request.base.ref }}
16
+ AGILE_COMPILE_BRANCH : ${{ github.event.pull_request.base.ref }}
17
+ CE_name : unittest-gpu-ce
18
+ no_proxy : " localhost,bj.bcebos.com,su.bcebos.com,bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
19
+
20
+ defaults :
21
+ run :
22
+ shell : bash
23
+
24
+ jobs :
25
+ unittest-gpu-ce :
26
+ name : unittest-gpu-ce
27
+ runs-on : [self-hosted, ernie-8gpu]
28
+ steps :
29
+ - name : Determine Image Name
30
+ run : |
31
+ echo "IMAGE_NAME=iregistry.baidu-int.com/paddlecloud/base-images:paddlecloud-ubuntu18.04-gcc8.2-cuda11.8-cudnn8.6-nccl2.15.5-latest" >> "$GITHUB_ENV"
32
+
33
+ - name : Run Container
34
+ env :
35
+ work_dir : ${{ github.workspace }}
36
+ FLAGS_dynamic_static_unified_comm : " True"
37
+ python_version : " 3.10"
38
+ paddle_whl : https://paddle-qa.bj.bcebos.com/paddle-pipeline/Develop-GpuSome-LinuxCentos-Gcc82-Cuda118-Cudnn86-Trt85-Py310-CENN-Compile/latest/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
39
+ run : |
40
+ container_name=${TASK}-$(date +%Y%m%d-%H%M%S)
41
+ echo "container_name=${container_name}" >> "$GITHUB_ENV"
42
+ docker run -d -t --name ${container_name} --net=host -v /dev/shm:/dev/shm --shm-size=32G \
43
+ -v $work_dir/../../..:$work_dir/../../.. \
44
+ -v $work_dir:/workspace \
45
+ -v /home/.cache/pip:/home/.cache/pip \
46
+ -e BRANCH \
47
+ -e AGILE_COMPILE_BRANCH \
48
+ -e COMMIT_ID \
49
+ -e work_dir \
50
+ -e ce_scripts \
51
+ -e no_proxy \
52
+ -e CE_name \
53
+ -e paddle_whl \
54
+ -e FLAGS_dynamic_static_unified_comm \
55
+ -e python_version \
56
+ -w /workspace --runtime=nvidia $IMAGE_NAME
57
+
58
+ - name : Download Code
59
+ run : |
60
+ docker exec -t $container_name /bin/bash -c '
61
+ rm -rf * .[^.]*
62
+ echo "Downloading PaddleFormers.tar"
63
+ wget -q --no-proxy https://paddle-qa.bj.bcebos.com/CodeSync/develop/PaddleFormers.tar --no-check-certificate
64
+ echo "Extracting PaddleFormers.tar"
65
+ tar xf PaddleFormers.tar && rm -rf PaddleFormers.tar
66
+ source $work_dir/../../../proxy
67
+ cd PaddleFormers
68
+ git config --global user.name "PaddleCE"
69
+ git config --global user.email "[email protected] "
70
+ git pull
71
+ git submodule update --init --recursive --force
72
+ git log --pretty=oneline -10
73
+ '
74
+
75
+ - name : Test
76
+ run : |
77
+ docker exec -t $container_name /bin/bash -c '
78
+ ldconfig
79
+ unlink /usr/bin/python3
80
+ ln -sf $(which python${python_version}) /usr/bin/python3
81
+ pip config set global.cache-dir "/home/.cache/pip"
82
+ set -e
83
+ cd /workspace/PaddleFormers && git config --global --add safe.directory $PWD
84
+ timeout 1h bash scripts/unit_test/ci_unit.sh ${paddle} true
85
+ '
86
+
87
+ - name : Upload Allure-reports & Logs
88
+ if : always()
89
+ env :
90
+ home_path : ${{ github.workspace }}/../../..
91
+ bos_file : ${{ github.workspace }}/../../../bos/BosClient.py
92
+ allure_file : ${{ github.workspace }}/../../../allure-2.19.0/bin/allure
93
+ run : |
94
+ docker exec -t $container_name /bin/bash -c '
95
+ if [ ! -f "${{ env.bos_file }}" ]; then
96
+ wget -q --no-proxy -O ${{ env.home_path }}/bos_new.tar.gz https://xly-devops.bj.bcebos.com/home/bos_new.tar.gz --no-check-certificate
97
+ mkdir ${{ env.home_path }}/bos
98
+ tar xf ${{ env.home_path }}/bos_new.tar.gz -C ${{ env.home_path }}/bos
99
+ fi
100
+ if [ ! -f "${{ env.allure_file }}" ]; then
101
+ wget -q --no-proxy -O ${{ env.home_path }}/allure-2.19.0.zip https://xly-devops.bj.bcebos.com/tools/allure-2.19.0.zip --no-check-certificate
102
+ unzip -q ${{ env.home_path }}/allure-2.19.0.zip
103
+ fi
104
+ bos_prefix="schedule/$(date +%Y%m%d)"
105
+ cd /workspace/PaddleFormers/unittest_logs
106
+ for FILE in /workspace/PaddleFormers/unittest_logs/*; do
107
+ file=$(basename "$FILE")
108
+ python ${{ env.bos_file }} $file paddle-github-action/PR/PaddleFormers/unittest-gpu/${bos_prefix}/logs
109
+ echo "$file: https://paddle-github-action.bj.bcebos.com/PR/PaddleFormers/unittest-gpu/${bos_prefix}/logs/$file"
110
+ done
111
+ cd /workspace/PaddleFormers/
112
+ ${{ env.allure_file }} generate result -o report
113
+ tar -czf products.tar.gz report unittest_logs
114
+ python ${{ env.bos_file }} products.tar.gz paddle-github-action/PR/PaddleFormers/unittest-gpu/${bos_prefix}/logs
115
+ echo "report: https://paddle-github-action.bj.bcebos.com/PR/PaddleFormers/unittest-gpu/${bos_prefix}/logs/products.tar.gz"
116
+ '
117
+
118
+ - name : Terminate And Delete the Container
119
+ if : always()
120
+ run : |
121
+ docker rm -f $container_name 2>/dev/null || true
0 commit comments