forked from PaddlePaddle/Paddle
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (142 loc) · 5.04 KB
/
_Py3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: PR-CI-Py3
on:
workflow_call:
env:
dockerfile: Dockerfile.cuda9_cudnn7_gcc48_py35_centos6
docker_image: 077ca344c322
PR_ID: ${{ github.event.pull_request.number }}
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
TASK: paddle-CI-${{ github.event.pull_request.number }}-py3
ci_scripts: ${{ github.workspace }}/ci
defaults:
run:
shell: bash
jobs:
build-and-test:
runs-on:
group: GZ_BD-CPU
steps:
- name: Check docker image and run container
env:
BRANCH: develop
work_dir: ${{ github.workspace }}
PADDLE_ROOT: ${{ github.workspace }}
WITH_SHARED_PHI: "ON"
WITH_MKL: "OFF"
WITH_TESTING: "ON"
COVERALLS_UPLOAD: "OFF"
GIT_PR_ID: ${{ github.event.pull_request.number }}
PADDLE_VERSION: 0.0.0
WITH_DISTRIBUTE: "ON"
PREC_SUFFIX: .py3
WITH_UNITY_BUILD: "ON"
PY_VERSION: 3.9
PROC_RUN: 12
FLAGS_enable_eager_mode: 1
WITH_TENSORRT: "OFF"
GENERATOR: "Ninja"
CCACHE_MAXSIZE: 150G
CCACHE_LIMIT_MULTIPLE: 0.8
WITH_AVX: "OFF"
CCACHE_DIR: "/root/.ccache/py3"
run: |
# bash ${{ github.workspace }}/paddle/scripts/paddle_build/check_docker_image.sh
container_name=${TASK}-$(date +%s)
echo "container_name=${container_name}" >> ${{ github.env }}
docker run -d -t --name ${container_name} \
-v "/home/data/cfs:/home/data/cfs" \
-v "/home/data/cfs/.cache:/root/.cache" \
-v "/home/data/cfs/.ccache:/root/.ccache" \
-v "/dev/shm:/dev/shm" \
-v "${{ github.workspace }}/../../../..:${{ github.workspace }}/../../../.." \
-e BRANCH \
-e PR_ID \
-e COMMIT_ID \
-e work_dir \
-e PADDLE_ROOT \
-e WITH_SHARED_PHI \
-e WITH_MKL \
-e WITH_TESTING \
-e COVERALLS_UPLOAD \
-e GIT_PR_ID \
-e PADDLE_VERSION \
-e WITH_DISTRIBUTE \
-e PREC_SUFFIX \
-e WITH_UNITY_BUILD \
-e PY_VERSION \
-e PROC_RUN \
-e FLAGS_enable_eager_mode \
-e WITH_TENSORRT \
-e GENERATOR \
-e CCACHE_MAXSIZE \
-e CCACHE_LIMIT_MULTIPLE \
-e GITHUB_ENV \
-e ci_scripts \
-e WITH_AVX \
-e CCACHE_DIR \
-w ${{ github.workspace }} --network host ${docker_image}
- name: Download paddle.tar.gz and merge develop
env:
work_dir: ${{ github.workspace }}
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
rm -rf * .[^.]*
rm -rf /root/.cache && ln -s /home/data/cfs/.cache/python35-cpu /root/.cache
set -e
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/Paddle/${PR_ID}/${COMMIT_ID}/Paddle.tar.gz --no-check-certificate
tar xf Paddle.tar.gz --strip-components=1
rm Paddle.tar.gz
git config --global user.name "PaddleCI"
git config --global user.email "[email protected]"
git remote add upstream https://github.com/PaddlePaddle/Paddle.git
. ../../../proxy
git checkout develop
git pull upstream develop
git fetch upstream develop
git checkout test
git merge --no-edit develop
'
- name: Build
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
. ../../../proxy
bash ${ci_scripts}/run_setup.sh ${PYTHON_ABI:-""} bdist_wheel ${parallel_number:-""} py3
EXCODE=$?
exit $EXCODE
'
- name: Test
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
. ../../../proxy
bash ${ci_scripts}/run_linux_cpu_test.sh
EXCODE=$?
source ${ci_scripts}/utils.sh; clean_build_files
echo "::group::Install bce-python-sdk"
python -m pip install bce-python-sdk==0.8.74
echo "::endgroup::"
exit $EXCODE
'
- name: Upload paddle_whl
env:
home_path: ${{ github.workspace }}/..
bos_file: ${{ github.workspace }}/../bos/BosClient.py
paddle_whl: paddlepaddle-0.0.0-cp39-cp39-linux_x86_64.whl
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
export AK=paddle
export SK=paddle
if [ ! -f "${{ env.bos_file }}" ]; then
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
mkdir ${{ env.home_path }}/bos
tar xf ${{ env.home_path }}/bos_new.tar.gz -C ${{ env.home_path }}/bos
fi
cd ${{ github.workspace }}/dist
python3.9 ${{ env.bos_file }} ${{ env.paddle_whl }} paddle-github-action/PR/cpu_whl/${{ env.PR_ID }}/${{ env.COMMIT_ID }}
'
- name: Terminate and delete the container
if: always()
run: |
set +e
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
docker stop ${{ env.container_name }}
docker rm ${{ env.container_name }}