forked from DataBiosphere/toil
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
299 lines (269 loc) · 12.6 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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
image: quay.io/vgteam/vg_ci_prebake:latest
# Note that we must run in a privileged container for our internal Docker daemon to come up.
variables:
PYTHONIOENCODING: "utf-8"
DEBIAN_FRONTEND: "noninteractive"
TOIL_OWNER_TAG: "shared"
before_script:
# Configure Docker to use a mirror for Docker Hub and restart the daemon
# Set the registry as insecure because it is probably cluster-internal over plain HTTP.
- |
if [[ ! -z "${DOCKER_HUB_MIRROR}" ]] ; then
echo "{\"registry-mirrors\": [\"${DOCKER_HUB_MIRROR}\"], \"insecure-registries\": [\"${DOCKER_HUB_MIRROR##*://}\"]}" | sudo tee /etc/docker/daemon.json
export SINGULARITY_DOCKER_HUB_MIRROR="${DOCKER_HUB_MIRROR}"
fi
- startdocker || true
- docker info
- cat /etc/hosts
- mkdir -p ~/.kube && cp "$GITLAB_SECRET_FILE_KUBE_CONFIG" ~/.kube/config
- mkdir -p ~/.aws && cp "$GITLAB_SECRET_FILE_AWS_CREDENTIALS" ~/.aws/credentials
- sudo apt-get update
- sudo apt-get install -y software-properties-common build-essential virtualenv
- sudo add-apt-repository -y ppa:deadsnakes/ppa
- sudo apt-get update
- sudo apt-get install -y tzdata jq python3.6 python3.6-dev python3.7 python3.7-dev python3.8 python3.8-dev
after_script:
# We need to clean up any files that Toil may have made via Docker that
# aren't deletable by the Gitlab user. If we don't do this, Gitlab will try
# and clean them up before running the next job on the runner, fail, and fail
# that next job.
- pwd
- sudo rm -rf tmp
- stopdocker || true
stages:
- linting_and_dependencies
- basic_tests
- main_tests
- integration
lint:
stage: linting_and_dependencies
script:
- pwd
- virtualenv -p python3.6 venv && . venv/bin/activate && make prepare && make develop extras=[all] packages=htcondor
- make mypy
- make docs
cwl_dependency_is_stand_alone:
stage: linting_and_dependencies
script:
- pwd
- virtualenv -p python3.6 venv && . venv/bin/activate && make prepare && make develop extras=[cwl]
- make test tests=src/toil/test/docs/scriptsTest.py::ToilDocumentationTest::testCwlexample
wdl_dependency_is_stand_alone:
stage: linting_and_dependencies
script:
- pwd
- virtualenv -p python3.6 venv && . venv/bin/activate && make prepare && make develop extras=[wdl]
- make test tests=src/toil/test/wdl/toilwdlTest.py::ToilWdlIntegrationTest::testMD5sum
# Python3.6
py36_main:
stage: basic_tests
script:
- pwd
- virtualenv -p python3.6 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[all] packages=htcondor
- make test tests=src/toil/test/src
- make test tests=src/toil/test/utils
py36_appliance_build:
stage: basic_tests
script:
- pwd
- virtualenv -p python3.6 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && pip install pycparser && make develop extras=[all] packages='htcondor awscli'
# This reads GITLAB_SECRET_FILE_QUAY_CREDENTIALS
- python setup_gitlab_docker.py
- make push_docker
# Python3.7
py37_batch_systems:
stage: main_tests
script:
- pwd
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[all] packages='htcondor awscli'
- make test tests=src/toil/test/batchSystems/batchSystemTest.py
- make test tests=src/toil/test/mesos/MesosDataStructuresTest.py
py37_cwl_v1.0:
stage: main_tests
only: []
script:
- pwd
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[cwl,aws]
- mypy --ignore-missing-imports --no-strict-optional $(pwd)/src/toil/cwl/cwltoil.py # make this a separate linting stage
- python setup_gitlab_docker.py # login to increase the docker.io rate limit
- make test tests=src/toil/test/cwl/cwlTest.py::CWLv10Test
py37_cwl_v1.1:
stage: main_tests
only: []
script:
- pwd
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[cwl,aws]
- python setup_gitlab_docker.py # login to increase the docker.io rate limit
- make test tests=src/toil/test/cwl/cwlTest.py::CWLv11Test
py37_cwl_v1.2:
stage: main_tests
script:
- pwd
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[cwl,aws]
- python setup_gitlab_docker.py # login to increase the docker.io rate limit
- make test tests=src/toil/test/cwl/cwlTest.py::CWLv12Test
py37_cwl_v1.0_kubernetes:
stage: main_tests
only: []
script:
- pwd
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[cwl,aws,kubernetes]
- export TOIL_KUBERNETES_OWNER=toiltest
- export TOIL_AWS_SECRET_NAME=shared-s3-credentials
- export TOIL_KUBERNETES_HOST_PATH=/data/scratch
- export TOIL_WORKDIR=/var/lib/toil
- export SINGULARITY_CACHEDIR=/var/lib/toil/singularity-cache
- echo Singularity mirror is ${SINGULARITY_DOCKER_HUB_MIRROR}
- mkdir -p ${TOIL_WORKDIR}
- make test tests=src/toil/test/cwl/cwlTest.py::CWLv10Test::test_kubernetes_cwl_conformance
- make test tests=src/toil/test/cwl/cwlTest.py::CWLv10Test::test_kubernetes_cwl_conformance_with_caching
py37_cwl_v1.1_kubernetes:
stage: main_tests
only: []
script:
- pwd
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[cwl,aws,kubernetes]
- export TOIL_KUBERNETES_OWNER=toiltest
- export TOIL_AWS_SECRET_NAME=shared-s3-credentials
- export TOIL_KUBERNETES_HOST_PATH=/data/scratch
- export TOIL_WORKDIR=/var/lib/toil
- export SINGULARITY_CACHEDIR=/var/lib/toil/singularity-cache
- mkdir -p ${TOIL_WORKDIR}
- make test tests=src/toil/test/cwl/cwlTest.py::CWLv11Test::test_kubernetes_cwl_conformance
- make test tests=src/toil/test/cwl/cwlTest.py::CWLv11Test::test_kubernetes_cwl_conformance_with_caching
py37_cwl_v1.2_kubernetes:
stage: main_tests
script:
- pwd
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[cwl,aws,kubernetes]
- export TOIL_KUBERNETES_OWNER=toiltest
- export TOIL_AWS_SECRET_NAME=shared-s3-credentials
- export TOIL_KUBERNETES_HOST_PATH=/data/scratch
- export TOIL_WORKDIR=/var/lib/toil
- export SINGULARITY_CACHEDIR=/var/lib/toil/singularity-cache
- mkdir -p ${TOIL_WORKDIR}
- make test tests=src/toil/test/cwl/cwlTest.py::CWLv12Test
py37_wdl:
stage: main_tests
script:
- pwd
- apt update && apt install -y default-jre
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[all]
- which java &> /dev/null || { echo >&2 "Java is not installed. Install java to run these tests."; exit 1; }
- make test tests=src/toil/test/wdl/toilwdlTest.py # needs java (default-jre) to run "GATK.jar"
- make test tests=src/toil/test/wdl/builtinTest.py
py37_jobstore_and_provisioning:
stage: main_tests
script:
- pwd
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[all] packages=htcondor
- make test tests=src/toil/test/jobStores/jobStoreTest.py
- make test tests=src/toil/test/sort/sortTest.py
- make test tests=src/toil/test/provisioners/aws/awsProvisionerTest.py
- make test tests=src/toil/test/provisioners/clusterScalerTest.py
# - python -m pytest --duration=0 -s -r s src/toil/test/provisioners/gceProvisionerTest.py
# https://ucsc-ci.com/databiosphere/toil/-/jobs/38672
# guessing decorators are masking class as function? ^ also, abstract class is run as normal test? should hide.
py37_main:
stage: basic_tests
script:
- pwd
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[all] packages=htcondor
- make test tests=src/toil/test/src
- make test tests=src/toil/test/utils
# - make test tests=src/toil/test/docs/scriptsTest.py::ToilDocumentationTest::testDocker
py37_appliance_build:
stage: basic_tests
script:
- pwd
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && pip install pycparser && make develop extras=[all] packages='htcondor awscli'
# This reads GITLAB_SECRET_FILE_QUAY_CREDENTIALS
- python setup_gitlab_docker.py
- make push_docker
py37_integration:
stage: integration
script:
- pwd
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[all] packages='htcondor awscli'
- export TOIL_TEST_INTEGRATIVE=True
- export TOIL_AWS_KEYNAME=id_rsa
- export TOIL_AWS_ZONE=us-west-2a
# This reads GITLAB_SECRET_FILE_SSH_KEYS
- python setup_gitlab_ssh.py
- chmod 400 /root/.ssh/id_rsa
- make test tests=src/toil/test/jobStores/jobStoreTest.py
py37_provisioner_integration:
stage: integration
script:
- pwd
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[all] packages='htcondor awscli'
- python setup_gitlab_ssh.py && chmod 400 /root/.ssh/id_rsa
- echo $'Host *\n AddressFamily inet' > /root/.ssh/config
- export LIBPROCESS_IP=127.0.0.1
- python setup_gitlab_docker.py
- export TOIL_TEST_INTEGRATIVE=True; export TOIL_AWS_KEYNAME=id_rsa; export TOIL_AWS_ZONE=us-west-2a
# This reads GITLAB_SECRET_FILE_SSH_KEYS
- python setup_gitlab_ssh.py
- make test tests=src/toil/test/sort/sortTest.py
- make test tests=src/toil/test/provisioners/clusterScalerTest.py
- make test tests=src/toil/test/utils/utilsTest.py::UtilsTest::testAWSProvisionerUtils
- make test tests=src/toil/test/provisioners/aws/awsProvisionerTest.py
# - python -m pytest -s src/toil/test/provisioners/gceProvisionerTest.py # needs env vars set to run
py37_google_jobstore:
stage: integration
script:
- pwd
- virtualenv -p python3.7 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[all] packages='htcondor awscli'
- python setup_gitlab_ssh.py && chmod 400 /root/.ssh/id_rsa
- echo $'Host *\n AddressFamily inet' > /root/.ssh/config
- export LIBPROCESS_IP=127.0.0.1
- export TOIL_TEST_INTEGRATIVE=True
- export GOOGLE_APPLICATION_CREDENTIALS=$GOOGLE_CREDENTIALS
- export TOIL_GOOGLE_KEYNAME=id_rsa
- export TOIL_GOOGLE_PROJECTID=toil-dev
- make test tests=src/toil/test/jobStores/jobStoreTest.py::GoogleJobStoreTest
# Python3.8
py38_main:
stage: basic_tests
script:
- pwd
- virtualenv -p python3.8 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && make develop extras=[all] packages='htcondor awscli'
- make test tests=src/toil/test/src
- make test tests=src/toil/test/utils
- make test tests=src/toil/test/lib/test_ec2.py
- make test tests=src/toil/test/lib/test_conversions.py
py38_appliance_build:
stage: basic_tests
script:
- pwd
- virtualenv -p python3.8 venv && . venv/bin/activate && pip install -U pip wheel && make prepare && pip install pycparser && make develop extras=[all] packages='htcondor awscli'
# This reads GITLAB_SECRET_FILE_QUAY_CREDENTIALS
- python setup_gitlab_docker.py
- make push_docker
# Cactus-on-Kubernetes integration (as a script and not a pytest test)
py37_cactus_integration:
stage: integration
script:
- set -e
- virtualenv --system-site-packages --python python3.7 venv
- . venv/bin/activate
- pip install -U pip wheel
- pip install .[aws,kubernetes]
- export TOIL_KUBERNETES_OWNER=toiltest
- export TOIL_AWS_SECRET_NAME=shared-s3-credentials
- export TOIL_KUBERNETES_HOST_PATH=/data/scratch
- export TOIL_WORKDIR=/var/lib/toil
- export SINGULARITY_CACHEDIR=/var/lib/toil/singularity-cache
- mkdir -p ${TOIL_WORKDIR}
- BUCKET_NAME=toil-test-$RANDOM-$RANDOM-$RANDOM
- cd
- git clone https://github.com/ComparativeGenomicsToolkit/cactus.git --recursive
- cd cactus
- git fetch origin
- git checkout a06d65042b7292de7f55e9396738ce69087f10af
- git submodule update --init --recursive
- pip install --upgrade setuptools pip
- pip install --upgrade .
- pip install psutil numpy --upgrade
- toil clean aws:us-west-2:${BUCKET_NAME}
- time cactus --setEnv SINGULARITY_DOCKER_HUB_MIRROR --batchSystem kubernetes --binariesMode singularity --clean always aws:us-west-2:${BUCKET_NAME} examples/evolverMammals.txt examples/evolverMammals.hal --root mr --defaultDisk "8G" --logDebug --disableCaching false