-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathdocker-compose.test.py3.yml
204 lines (185 loc) · 5.33 KB
/
docker-compose.test.py3.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
# -*- 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_py3
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_FILES_STORE=/tmp/file_urls
- APP_LAST_RUNS_PATH=/code/.scrapy/last_runs
- APP_CRAWL_ONCE_PATH=/code/.scrapy
- COVERAGE_PROCESS_START=/code/.coveragerc
tty: true
volumes:
- .:/code/
user: "${UID:-1000}:${GID:-1000}"
functional_wsp:
<<: *service_base
command: py.test -vv tests/functional/wsp
depends_on:
scrapyd:
condition: service_healthy
ftp_server:
condition: service_healthy
functional_desy:
<<: *service_base
command: py.test -vv tests/functional/desy
depends_on:
scrapyd:
condition: service_healthy
ftp_server:
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: py.test -vv tests/unit
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
networks:
default:
ftp:
depends_on:
celery:
condition: service_started
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test: "curl -k http://localhost:6800/listprojects.json"
scrapyd-deploy:
<<: *service_base
command: "true" # do nothing, as the real thing currently fails on Python 3, and not needed for unit
# command: bash -c "scrapyd-deploy"
# depends_on:
# scrapyd:
# condition: service_healthy
ftp_server:
image: stilliard/pure-ftpd:hardened
environment:
- PUBLICHOST=1.2.3.4
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
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
arxiv-http-server.local:
image: nginx:stable-alpine
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
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"
rabbitmq:
image: rabbitmq
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test: "rabbitmqctl status"
redis:
image: redis:3.2.3
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test: "redis-cli -h 127.0.0.1 ping| grep PONG"
localstack:
image: localstack/localstack:latest
ports:
- '4572:4572'
- '4566:4566'
environment:
- SERVICES=s3
- DEBUG=1
- DATA_DIR=/home/localstack/data
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test: "curl -k localhost:4566|grep running"
networks:
ftp:
ipam:
config:
- subnet: 1.0.0.0/8