-
Notifications
You must be signed in to change notification settings - Fork 30
/
docker-compose.test.py2.yml
257 lines (234 loc) · 6.84 KB
/
docker-compose.test.py2.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
# -*- coding: utf-8 -*-
#
# This file is part of hepcrawl.
# Copyright (C) 2017 CERN.
#
# hepcrawl is a free software; you can redistribute it and/or modify it
# under the terms of the Revised BSD License; see LICENSE file for
# more details.
version: '2.1'
services:
service_base: &service_base
image: hepcrawl_base
environment:
- APP_BROKER_URL=pyamqp://guest:guest@rabbitmq:5672//
- APP_CELERY_RESULT_BACKEND=redis://redis:6379/1
- APP_CRAWLER_HOST_URL=http://scrapyd:6800
- APP_API_PIPELINE_TASK_ENDPOINT_DEFAULT=hepcrawl.testlib.tasks.submit_results
- APP_LAST_RUNS_PATH=/code/.scrapy/last_runs
- APP_CRAWL_ONCE_PATH=/code/.scrapy
- COVERAGE_PROCESS_START=/code/.coveragerc
- APP_DOWNLOAD_BUCKET=downloaded
tty: true
volumes:
- .:/code/
- ./tests/functional/scrapyd_coverage_runner.conf:/etc/scrapyd/scrapyd.conf
functional_aps:
<<: *service_base
command: py.test tests/functional/aps
depends_on:
- scrapyd
- localstack
- aps-http-server.local
functional_wsp:
<<: *service_base
command: py.test -vv tests/functional/wsp
depends_on:
scrapyd:
condition: service_healthy
ftp_server:
condition: service_healthy
functional_elsevier:
<<: *service_base
command: py.test -vv tests/functional/elsevier
depends_on:
scrapyd:
condition: service_healthy
localstack:
condition: service_healthy
elsevier-http-server.local:
condition: service_healthy
functional_desy:
<<: *service_base
command: py.test -vv tests/functional/desy
depends_on:
scrapyd:
condition: service_healthy
localstack:
condition: service_healthy
functional_arxiv:
<<: *service_base
command: py.test -vv tests/functional/arxiv
depends_on:
scrapyd:
condition: service_healthy
arxiv-http-server.local:
condition: service_healthy
functional_pos:
<<: *service_base
command: py.test -vv tests/functional/pos
depends_on:
scrapyd:
condition: service_healthy
http-server.local:
condition: service_healthy
unit:
<<: *service_base
command: bash -c "py.test tests/unit -vv && make -C docs clean && make -C docs html && python setup.py sdist && ls dist/*"
links: []
celery:
<<: *service_base
command: celery worker --events --app hepcrawl.testlib.tasks --loglevel=debug
depends_on:
rabbitmq:
condition: service_healthy
redis:
condition: service_healthy
scrapyd:
<<: *service_base
command: scrapyd --pidfile=/tmp/scrapyd.pid
restart: "always"
networks:
default:
ftp:
depends_on:
celery:
condition: service_started
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test: ['CMD', "curl", "-k", "http://localhost:6800/listprojects.json"]
ports:
- "1234:1234"
scrapyd-deploy:
<<: *service_base
command: scrapyd-deploy
depends_on:
scrapyd:
condition: service_healthy
ftp_server:
image: stilliard/pure-ftpd:hardened
restart: "always"
environment:
- PUBLICHOST=1.2.3.4
- ADDED_FLAGS="--pidfile /var/run/pure-ftpd.pid"
networks:
ftp:
ipv4_address: 1.2.3.4
volumes:
- ${PWD}/tests/functional/desy/fixtures/ftp_server/FFT:/home/ftpusers/bob/FFT
- ${PWD}/tests/functional/desy/fixtures/ftp_server/DESY:/home/ftpusers/bob/DESY
- ${PWD}/tests/functional/wsp/fixtures/ftp_server/WSP:/home/ftpusers/bob/WSP
- ${PWD}/tests/functional/wsp/fixtures/ftp_server/pureftpd.passwd:/etc/pure-ftpd/passwd/pureftpd.passwd
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test: "ls -l /var/run/pure-ftpd.pid"
http-server.local:
image: nginx:stable-alpine
restart: "always"
volumes:
- ${PWD}/tests/functional/pos/fixtures/https_server/conf/proxy.conf:/etc/nginx/conf.d/default.conf
- ${PWD}/tests/functional/pos/fixtures/https_server/conf/ssl:/etc/nginx/ssl
- ${PWD}/tests/functional/pos/fixtures/https_server/records:/etc/nginx/html/
ports:
- 443:443
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test: "curl -k https://localhost:443/187.html"
functional_cds:
<<: *service_base
command: py.test -vv tests/functional/cds
depends_on:
scrapyd:
condition: service_healthy
cds-http-server.local:
condition: service_healthy
elsevier-http-server.local:
image: nginx:stable-alpine
restart: "always"
volumes:
- ${PWD}/tests/functional/elsevier/fixtures/http_server/conf/proxy.conf:/etc/nginx/conf.d/default.conf
- ${PWD}/tests/functional/elsevier/fixtures/http_server/data:/etc/nginx/html/
ports:
- 80:80
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test: "curl -k http://localhost:80/arxiv-physics-hep-th.xml"
arxiv-http-server.local:
image: nginx:stable-alpine
restart: "always"
volumes:
- ${PWD}/tests/functional/arxiv/fixtures/http_server/conf/proxy.conf:/etc/nginx/conf.d/default.conf
- ${PWD}/tests/functional/arxiv/fixtures/http_server/records:/etc/nginx/html/
ports:
- 80:80
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test: "curl -k http://localhost:80/arxiv-physics-hep-th.xml"
cds-http-server.local:
image: nginx:stable-alpine
restart: "always"
volumes:
- ${PWD}/tests/functional/cds/fixtures/http_server/conf/proxy.conf:/etc/nginx/conf.d/default.conf
- ${PWD}/tests/functional/cds/fixtures/http_server/records:/etc/nginx/html/
ports:
- 80:80
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test: "curl -k http://localhost:80/cds-single.xml"
aps-http-server.local:
image: nginx:stable-alpine
restart: "always"
volumes:
- ./tests/functional/aps/fixtures/http_server/conf/proxy.conf:/etc/nginx/conf.d/default.conf
- ./tests/functional/aps/fixtures/http_server/records:/etc/nginx/html/
ports:
- 80:80
rabbitmq:
image: rabbitmq:3.9.11-management
restart: "always"
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test: "rabbitmqctl status"
redis:
image: redis
restart: "always"
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test: "redis-cli -h 127.0.0.1 ping| grep PONG"
localstack:
image: localstack/localstack:0.11.6
restart: "always"
ports:
- '4566:4566'
environment:
- SERVICES=s3
- DEBUG=1
- DATA_DIR=/home/localstack/data
- HOSTNAME_EXTERNAL=localstack
- HOSTNAME=localstack
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test: "curl -k localstack:4566|grep running"
networks:
ftp:
ipam:
config:
- subnet: 1.0.0.0/8