forked from DataBiosphere/toil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
203 lines (183 loc) · 8.71 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
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.
before_script:
- startdocker || true
- docker info
- cat /etc/hosts
- export PYTHONIOENCODING=utf-8
- mkdir -p ~/.kube && cp "$GITLAB_SECRET_FILE_KUBE_CONFIG" ~/.kube/config
- mkdir -p ~/.aws && cp "$GITLAB_SECRET_FILE_AWS_CREDENTIALS" ~/.aws/credentials
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:
- basic_tests
- main_tests
- integration
# Python3.6
py36_main:
stage: basic_tests
script:
- pwd
- virtualenv -p python3.6 venv && . venv/bin/activate && make prepare && make develop extras=[all] && pip install htcondor
- make test tests=src/toil/test/src
- make test tests=src/toil/test/utils
py36_appliance_build:
stage: basic_tests
script:
- pwd
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata jq
- virtualenv -p python3.6 venv && . venv/bin/activate && make prepare && pip install pycparser && make develop extras=[all] && pip install htcondor awscli==1.16.272
# 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
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata jq python3.7 python3.7-dev
- virtualenv -p python3.7 venv && . venv/bin/activate && make prepare && make develop extras=[all] && pip install htcondor awscli==1.16.272
- 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
script:
- pwd
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata jq python3.7 python3.7-dev
- virtualenv -p python3.7 venv && . venv/bin/activate && 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
- make test tests=src/toil/test/cwl/cwlTest.py::CWLv10Test
py37_cwl_v1.1:
stage: main_tests
script:
- pwd
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata jq python3.7 python3.7-dev
- virtualenv -p python3.7 venv && . venv/bin/activate && make prepare && make develop extras=[cwl,aws]
- make test tests=src/toil/test/cwl/cwlTest.py::CWLv11Test
py37_cwl_v1.2:
stage: main_tests
script:
- pwd
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata jq python3.7 python3.7-dev
- virtualenv -p python3.7 venv && . venv/bin/activate && make prepare && make develop extras=[cwl,aws]
- make test tests=src/toil/test/cwl/cwlTest.py::CWLv12Test
py37_wdl:
stage: main_tests
script:
- pwd
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata jq python3.7 python3.7-dev
- virtualenv -p python3.7 venv && . venv/bin/activate && make prepare && make develop extras=[all]
- make test tests=src/toil/test/wdl/toilwdlTest.py
- make test tests=src/toil/test/wdl/builtinTest.py
py37_jobstore_and_provisioning:
stage: main_tests
script:
- pwd
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata jq python3.7 python3.7-dev
- virtualenv -p python3.7 venv && . venv/bin/activate && make prepare && make develop extras=[all] && pip install 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
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata jq python3.7 python3.7-dev
- virtualenv -p python3.7 venv && . venv/bin/activate && make prepare && make develop extras=[all] && pip install htcondor
- make test tests=src/toil/test/src
- make test tests=src/toil/test/utils
py37_appliance_build:
stage: basic_tests
script:
- pwd
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata jq python3.7 python3.7-dev
- virtualenv -p python3.7 venv && . venv/bin/activate && make prepare && pip install pycparser && make develop extras=[all] && pip install htcondor awscli==1.16.272
# This reads GITLAB_SECRET_FILE_QUAY_CREDENTIALS
- python setup_gitlab_docker.py
- make push_docker
py37_integration:
stage: integration
script:
- pwd
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata jq python3.7 python3.7-dev
- virtualenv -p python3.7 venv && . venv/bin/activate && make prepare && make develop extras=[all] && pip install htcondor awscli==1.16.272
- 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
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata awscli jq python3.7 python3.7-dev
- virtualenv -p python3.7 venv && . venv/bin/activate && make prepare && make develop extras=[all] && pip install htcondor awscli==1.16.272
- 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 push_docker
- make test tests=src/toil/test/sort/sortTest.py
- make test tests=src/toil/test/provisioners/clusterScalerTest.py
# - python -m pytest --duration=0 -s -r s src/toil/test/provisioners/aws/awsProvisionerTest.py::AWSRestartTest::testAutoScaledCluster
# - python -m pytest -s src/toil/test/provisioners/aws/awsProvisionerTest.py
# - python -m pytest -s src/toil/test/provisioners/gceProvisionerTest.py # needs env vars set to run
# Python3.8
py38_main:
stage: basic_tests
script:
- pwd
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata jq python3.8 python3.8-dev
- virtualenv -p python3.8 venv && . venv/bin/activate && make prepare && make develop extras=[all] && pip install htcondor
- make test tests=src/toil/test/src
- make test tests=src/toil/test/utils
py38_appliance_build:
stage: basic_tests
script:
- pwd
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata jq python3.8 python3.8-dev
- virtualenv -p python3.8 venv && . venv/bin/activate && make prepare && pip install pycparser && make develop extras=[all] && pip install htcondor awscli==1.16.272
# 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
- apt update && DEBIAN_FRONTEND=noninteractive apt install -y tzdata awscli jq python3.7 python3.7-dev
- virtualenv --system-site-packages --python python3.7 venv
- . venv/bin/activate
- 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 12de39de78e784bff1cff5bc022c16e95ded692b
- git submodule update --init --recursive
- pip install --upgrade setuptools pip
- pip install --upgrade .
- toil clean aws:us-west-2:${BUCKET_NAME}
- time cactus --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