forked from autogluon/autogluon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
189 lines (161 loc) · 6.01 KB
/
Jenkinsfile
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
max_time = 180
stage("Unit Test") {
node('linux-gpu') {
ws('workspace/autugluon-py3') {
timeout(time: max_time, unit: 'MINUTES') {
checkout scm
VISIBLE_GPU=env.EXECUTOR_NUMBER.toInteger() % 8
sh """#!/bin/bash
set -ex
conda env update -n autogluon_py3 -f docs/build.yml
conda activate autogluon_py3
conda list
export CUDA_VISIBLE_DEVICES=${VISIBLE_GPU}
env
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64
export MPLBACKEND=Agg
export MXNET_CUDNN_AUTOTUNE_DEFAULT=0
pip uninstall -y autogluon
pip uninstall -y autogluon.vision
pip uninstall -y autogluon.text
pip uninstall -y autogluon.mxnet
pip uninstall -y autogluon.extra
pip uninstall -y autogluon.tabular
pip uninstall -y autogluon.core
pip uninstall -y autogluon-contrib-nlp
cd core/
python3 -m pip install --upgrade -e .
python3 -m pytest --junitxml=results.xml --runslow tests
cd ..
cd tabular/
python3 -m pip install --upgrade -e .
python3 -m pytest --junitxml=results.xml --runslow tests
pip uninstall -y autogluon.tabular
cd ..
cd mxnet/
python3 -m pip install --upgrade -e .
python3 -m pytest --junitxml=results.xml --runslow tests
cd ..
cd extra/
python3 -m pip install --upgrade -e .
python3 -m pytest --junitxml=results.xml --runslow tests
cd ..
cd text/
python3 -m pip install --upgrade -e .
python3 -m pytest --junitxml=results.xml --runslow tests
pip uninstall -y autogluon.text
cd ..
cd vision/
python3 -m pip install --upgrade -e .
python3 -m pytest --junitxml=results.xml --runslow tests
cd ..
cd tabular/
python3 -m pip install --upgrade -e .
cd ../text/
python3 -m pip install --upgrade -e .
cd ../
cd autogluon/
python3 -m pip install --upgrade -e .
cd ..
"""
}
}
}
}
stage("Build Docs") {
node('linux-gpu') {
ws('workspace/autogluon-docs') {
timeout(time: max_time, unit: 'MINUTES') {
checkout scm
VISIBLE_GPU=env.EXECUTOR_NUMBER.toInteger() % 8
index_update_str = ''
if (env.BRANCH_NAME.startsWith("PR-")) {
bucket = 'autogluon-staging'
path = "${env.BRANCH_NAME}/${env.BUILD_NUMBER}"
site = "${bucket}.s3-website-us-west-2.amazonaws.com/${path}"
flags = '--delete'
cacheControl = ''
} else {
isMaster = env.BRANCH_NAME == 'master'
isDev = env.BRANCH_NAME == 'dev'
bucket = 'autogluon.mxnet.io'
path = isMaster ? 'dev' : isDev ? 'dev-branch' : "${env.BRANCH_NAME}"
site = "${bucket}/${path}"
flags = isMaster ? '' : '--delete'
cacheControl = '--cache-control max-age=7200'
if (isMaster) {
index_update_str = """
aws s3 cp root_index.html s3://${bucket}/index.html --acl public-read ${cacheControl}
echo "Uploaded root_index.html s3://${bucket}/index.html"
"""
}
}
other_doc_version_text = 'Stable Version Documentation'
other_doc_version_branch = 'stable'
if (env.BRANCH_NAME == 'stable') {
other_doc_version_text = 'Dev Version Documentation'
other_doc_version_branch = 'dev'
}
escaped_context_root = site.replaceAll('\\/', '\\\\/')
sh """#!/bin/bash
set -ex
conda env update -n autogluon_docs -f docs/build_contrib.yml
conda activate autogluon_docs
conda list
export CUDA_VISIBLE_DEVICES=${VISIBLE_GPU}
env
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64
export AG_DOCS=1
git clean -fx
python3 -m pip install git+https://github.com/zhanghang1989/d2l-book
python3 -m pip install --force-reinstall ipython==7.16
pip uninstall -y autogluon
pip uninstall -y autogluon.vision
pip uninstall -y autogluon.text
pip uninstall -y autogluon.mxnet
pip uninstall -y autogluon.extra
pip uninstall -y autogluon.tabular
pip uninstall -y autogluon.core
pip uninstall -y autogluon-contrib-nlp
pip uninstall -y autogluon-core
pip uninstall -y autogluon-extra
pip uninstall -y autogluon-mxnet
pip uninstall -y autogluon-tabular
pip uninstall -y autogluon-text
pip uninstall -y autogluon-vision
cd core/
python3 -m pip install --upgrade -e .
cd ..
cd tabular/
python3 -m pip install --upgrade -e .
cd ..
cd mxnet/
python3 -m pip install --upgrade -e .
cd ..
cd extra/
python3 -m pip install --upgrade -e .
cd ..
cd text/
python3 -m pip install --upgrade -e .
cd ..
cd vision/
python3 -m pip install --upgrade -e .
cd ..
cd autogluon/
python3 -m pip install --upgrade -e .
cd ..
sed -i -e 's/###_PLACEHOLDER_WEB_CONTENT_ROOT_###/http:\\/\\/${escaped_context_root}/g' docs/config.ini
sed -i -e 's/###_OTHER_VERSIONS_DOCUMENTATION_LABEL_###/${other_doc_version_text}/g' docs/config.ini
sed -i -e 's/###_OTHER_VERSIONS_DOCUMENTATION_BRANCH_###/${other_doc_version_branch}/g' docs/config.ini
cd docs && bash build_doc.sh
aws s3 sync ${flags} _build/html/ s3://${bucket}/${path} --acl public-read ${cacheControl}
echo "Uploaded doc to http://${site}/index.html"
${index_update_str}
"""
if (env.BRANCH_NAME.startsWith("PR-")) {
pullRequest.comment("Job ${env.BRANCH_NAME}-${env.BUILD_NUMBER} is done. \nDocs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/index.html")
}
}
}
}
}