forked from kubeflow/model-registry
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathdocker-compose-local.yaml
More file actions
134 lines (128 loc) · 3.59 KB
/
docker-compose-local.yaml
File metadata and controls
134 lines (128 loc) · 3.59 KB
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
# Local development demo/example compose file
# Composes:
# - a MySQL database,
# - a model-registry server built from source connected to the MySQL database.
# - a model-catalog server built from source.
# - a model-registry-ui built from source (standalone mode)
# or
# - a PostgreSQL database,
# - a model-registry server built from source connected to the PostgreSQL database.
# - a model-catalog server built from source.
# - a model-registry-ui built from source (standalone mode)
version: '3.8'
services:
model-registry-ui:
build:
context: ./clients/ui
dockerfile: Dockerfile.standalone
args:
DEPLOYMENT_MODE: standalone
STYLE_THEME: mui-theme
command:
- --port=9000
- --mock-k8s-client=true
- --mock-mr-client=false
- --mock-mr-catalog-client=false
- --dev-mode=true
- --deployment-mode=standalone
- --log-level=DEBUG
container_name: model-registry-ui
ports:
- "9000:9000"
depends_on:
- model-registry
- model-catalog
profiles:
- postgres
extra_hosts:
- "localhost:host-gateway"
model-catalog:
build:
context: .
dockerfile: Dockerfile
command: ["catalog", "--listen", "0.0.0.0:8081", "--catalogs-path", "/testdata/test-catalog-sources.yaml"]
container_name: model-catalog
ports:
- "8081:8081"
volumes:
- ./catalog/internal/catalog/testdata:/testdata
depends_on:
- postgres
profiles:
- postgres
environment:
- PGHOST=postgres
- PGDATABASE=model_catalog
- PGUSER=postgres
- PGPASSWORD=demo
model-registry:
build:
context: .
dockerfile: Dockerfile
entrypoint: ["/bin/sh"]
command:
- -c
- |
if [ "$$DB_TYPE" = "postgres" ]; then
exec /model-registry proxy --hostname 0.0.0.0 --datastore-type embedmd --embedmd-database-type postgres --embedmd-database-dsn "host=postgres port=5432 user=postgres password=demo dbname=model_registry sslmode=disable"
else
exec /model-registry proxy --hostname 0.0.0.0 --datastore-type embedmd --embedmd-database-dsn "root:demo@tcp(mysql:3306)/model_registry?charset=utf8mb4"
fi
container_name: model-registry
ports:
- "8080:8080"
depends_on:
- ${DB_TYPE:-mysql}
environment:
- DB_TYPE=${DB_TYPE:-mysql}
mysql:
image: mysql:8.3
container_name: mysql
command:
- --datadir=/var/lib/mysql/datadir
- --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_ROOT_PASSWORD=demo
- MYSQL_DATABASE=model_registry
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD-SHELL", "mysql -D $$MYSQL_DATABASE -uroot -p$$MYSQL_ROOT_PASSWORD -e 'SELECT 1'"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
profiles:
- mysql
postgres:
image: postgres:16
container_name: postgres
environment:
- POSTGRES_DB=model_registry
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=demo
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d model_registry"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
profiles:
- postgres
configs:
- source: pginit
target: /docker-entrypoint-initdb.d/pginit.sql
volumes:
mysql_data:
postgres_data:
configs:
pginit:
content: |
CREATE DATABASE model_catalog;
GRANT ALL PRIVILEGES ON model_catalog TO postgres;