-
Notifications
You must be signed in to change notification settings - Fork 134
309 lines (309 loc) · 13.9 KB
/
compose.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
300
301
302
303
304
305
306
307
308
309
name: build-and-test
on: [push]
jobs:
build_container_base:
if: false # Temporarily disable workflow
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set image tag
id: image_tag
run: |
if [ "${GITHUB_REF#refs/heads/}" = "master" ]; then
echo "image_tag=latest" >> $GITHUB_OUTPUT;
else
echo "image_tag=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT;
fi
- name: Docker Login
run: echo "${{ secrets.docker_registry_password }}" | docker login -u ${{ secrets.docker_registry_username }} --password-stdin ${{ secrets.docker_registry }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.17.1
- name: Run Buildx
env:
image_name: galaxy-container-base
run: |
for i in {1..4}; do
set +e
docker buildx build \
--output "type=image,name=${{ secrets.docker_registry }}/${{ secrets.docker_registry_username }}/$image_name:${{ steps.image_tag.outputs.image_tag }},push=true" \
--build-arg IMAGE_TAG=${{ steps.image_tag.outputs.image_tag }} \
--build-arg DOCKER_REGISTRY=${{ secrets.docker_registry }} \
--build-arg DOCKER_REGISTRY_USERNAME=${{ secrets.docker_registry_username }} \
$image_name && break || echo "Fail.. Retrying"
done;
shell: bash
working-directory: ./compose/base-images
build_cluster_base:
needs: build_container_base
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set image tag
id: image_tag
run: |
if [ "${GITHUB_REF#refs/heads/}" = "master" ]; then
echo "image_tag=latest" >> $GITHUB_OUTPUT;
else
echo "image_tag=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT;
fi
- name: Docker Login
run: echo "${{ secrets.docker_registry_password }}" | docker login -u ${{ secrets.docker_registry_username }} --password-stdin ${{ secrets.docker_registry }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.17.1
- name: Run Buildx
env:
image_name: galaxy-cluster-base
run: |
for i in {1..4}; do
set +e
docker buildx build \
--output "type=image,name=${{ secrets.docker_registry }}/${{ secrets.docker_registry_username }}/$image_name:${{ steps.image_tag.outputs.image_tag }},push=true" \
--build-arg IMAGE_TAG=${{ steps.image_tag.outputs.image_tag }} \
--build-arg DOCKER_REGISTRY=${{ secrets.docker_registry }} \
--build-arg DOCKER_REGISTRY_USERNAME=${{ secrets.docker_registry_username }} \
$image_name && break || echo "Fail.. Retrying"
done;
shell: bash
working-directory: ./compose/base-images
build:
needs: build_cluster_base
runs-on: ubuntu-latest
strategy:
matrix:
image:
- name: galaxy-server
- name: galaxy-nginx
- name: galaxy-htcondor
- name: galaxy-slurm
- name: galaxy-slurm-node-discovery
- name: galaxy-kind
- name: pulsar
- name: galaxy-configurator
- name: galaxy-bioblend-test
subdir: tests/
- name: galaxy-workflow-test
subdir: tests/
- name: galaxy-selenium-test
subdir: tests/
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set image tag
id: image_tag
run: |
if [ "${GITHUB_REF#refs/heads/}" = "master" ]; then
echo "image_tag=latest" >> $GITHUB_OUTPUT;
else
echo "image_tag=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT;
fi
- name: Docker Login
run: echo "${{ secrets.docker_registry_password }}" | docker login -u ${{ secrets.docker_registry_username }} --password-stdin ${{ secrets.docker_registry }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.17.1
- name: Run Buildx
run: |
for i in {1..4}; do
set +e
docker buildx build \
--output "type=image,name=${{ secrets.docker_registry }}/${{ secrets.docker_registry_username }}/${{ matrix.image.name }}:${{ steps.image_tag.outputs.image_tag }},push=true" \
--build-arg IMAGE_TAG=${{ steps.image_tag.outputs.image_tag }} \
--build-arg DOCKER_REGISTRY=${{ secrets.docker_registry }} \
--build-arg DOCKER_REGISTRY_USERNAME=${{ secrets.docker_registry_username }} \
--build-arg GALAXY_REPO=https://github.com/galaxyproject/galaxy \
${{ matrix.image.subdir }}${{ matrix.image.name }} && break || echo "Fail.. Retrying"
done;
shell: bash
working-directory: ./compose
test:
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
infrastructure:
- name: galaxy-base
files: -f docker-compose.yml
- name: galaxy-proxy-prefix
files: -f docker-compose.yml
env: GALAXY_PROXY_PREFIX=/arbitrary_Galaxy-prefix GALAXY_CONFIG_GALAXY_INFRASTRUCTURE_URL=http://localhost/arbitrary_Galaxy-prefix EXTRA_SKIP_TESTS_BIOBLEND="not test_import_export_workflow_dict and not test_import_export_workflow_from_local_path"
exclude_test:
- selenium
- name: galaxy-htcondor
files: -f docker-compose.yml -f docker-compose.htcondor.yml
- name: galaxy-slurm
files: -f docker-compose.yml -f docker-compose.slurm.yml
env: SLURM_NODE_COUNT=3
options: --scale slurm_node=3
- name: galaxy-pulsar
files: -f docker-compose.yml -f docker-compose.pulsar.yml
exclude_test:
- workflow_quality_control
env: EXTRA_SKIP_TESTS_BIOBLEND="not test_wait_for_job"
- name: galaxy-pulsar-mq
files: -f docker-compose.yml -f docker-compose.pulsar.yml -f docker-compose.pulsar.mq.yml
exclude_test:
- workflow_quality_control
env: EXTRA_SKIP_TESTS_BIOBLEND="not test_wait_for_job"
- name: galaxy-k8s
files: -f docker-compose.yml -f docker-compose.k8s.yml
- name: galaxy-singularity
files: -f docker-compose.yml -f docker-compose.singularity.yml
env: EXTRA_SKIP_TESTS_BIOBLEND="not test_get_container_resolvers and not test_show_container_resolver"
- name: galaxy-pulsar-mq-singularity
files: -f docker-compose.yml -f docker-compose.pulsar.yml -f docker-compose.pulsar.mq.yml -f docker-compose.singularity.yml
env: EXTRA_SKIP_TESTS_BIOBLEND="not test_wait_for_job and not test_get_container_resolvers and not test_show_container_resolver"
exclude_test:
- workflow_quality_control
- name: galaxy-slurm-singularity
files: -f docker-compose.yml -f docker-compose.slurm.yml -f docker-compose.singularity.yml
env: EXTRA_SKIP_TESTS_BIOBLEND="not test_get_container_resolvers and not test_show_container_resolver"
- name: galaxy-htcondor-singularity
files: -f docker-compose.yml -f docker-compose.htcondor.yml -f docker-compose.singularity.yml
env: EXTRA_SKIP_TESTS_BIOBLEND="not test_get_container_resolvers and not test_show_container_resolver"
test:
- name: bioblend
files: -f tests/docker-compose.test.yml -f tests/docker-compose.test.bioblend.yml
exit-from: galaxy-bioblend-test
timeout: 60
second_run: "true"
- name: workflow_ard
files: -f tests/docker-compose.test.yml -f tests/docker-compose.test.workflows.yml
exit-from: galaxy-workflow-test
workflow: sklearn/ard/ard.ga
timeout: 60
second_run: "true"
- name: workflow_quality_control
files: -f tests/docker-compose.test.yml -f tests/docker-compose.test.workflows.yml
exit-from: galaxy-workflow-test
workflow: training/sequence-analysis/quality-control/quality_control.ga
timeout: 60
- name: workflow_example1
files: -f tests/docker-compose.test.yml -f tests/docker-compose.test.workflows.yml
exit-from: galaxy-workflow-test
workflow: example1/wf3-shed-tools.ga
timeout: 60
- name: selenium
files: -f tests/docker-compose.test.yml -f tests/docker-compose.test.selenium.yml
exit-from: galaxy-selenium-test
timeout: 60
fail-fast: false
steps:
# Self-made `exclude` as Github Actions currently does not support
# exclude/including of dicts in matrices
- name: Check if test should be run
id: run_check
if: contains(matrix.infrastructure.exclude_test, matrix.test.name) != true
run: echo "run=true" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
- name: Set image tag in env
run: echo "IMAGE_TAG=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Master branch - Set image to to 'latest'
if: github.ref == 'refs/heads/master'
run: echo "IMAGE_TAG=latest" >> $GITHUB_ENV
- name: Set WORKFLOWS env for worfklows-test
if: matrix.test.workflow
run: echo "WORKFLOWS=${{ matrix.test.workflow }}" >> $GITHUB_ENV
- name: Install Docker Compose
run: |
sudo apt-get update -qq && sudo apt-get install docker-compose -y
- name: Run tests for the first time
if: steps.run_check.outputs.run
run: |
export DOCKER_REGISTRY=${{ secrets.docker_registry }}
export DOCKER_REGISTRY_USERNAME=${{ secrets.docker_registry_username }}
export ${{ matrix.infrastructure.env }}
export TIMEOUT=${{ matrix.test.timeout }}
docker-compose ${{ matrix.infrastructure.files }} ${{ matrix.test.files }} config
env
for i in {1..4}; do
echo "Running test - try \#$i"
echo "Removing export directory if existent";
sudo rm -rf export
docker-compose ${{ matrix.infrastructure.files }} ${{ matrix.test.files }} pull
set +e
docker-compose ${{ matrix.infrastructure.files }} ${{ matrix.test.files }} up ${{ matrix.infrastructure.options }} --exit-code-from ${{ matrix.test.exit-from }}
test_exit_code=$?
error_exit_codes_count=$(expr $(docker ps -a --filter exited=1 | wc -l) - 1)
docker-compose ${{ matrix.infrastructure.files }} ${{ matrix.test.files }} down
if [ $error_exit_codes_count != 0 ] || [ $test_exit_code != 0 ] ; then
echo "Test failed..";
continue;
else
exit $test_exit_code;
fi
done;
exit 1
shell: bash
working-directory: ./compose
continue-on-error: false
- name: Fix file names before saving artifacts
if: failure()
run: |
sudo find ./compose/export/galaxy/database -depth -name '*:*' -execdir bash -c 'mv "$1" "${1//:/-}"' bash {} \;
- name: Allow upload-artifact read access
if: failure()
run: sudo chmod -R +r ./compose/export/galaxy/database
- name: Save artifacts for debugging a failed test
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.infrastructure.name }}_${{ matrix.test.name }}_first-run
path: ./compose/export/galaxy/database
- name: Clean up after first run
if: matrix.test.second_run == 'true'
run: |
sudo rm -rf export/postgres
sudo rm -rf export/galaxy/database
working-directory: ./compose
- name: Run tests a second time
if: matrix.test.second_run == 'true' && steps.run_check.outputs.run
run: |
export DOCKER_REGISTRY=${{ secrets.docker_registry }}
export DOCKER_REGISTRY_USERNAME=${{ secrets.docker_registry_username }}
export ${{ matrix.infrastructure.env }}
export TIMEOUT=${{ matrix.test.timeout }}
for i in {1..4}; do
echo "Running test - try \#$i"
echo "Removing export directory if existent";
sudo rm -rf export
set +e
docker-compose ${{ matrix.infrastructure.files }} ${{ matrix.test.files }} up ${{ matrix.infrastructure.options }} --exit-code-from ${{ matrix.test.exit-from }}
test_exit_code=$?
error_exit_codes_count=$(expr $(docker ps -a --filter exited=1 | wc -l) - 1)
docker-compose ${{ matrix.infrastructure.files }} ${{ matrix.test.files }} down
if [ $error_exit_codes_count != 0 ] || [ $test_exit_code != 0 ] ; then
echo "Test failed..";
continue;
else
exit $test_exit_code;
fi
done;
exit 1
shell: bash
working-directory: ./compose
continue-on-error: false
- name: Fix file names before saving artifacts
if: failure() && matrix.test.second_run == 'true'
run: |
sudo find ./compose/export/galaxy/database -depth -name '*:*' -execdir bash -c 'mv "$1" "${1//:/-}"' bash {} \;
- name: Allow upload-artifact read access
if: failure() && matrix.test.second_run == 'true'
run: sudo chmod -R +r ./compose/export/galaxy/database
- name: Save artifacts for debugging a failed test
uses: actions/upload-artifact@v4
if: failure() && matrix.test.second_run == 'true'
with:
name: ${{ matrix.infrastructure.name }}_${{ matrix.test.name }}_second-run
path: ./compose/export/galaxy/database