-
Notifications
You must be signed in to change notification settings - Fork 2
/
compose.yaml
250 lines (231 loc) · 6.56 KB
/
compose.yaml
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
services:
# This service is shared by all other services - be careful when adding to it.
common-base:
# Set an arbitrary base image, because older versions of Docker (24.x at least; 27.x is fixed)
# require an image on all services. But every subclass of common-base here redefines
# the image property. At some point (when platforms have newer Dockers) we can drop this.
image: alpine:latest
environment:
# These are commonly-supported networking environment variables.
# Yes, the lowercase forms are intentional.
# See https://about.gitlab.com/blog/2021/01/27/we-need-to-talk-no-proxy/ for background.
- HTTP_PROXY
- http_proxy
- HTTPS_PROXY
- https_proxy
- ALL_PROXY
- all_proxy
- NO_PROXY
- no_proxy
- SSL_CERT_DIR
- SSL_CERT_FILE
profiles:
- base
cumulus-etl-base:
extends: common-base
image: smartonfhir/cumulus-etl:latest
build:
context: .
target: cumulus-etl
environment:
# Environment variobles to pull in from the host
- AWS_ACCESS_KEY_ID
- AWS_DEFAULT_PROFILE
- AWS_PROFILE
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
- AZURE_OPENAI_API_KEY
- AZURE_OPENAI_ENDPOINT
# Internal environment variobles
- CUMULUS_HUGGING_FACE_URL=http://llama2:8086/
- URL_CTAKES_REST=http://ctakes-covid:8080/ctakes-web-rest/service/analyze
- URL_CNLP_NEGATION=http://cnlpt-negation:8000/negation/process
- URL_CNLP_TERM_EXISTS=http://cnlpt-term-exists:8000/termexists/process
volumes:
- $HOME/.aws/:/root/.aws/:ro
- ctakes-overrides:/ctakes-overrides
networks:
- cumulus-etl
profiles:
- base
cumulus-etl:
extends: cumulus-etl-base
profiles:
- etl
cumulus-etl-gpu:
extends: cumulus-etl-base
environment:
- URL_CNLP_NEGATION=http://cnlpt-negation-gpu:8000/negation/process
- URL_CNLP_TERM_EXISTS=http://cnlpt-term-exists-gpu:8000/termexists/process
profiles:
- etl-gpu
ctakes-covid-base:
extends: common-base
image: smartonfhir/ctakes-covid:1.1.1
environment:
- ctakes_umlsuser=umls_api_key
- ctakes_umlspw=$UMLS_API_KEY
networks:
- cumulus-etl
profiles:
- base
volumes:
- ctakes-overrides:/overrides
ctakes-covid:
extends: ctakes-covid-base
profiles:
- covid-symptom
- covid-symptom-gpu
- upload-notes
- upload-notes-gpu
cnlpt-negation:
extends: common-base
image: smartonfhir/cnlp-transformers:negation-0.6.1-cpu
profiles:
- covid-symptom
- upload-notes
networks:
- cumulus-etl
cnlpt-negation-gpu:
extends: common-base
image: smartonfhir/cnlp-transformers:negation-0.6.1-gpu
profiles:
- covid-symptom-gpu
- upload-notes-gpu
networks:
- cumulus-etl
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
cnlpt-term-exists:
extends: common-base
image: smartonfhir/cnlp-transformers:termexists-0.6.1-cpu
profiles:
- covid-symptom
networks:
- cumulus-etl
cnlpt-term-exists-gpu:
extends: common-base
image: smartonfhir/cnlp-transformers:termexists-0.6.1-gpu
profiles:
- covid-symptom-gpu
networks:
- cumulus-etl
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
# This is a WIP llama2 setup, currently suitable for running in a g5.xlarge AWS instance.
llama2:
extends: common-base
image: ghcr.io/huggingface/text-generation-inference:1.0.1
environment:
# If you update anything here that could affect NLP results, consider updating the
# task_version of any tasks that use this docker.
- HUGGING_FACE_HUB_TOKEN
- MODEL_ID=meta-llama/Llama-2-13b-chat-hf
- QUANTIZE=bitsandbytes-nf4 # 4bit
- PORT=8086
- REVISION=0ba94ac9b9e1d5a0037780667e8b219adde1908c
healthcheck:
# There's no curl or wget inside this container, but there is python3!
test: ["CMD", "python3", "-c", "import socket; socket.create_connection(('localhost', 8086))"]
start_period: 20m # give plenty of time for startup, since we may be downloading a model
volumes:
- hf-data:/data
profiles:
- hf-test
networks:
- cumulus-etl
ports:
- 8086:8086
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
# these images are intended specifically for development work
cumulus-etl-test:
extends:
service: cumulus-etl-base
build:
context: .
target: cumulus-etl-test
environment:
- URL_CTAKES_REST=http://ctakes-covid-test:8080/ctakes-web-rest/service/analyze
- URL_CNLP_NEGATION=http://cnlp-transformers-test:8000/negation/process
volumes:
- ./:/cumulus-etl/
working_dir: /cumulus-etl
command:
- /cumulus-etl/tests/data/simple/ndjson-input
- /cumulus-etl/example-output
- /cumulus-etl/example-phi-build
- --output-format=ndjson
profiles:
- test
cumulus-etl-test-gpu:
extends:
service: cumulus-etl-base
build:
context: .
target: cumulus-etl-test
environment:
- URL_CTAKES_REST=http://ctakes-covid-test:8080/ctakes-web-rest/service/analyze
- URL_CNLP_NEGATION=http://cnlp-transformers-test-gpu:8000/negation/process
volumes:
- ./:/cumulus-etl/
working_dir: /cumulus-etl
command:
- /cumulus-etl/tests/data/simple/ndjson-input
- /cumulus-etl/example-output
- /cumulus-etl/example-phi-build
- --output-format=ndjson
profiles:
- test-gpu
ctakes-covid-test:
extends:
service: ctakes-covid-base
profiles:
- test
- test-gpu
ports:
- 8080:8080
cnlp-transformers-test:
extends: common-base
image: smartonfhir/cnlp-transformers:negation-latest-cpu
#build:
# context: ../cnlp_transformers/docker
# dockerfile: Dockerfile.cpu
ports:
- 8000:8000
profiles:
- test
networks:
- cumulus-etl
cnlp-transformers-test-gpu:
extends: common-base
image: smartonfhir/cnlp-transformers:negation-latest-gpu
#build:
# context: ../cnlp_transformers/docker
# dockerfile: Dockerfile.gpu
ports:
- 8000:8000
profiles:
- test-gpu
networks:
- cumulus-etl
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
networks:
cumulus-etl:
name: cumulus-etl
volumes:
ctakes-overrides:
hf-data: