Skip to content

Commit a2c97d7

Browse files
authored
Merge pull request #747 from OpenKnowledgeMaps/hierarchical-clustering
Hierarchical clustering
2 parents 95643a2 + 4bcd9ee commit a2c97d7

57 files changed

Lines changed: 3389 additions & 348 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ backend_*.sh
2929
server/workers/tests/*.csv
3030
server/workers/tests/*.txt
3131
server/workers/tests/testutils/
32+
local_dev/renv/*
3233

3334
# php files
3435
/server/classes/headstart/vendor
@@ -40,8 +41,10 @@ server/preprocessing/other-scripts/renv
4041
.Rhistory
4142
.Rprofile
4243
.Rproj*
44+
/*.Rproj
4345
.Rproj.user
4446

47+
4548
# python files
4649
*.pyc
4750
*.pkl

docker-compose-end2endtest.yml

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ services:
2424
- db
2525
- backend
2626
restart: "no"
27-
entrypoint: [ "pytest", '/app/workers/tests/test_end2end.py', '-s', '-rfA']
27+
entrypoint: ["pytest", '/app/workers/tests/test_end2end.py', '-s', '-rfA']
2828
networks:
29-
test:
30-
ipv4_address: 172.18.0.2
29+
- test
3130

3231
backend:
3332
container_name: backend
@@ -37,13 +36,47 @@ services:
3736
dockerfile: ./Dockerfile_backend
3837
volumes:
3938
- ./server/:/var/www/html/server
39+
- ./server/workers/tests/test_data/test.sqlite:/var/www/localstorage/test.sqlite
4040
restart: "no"
4141
networks:
42-
test:
43-
ipv4_address: 172.18.0.3
42+
- test
4443
ports:
4544
- "80:80"
4645

46+
api:
47+
build:
48+
context: server
49+
dockerfile: workers/api/Dockerfile
50+
restart: unless-stopped
51+
environment:
52+
SERVICE_VERSION: "test"
53+
BEHIND_PROXY: "false"
54+
DEFAULT_DATABASE: "testdb"
55+
FLASK_ENV: "development"
56+
volumes:
57+
- ./server/workers/tests/mock_app.py:/app/mock_app.py
58+
command: ["python", "mock_app.py"]
59+
networks:
60+
- test
61+
62+
persistence:
63+
container_name: api
64+
hostname: "test_api"
65+
build:
66+
context: server
67+
dockerfile: workers/persistence/Dockerfile
68+
restart: "no"
69+
environment:
70+
SERVICE_VERSION: "test"
71+
BEHIND_PROXY: "false"
72+
DEFAULT_DATABASE: "testdb"
73+
FLASK_ENV: "development"
74+
volumes:
75+
- ./server/workers/tests/mock_app.py:/app/mock_app.py
76+
command: ["python", "mock_app.py"]
77+
networks:
78+
- test
79+
4780
db:
4881
container_name: test_db
4982
image: 'postgres:12.2-alpine'
@@ -63,16 +96,10 @@ services:
6396
ports:
6497
- "5432:5432"
6598
networks:
66-
test:
67-
ipv4_address: 172.18.0.4
99+
- test
68100

69101
volumes:
70102
db_data:
71103

72104
networks:
73105
test:
74-
driver: bridge
75-
ipam:
76-
config:
77-
- subnet: 172.18.0.0/16
78-
gateway: 172.18.0.1

docker-compose.yml

Lines changed: 65 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,39 @@ services:
55
db:
66
image: 'postgres:12.2-alpine'
77
hostname: "${POSTGRES_HOSTNAME}"
8-
restart: always
8+
restart: unless-stopped
99
environment:
1010
POSTGRES_USER: "${POSTGRES_USER}"
1111
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
1212
command: postgres -c config_file=/etc/postgresql.conf -c hba_file=/etc/pg_hba.conf
1313
volumes:
1414
- db_data:/var/lib/postgresql/data
15-
- ./pg_hba.conf:/etc/pg_hba.conf
16-
- ./postgresql.conf:/etc/postgresql.conf
17-
networks:
15+
- ./local_dev/pg_hba.conf:/etc/pg_hba.conf
16+
- ./local_dev/postgresql.conf:/etc/postgresql.conf
17+
networks:
1818
- headstart
19+
1920
redis:
2021
image: 'redis:6.0-alpine'
21-
restart: always
22+
restart: unless-stopped
2223
hostname: "${REDIS_HOST}"
2324
environment:
2425
REDIS_HOST: "${REDIS_HOST}"
2526
REDIS_PORT: "${REDIS_PORT}"
2627
command: ["redis-server", "/etc/redis/redis.conf", "--bind", "${REDIS_HOST}", "--port", "${REDIS_PORT}"]
2728
volumes:
2829
- 'redis:/var/lib/redis/data'
29-
- ./redis.conf:/etc/redis/redis.conf
30+
- ./local_dev/redis.conf:/etc/redis/redis.conf
3031
ports:
3132
- "127.0.0.1:${REDIS_PORT}:6379"
32-
networks:
33+
networks:
3334
- headstart
3435

3536
api:
36-
image: api:${SERVICE_VERSION}
37-
restart: always
37+
build:
38+
context: server
39+
dockerfile: workers/api/Dockerfile
40+
restart: unless-stopped
3841
environment:
3942
SERVICE_VERSION: "${SERVICE_VERSION}"
4043
REDIS_HOST: "${REDIS_HOST}"
@@ -44,20 +47,23 @@ services:
4447
BEHIND_PROXY: "${BEHIND_PROXY}"
4548
DEFAULT_DATABASE: "${DEFAULT_DATABASE}"
4649
FLASK_ENV: "${FLASK_ENV}"
47-
command: ["gunicorn", "--workers", "10", "--threads", "2", "-b", "0.0.0.0:${API_PORT}", "app:app", "--timeout", "300"]
50+
command: ["python", "app.py"]
4851
volumes:
4952
- ./api_cache:/var/api_cache
53+
- ./server/workers/api/src:/api
5054
depends_on:
5155
- redis
5256
- base
5357
- pubmed
5458
- openaire
55-
networks:
59+
networks:
5660
- headstart
5761

5862
persistence:
59-
image: persistence:${SERVICE_VERSION}
60-
restart: always
63+
build:
64+
context: server
65+
dockerfile: workers/persistence/Dockerfile
66+
restart: unless-stopped
6167
environment:
6268
SERVICE_VERSION: "${SERVICE_VERSION}"
6369
POSTGRES_USER: "${POSTGRES_USER}"
@@ -68,27 +74,16 @@ services:
6874
DEFAULT_DATABASE: "${DEFAULT_DATABASE}"
6975
FLASK_ENV: "${FLASK_ENV}"
7076
SSH_AUTH_SOCK: "/run/host-services/ssh-auth.sock"
71-
command: ["gunicorn", "--workers", "10", "--threads", "2", "-b", "0.0.0.0:${API_PORT}", "app:app", "--timeout", "300"]
72-
networks:
73-
- headstart
74-
75-
gsheets:
76-
image: gsheets:${SERVICE_VERSION}
77-
environment:
78-
SERVICE_VERSION: "${SERVICE_VERSION}"
79-
REDIS_HOST: "${REDIS_HOST}"
80-
REDIS_PORT: "${REDIS_PORT}"
81-
REDIS_DB: "${REDIS_DB}"
82-
REDIS_PASSWORD: "${REDIS_PASSWORD}"
83-
LOGLEVEL: "${LOGLEVEL}"
84-
restart: always
85-
depends_on:
86-
- redis
87-
networks:
77+
command: ["python", "app.py"]
78+
volumes:
79+
- ./server/workers/persistence/src:/api
80+
networks:
8881
- headstart
8982

9083
dataprocessing:
91-
image: dataprocessing:${SERVICE_VERSION}
84+
build:
85+
context: server
86+
dockerfile: workers/dataprocessing/Dockerfile
9287
environment:
9388
SERVICE_VERSION: "${SERVICE_VERSION}"
9489
REDIS_HOST: "${REDIS_HOST}"
@@ -103,17 +98,20 @@ services:
10398
LANG: "en_US.UTF-8"
10499
RENV_PATHS_CACHE: /renv/cache
105100
PYTHONIOENCODING: "utf-8"
106-
restart: always
101+
restart: unless-stopped
107102
volumes:
108-
- /opt/local/renv/cache:/renv/cache
103+
- ./local_dev/renv/cache:/renv/cache
109104
- /var/log/headstart:/var/log/headstart
105+
- ./server/preprocessing/other-scripts:/headstart/other-scripts
110106
depends_on:
111107
- redis
112-
networks:
108+
networks:
113109
- headstart
114110

115111
base:
116-
image: base:${SERVICE_VERSION}
112+
build:
113+
context: server
114+
dockerfile: workers/base/Dockerfile
117115
environment:
118116
SERVICE_VERSION: "${SERVICE_VERSION}"
119117
REDIS_HOST: "${REDIS_HOST}"
@@ -129,17 +127,20 @@ services:
129127
RENV_PATHS_CACHE: /renv/cache
130128
PYTHONIOENCODING: "utf-8"
131129
R_BASE_APIKEY: "${R_BASE_APIKEY}"
132-
restart: always
130+
restart: unless-stopped
133131
volumes:
134-
- /opt/local/renv/cache:/renv/cache
132+
- ./local_dev/renv/cache:/renv/cache
135133
- /var/log/headstart:/var/log/headstart
134+
- ./server/preprocessing/other-scripts:/headstart/other-scripts
136135
depends_on:
137136
- redis
138137
networks:
139138
- headstart
140139

141140
pubmed:
142-
image: pubmed:${SERVICE_VERSION}
141+
build:
142+
context: server
143+
dockerfile: workers/pubmed/Dockerfile
143144
environment:
144145
SERVICE_VERSION: "${SERVICE_VERSION}"
145146
REDIS_HOST: "${REDIS_HOST}"
@@ -154,17 +155,20 @@ services:
154155
LANG: "en_US.UTF-8"
155156
RENV_PATHS_CACHE: /renv/cache
156157
PYTHONIOENCODING: "utf-8"
157-
restart: always
158+
restart: unless-stopped
158159
volumes:
159-
- /opt/local/renv/cache:/renv/cache
160+
- ./local_dev/renv/cache:/renv/cache
160161
- /var/log/headstart:/var/log/headstart
162+
- ./server/preprocessing/other-scripts:/headstart/other-scripts
161163
depends_on:
162164
- redis
163165
networks:
164166
- headstart
165167

166168
openaire:
167-
image: openaire:${SERVICE_VERSION}
169+
build:
170+
context: server
171+
dockerfile: workers/openaire/Dockerfile
168172
environment:
169173
SERVICE_VERSION: "${SERVICE_VERSION}"
170174
REDIS_HOST: "${REDIS_HOST}"
@@ -179,15 +183,32 @@ services:
179183
LANG: "en_US.UTF-8"
180184
RENV_PATHS_CACHE: /renv/cache
181185
PYTHONIOENCODING: "utf-8"
182-
restart: always
186+
restart: unless-stopped
183187
volumes:
184-
- /opt/local/renv/cache:/renv/cache
188+
- ./local_dev/renv/cache:/renv/cache
185189
- /var/log/headstart:/var/log/headstart
190+
- ./server/preprocessing/other-scripts:/headstart/other-scripts
186191
depends_on:
187192
- redis
188193
networks:
189194
- headstart
190195

196+
searchflow:
197+
build: local_dev/searchflow-container
198+
volumes:
199+
- ../project-website:/var/www/html
200+
- ./local_dev/config_local_projectwebsite.php:/var/www/html/config_local.php
201+
- ../search-flow/:/var/www/html/search-flow
202+
- ./local_dev/config_local_searchflow.ini:/var/www/html/search-flow/config_local.ini
203+
- ../Headstart:/var/www/html/headstart
204+
- ./local_dev/config_local_headstart.ini:/var/www/html/headstart/server/preprocessing/conf/config_local.ini
205+
- ./local_dev/entrypoint.php:/var/www/html/entrypoint.php
206+
ports:
207+
- 127.0.0.1:8085:80
208+
networks:
209+
- headstart
210+
211+
191212
volumes:
192213
redis:
193214
db_data:
@@ -196,4 +217,4 @@ volumes:
196217
driver: local
197218

198219
networks:
199-
headstart:
220+
headstart:

0 commit comments

Comments
 (0)