-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
199 lines (186 loc) · 5.15 KB
/
docker-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
version: "3.8"
services:
# Extractor service
hf_extractor_with_gpu:
profiles: [gpu]
container_name: hf_gpu
build:
context: .
dockerfile: ./extractors/hf_extractor/Dockerfile.gpu # Path to extractor Dockerfile
# Define volumes to mount extractor scripts or dependencies
volumes:
- ./extractors/hf_extractor:/app
- ../data/transform_queue:/transform_queue
- ../data/datasets:/datasets
- ./config_data:/config_data
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [gpu]
dns:
- 1.1.1.1
# depends_on:
# - mysql
# Uncomment this line to run the script
# command: ["python3", "ExtractFromDataset.py"]
# Uncomment this line to develop on the container
command: ["tail", "-f", "/dev/null"]
networks:
- mlentory_network
hf_extractor_with_no_gpu:
profiles: [no_gpu]
container_name: hf_no_gpu
build:
context: .
dockerfile: ./extractors/hf_extractor/Dockerfile.no_gpu # Path to extractor Dockerfile
# Define volumes to mount extractor scripts or dependencies
volumes:
- ./extractors/hf_extractor:/app
- ../data/transform_queue:/transform_queue
- ../data/datasets:/datasets
- ./config_data:/config_data
dns:
- 1.1.1.1
# Uncomment this line to test the script
# command: ["python3", "main.py"]
# Uncomment this line to develop on the container
command: ["tail", "-f", "/dev/null"]
networks:
- mlentory_network
### Module in charge of transforming the data to the RDA FAIR4ML schema
transform:
profiles:
- gpu
- no_gpu
container_name: transform
build:
context: .
dockerfile: ./transform/Dockerfile # Path to extractor Dockerfile
# Define volumes to mount extractor scripts or dependencies
volumes:
- ./transform:/app
- ../data/transform_queue:/transform_queue
- ../data/load_queue:/load_queue
- ../data/datasets:/datasets
- ./config_data:/config_data
dns:
- 1.1.1.1
# Uncomment this line to test the script
# command: ["tail", "-f", "/dev/null"]
command: ["python3", "main.py"]
networks:
- mlentory_network
# Uncomment for production
#command: ["python3", "ExtractFromDataset.py"]
### Module in charge of loading the data into the database
load:
depends_on:
- transform
- postgres
- virtuoso
- elastic
profiles:
- gpu
- no_gpu
container_name: load
build:
context: .
dockerfile: ./load/Dockerfile # Path to extractor Dockerfile
# Define volumes to mount extractor scripts or dependencies
volumes:
- ./load:/app
- ../data/load_queue:/load_queue
- ../data/virtuoso_data/kg_files:/kg_files
- ./config_data:/config_data
# Necessary to run docker commands inside other containers
- /var/run/docker.sock:/var/run/docker.sock
dns:
- 1.1.1.1
# Uncomment this line to test the script
# command: ["tail", "-f", "/dev/null"]
command: ["python3", "main.py"]
networks:
- mlentory_network
### SQL database
postgres:
profiles:
- gpu
- no_gpu
image: postgres:14.1-alpine
container_name: postgres
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: history_DB
ports:
- '5432:5432'
volumes:
- ./load/sql_files/init.sql:/docker-entrypoint-initdb.d/init.sql
- ../data/postgres_data:/var/lib/postgresql/data
networks:
- mlentory_network
# anzograph:
# image: cambridgesemantics/anzograph:latest
# ports:
# - "8085:8080"
# - "8443:8443"
# volumes:
# - /DB/anzograph-data:/opt/anzograph-data
### RDF database
virtuoso:
profiles:
- gpu
- no_gpu
image: openlink/virtuoso-opensource-7:latest
hostname: virtuoso
container_name: virtuoso
ports:
- "1111:1111"
- "8890:8890"
environment:
DBA_PASSWORD: my_strong_password
volumes:
- ../data/virtuoso_data:/opt/virtuoso-opensource/database
networks:
- mlentory_network
### Component to index data based on specific paramaters in Elasticsearch
elastic:
profiles:
- gpu
- no_gpu
image: docker.elastic.co/elasticsearch/elasticsearch:7.6.0
container_name: elastic
hostname: elastic
# privileged: true
environment:
- node.name=elastic
- "transport.host=localhost"
- "bootstrap.system_call_filter=false"
# - discovery.type=single-node
- cluster.name=es-docker-cluster
- cluster.initial_master_nodes=elastic
- bootstrap.memory_lock=true
# - node.max_local_storage_nodes=2
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ../data/elasticsearch_data:/usr/share/elasticsearch/data
ports:
- 9200:9200
- 9300:9300
networks:
- mlentory_network
# networks:
# my-macvlan-net:
# external: true
# name: my-macvlan-net
# host:
# external: true
networks:
mlentory_network:
external: true