forked from databand-ai/dbnd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
282 lines (252 loc) · 6.75 KB
/
.gitlab-ci.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
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
### DBND CI CD
### GENERAL CI CONFIG
### KNOWN ISSUES:
# `needs` doesn't work for failed job, the job after will run when the "needed" job is skipped
# A (fails) -> B (skip) -> C (runs!!!)
# default image to use
image: us.gcr.io/dbnd-dev-260010/databand/dbnd-ci-default:py36-latest
stages:
- test
- build-base
- publish
- staging
- test-windows
- ci-utils
variables:
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
# Specific images according to a python version
DOCKER_IMAGE_CI_PYTEST_PY36: us.gcr.io/dbnd-dev-260010/databand/dbnd-ci.test:py36-latest
### TESTS BASIC
.template__except_defaults:
except: &except_on_skip_message
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
.template__on_every_commit:
only: &on_every_commit
- /^feature|fix/
- master
- merge_requests
- develop
- tags
.template__on_significant_branch_only:
only: &on_significant_branch
- master
- merge_requests
- develop
- tags
### TEST TEMPLATES
.template__basic_job: &template__basic_checks_job
stage: test
only: *on_every_commit
.template__test_python: &template__python_test_job
stage: test
except: *except_on_skip_message
.template__test_tensorflow: &template__test_tensorflow
<<: *template__python_test_job
image: $IMAGE
script:
- cd plugins/dbnd-tensorflow
- tox -e $TEST_NAME
artifacts:
reports:
junit: plugins/dbnd-tensorflow/build/junit-$TEST_NAME.xml
.template__test_windows: &template__windows_tests_job
stage: test-windows
only: *on_significant_branch
except: *except_on_skip_message
needs: ["empty_job"]
before_script:
- echo "start"
- whoami
tags:
- windows
# TODO: new models - sqlalchemy_utils.UUID - not wokring on windows?
when: manual
empty_job:
# workaround for gitlab not supporting empty `needs`
# we want build jobs starting to run right away
stage: test
only: *on_significant_branch
variables:
KUBERNETES_CPU_REQUEST: 10m
KUBERNETES_CPU_LIMIT: 100m
KUBERNETES_MEMORY_REQUEST: 10Mi
KUBERNETES_MEMORY_LIMIT: 100Mi
script:
- echo "Hello World"
pre_commit:
<<: *template__python_test_job
variables:
KUBERNETES_CPU_REQUEST: 1200m
KUBERNETES_CPU_LIMIT: 2000m
KUBERNETES_MEMORY_REQUEST: 230Mi
KUBERNETES_MEMORY_LIMIT: 1Gi
image: ${DOCKER_IMAGE_CI_PYTEST_PY36}
script:
# - tox -e pre-commit,docs,readme
- tox -e pre-commit,bumpversion-check
lint:
<<: *template__python_test_job
variables:
KUBERNETES_CPU_REQUEST: 1200m
KUBERNETES_CPU_LIMIT: 2000m
KUBERNETES_MEMORY_REQUEST: 1Gi
KUBERNETES_MEMORY_LIMIT: 3Gi
image: ${DOCKER_IMAGE_CI_PYTEST_PY36}
script:
- tox -e lint
manifest:
<<: *template__python_test_job
variables:
KUBERNETES_CPU_REQUEST: 250m
KUBERNETES_CPU_LIMIT: 1
KUBERNETES_MEMORY_REQUEST: 260Mi
KUBERNETES_MEMORY_LIMIT: 1Gi
image: ${DOCKER_IMAGE_CI_PYTEST_PY36}
script:
- make test-manifest
dbnd_py36:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_PY36}
script:
- cd modules/dbnd
- tox -e py36
artifacts:
reports:
junit: build/junit-py36.xml
dbnd_py36_windows:
<<: *template__windows_tests_job
script:
- xcopy /y "modules\setup.cfg" "modules\dbnd\"
- tox -c modules/dbnd/tox.ini -r -e win-py36
dbnd_examples_py36:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_PY36}
script:
- cd examples
- tox -e py36
artifacts:
reports:
junit: .tox/dbnd-examples/junit/junit-py36.xml
#dbnd_databricks_py36:
# <<: *template__python_test_job
# variables:
# KUBERNETES_CPU_REQUEST: 900m
# KUBERNETES_CPU_LIMIT: 2
# KUBERNETES_MEMORY_REQUEST: 2.5Gi
# KUBERNETES_MEMORY_LIMIT: 4Gi
# image: python:3.6
# script:
# - cd plugins/dbnd-databricks
# - tox -e py36
# artifacts:
# reports:
# junit: plugins/dbnd-databricks/build/junit-py36.xml
dbnd_airflow 0 1_10_7_py36:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_PY36}
script:
- cd modules/dbnd-airflow
- tox -e py36-airflow_1_10_7
artifacts:
reports:
junit: modules/dbnd-airflow/build/junit-py36-airflow_1_10_7.xml
only: *on_significant_branch
dbnd_airflow 0 1_10_9_py36:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_PY36}
script:
- cd modules/dbnd-airflow
- tox -e py36-airflow_1_10_9
artifacts:
reports:
junit: modules/dbnd-airflow/build/junit-py36-airflow_1_10_9.xml
only: *on_significant_branch
dbnd_airflow 0 1_10_10_py36:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_PY36}
script:
- cd modules/dbnd-airflow
- tox -e py36-airflow_1_10_10
artifacts:
reports:
junit: modules/dbnd-airflow/build/junit-py36-airflow_1_10_10.xml
only: *on_significant_branch
dbnd_airflow 0 1_10_12_py36:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_PY36}
script:
- cd modules/dbnd-airflow
- tox -e py36-airflow_1_10_12
artifacts:
reports:
junit: modules/dbnd-airflow/build/junit-py36-airflow_1_10_12.xml
only: *on_significant_branch
dbnd_airflow_monitor 0 1_10_9_py36:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_PY36}
script:
- cd modules/dbnd-airflow-monitor
- tox -e py36-airflow_1_10_9
artifacts:
reports:
junit: modules/dbnd-airflow-monitor/build/junit-py36-airflow_1_10_9.xml
when: manual
dbnd_airflow_monitor 0 1_10_10_py36:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_PY36}
script:
- cd modules/dbnd-airflow-monitor
- tox -e py36-airflow_1_10_10
artifacts:
reports:
junit: modules/dbnd-airflow-monitor/build/junit-py36-airflow_1_10_10.xml
only: *on_significant_branch
when: manual
dbnd_airflow_monitor 0 1_10_11_py36:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_PY36}
script:
- cd modules/dbnd-airflow-monitor
- tox -e py36-airflow_1_10_11
artifacts:
reports:
junit: modules/dbnd-airflow-monitor/build/junit-py36-airflow_1_10_11.xml
only: *on_significant_branch
when: manual
dbnd_tensorflow 2 py36:
<<: *template__test_tensorflow
variables:
IMAGE: ${DOCKER_IMAGE_CI_PYTEST_PY36}
TEST_NAME: py36-tensorflow26
build_pypi_org_whl:
stage: build-base
needs: ["empty_job"]
script:
- python setup.py sdist bdist_wheel
- make dist-python
artifacts:
paths:
- dist-python/*
only:
- tags
when: manual
#downstream:
# stage: staging
# trigger:
# project: databand/databand
# branch: develop
# only: *on_significant_branch
publish_pypi_org_dbnd_package:
stage: publish
variables:
GIT_STRATEGY: none
needs:
- build_pypi_org_whl
script:
- twine upload dist-python/*
only:
- tags
when: manual