-
Notifications
You must be signed in to change notification settings - Fork 13
/
docker-compose.yml
169 lines (160 loc) · 5.58 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
version: "3.8"
services:
# This service runs dagit, which loads your user code from the user code container.
# Since our instance uses the QueuedRunCoordinator, any runs submitted from dagit will be put on
# a queue and later dequeued and launched by dagster-daemon.
dagit:
container_name: valmi-dagit
entrypoint:
- dagit
- -h
- "0.0.0.0"
- -p
- "4002"
- -w
- workspace.yaml
environment:
DAGSTER_POSTGRES_USER: ${DAGSTER_POSTGRES_USER}
DAGSTER_POSTGRES_PASSWORD: ${DAGSTER_POSTGRES_PASSWORD}
DAGSTER_POSTGRES_DB: ${DAGSTER_POSTGRES_DB}
volumes: # Make docker client accessible so we can terminate containers from dagit
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/io_manager_storage:/tmp/io_manager_storage
- /tmp/shared_dir:/tmp/shared_dir
networks:
- valmi-network
depends_on:
- valmi-db
- valmi-repo
# This service runs the dagster-daemon process, which is responsible for taking runs
# off of the queue and launching them, as well as creating runs from schedules or sensors.
dagster_daemon:
entrypoint:
- dagster-daemon
- run
container_name: valmi-dagster-daemon
restart: on-failure
environment:
DAGSTER_POSTGRES_USER: ${DAGSTER_POSTGRES_USER}
DAGSTER_POSTGRES_PASSWORD: ${DAGSTER_POSTGRES_PASSWORD}
DAGSTER_POSTGRES_DB: ${DAGSTER_POSTGRES_DB}
ACTIVATION_ENGINE_URL: ${ACTIVATION_ENGINE_URL}
VALMI_INTERMEDIATE_STORE: ${VALMI_INTERMEDIATE_STORE}
NUM_SAMPLES_PER_CODE: ${NUM_SAMPLES_PER_CODE}
volumes: # Make docker client accessible so we can launch containers using host docker
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/io_manager_storage:/tmp/io_manager_storage
- /tmp/shared_dir:/tmp/shared_dir
networks:
- valmi-network
depends_on:
- valmi-db
- valmi-repo
###############################################################################################
# This service runs the postgres DB used by dagster for run storage, schedule storage,
# and event log storage.
valmi-db:
image: postgres:13.2
container_name: valmi-db
command: ["postgres", "-c", "log_statement=all"]
volumes:
- postgres:${PGDATA}
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
PGDATA: ${PGDATA}
restart: unless-stopped
networks:
- valmi-network
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "postgres"]
interval: 1s
timeout: 10s
retries: 10
# This service runs the gRPC server that loads your user code, in both dagit
# and dagster-daemon. By setting DAGSTER_CURRENT_IMAGE to its own image, we tell the
# run launcher to use this same image when launching runs in a new container as well.
# Multiple containers like this can be deployed separately - each just needs to run on
# its own port, and have its own entry in the workspace.yaml file that's loaded by dagit.
valmi-repo:
container_name: valmi-repo
image: valmiio/valmi-repo
restart: always
environment:
DAGSTER_POSTGRES_USER: ${DAGSTER_POSTGRES_USER}
DAGSTER_POSTGRES_PASSWORD: ${DAGSTER_POSTGRES_PASSWORD}
DAGSTER_POSTGRES_DB: ${DAGSTER_POSTGRES_DB}
DAGSTER_CURRENT_IMAGE: ${DAGSTER_CURRENT_IMAGE}
ACTIVATION_ENGINE_URL: ${ACTIVATION_ENGINE_URL}
networks:
- valmi-network
volumes: # Make docker client accessible so we can terminate containers from dagit
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/shared_dir:/tmp/shared_dir:z
valmi-activation:
command:
[
"uvicorn",
"main:app",
"--port",
"8000",
"--host",
"0.0.0.0",
"--log-level",
"debug",
"--workers",
"1"
]
container_name: valmi-activation
restart: unless-stopped
volumes:
- valmi-activation-data:/data
- /var/run/docker.sock:/var/run/docker.sock
- ./config.yaml:/workspace/config.yaml
- /tmp/shared_dir:/tmp/shared_dir:z
networks:
- valmi-network
depends_on:
- valmi-db
- dagit
environment:
DATABASE_URL: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@valmi-db:5432/valmi_activation"
APP_BACKEND: ${APP_BACKEND}
DAGIT_HOST: ${DAGIT_HOST}
DAGIT_PORT: ${DAGIT_PORT}
OTEL_FASTAPI_INSTRUMENT: ${OTEL_FASTAPI_INSTRUMENT}
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT}
OTEL_SERVICE_NAME: ${OTEL_SERVICE_NAME}
OTEL_PYTHON_LOG_LEVEL: ${OTEL_PYTHON_LOG_LEVEL}
OTEL_PYTHON_LOG_CORRELATION: ${OTEL_PYTHON_LOG_CORRELATION}
OTEL_EXPORTER_OTLP_INSECURE: ${OTEL_EXPORTER_OTLP_INSECURE}
VALMI_INTERMEDIATE_STORE: ${VALMI_INTERMEDIATE_STORE}
ALERTS_ENABLED: ${ALERTS_ENABLED}
ALERTS_API_URL: ${ALERTS_API_URL}
ALERTS_API_AUTH_HEADER_VALUE: ${ALERTS_API_AUTH_HEADER_VALUE}
DEPLOYMENT_ENVIRONMENT: ${DEPLOYMENT_ENVIRONMENT}
ALERTS_ORIGIN: ${ALERTS_ORIGIN}
valmi-app-backend:
env_file:
- ./valmi-app-backend/.env
ports:
- "4000:4000"
container_name: valmi-app-backend
restart: on-failure
networks:
- valmi-network
depends_on:
- valmi-db
environment:
DATABASE_URL: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@valmi-db:5432/valmi_app"
ACTIVATION_SERVER: ${ACTIVATION_ENGINE_URL}
volumes:
- ./valmi-app-backend/.env:/workspace/.env
volumes:
postgres:
valmi-activation-data:
networks:
valmi-network:
driver: bridge
name: valmi-network