-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
205 lines (196 loc) · 5.74 KB
/
docker-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
version: "3"
volumes:
pip_cache:
model_cache:
conda_cache:
services:
app:
# force amd so it's the same as remote
platform: linux/amd64
build:
context: ./docker/notebook
dockerfile: Dockerfile
# command: python3 main.py
environment:
- HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN}
- XRT_TPU_CONFIG="localservice;0;localhost:51011"
# mps not supported yet
# deploy:
# resources:
# reservations:
# devices:
# - capabilities: [gpu]
# https://stackoverflow.com/questions/43844639/how-do-i-add-cached-or-delegated-into-a-docker-compose-yml-volumes-list
volumes:
- pip_cache:/root/.cache/pip:delegated
# TODO: make this one sync w/ localhost
- model_cache:/root/.cache/huggingface:delegated
- ./image_dir:/image_dir:default
base:
platform: linux/amd64
build:
context: ./ml-base
dockerfile: Dockerfile.base
environment:
- HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN}
volumes:
- pip_cache:/root/.cache/pip:delegated
# TODO: make this one sync w/ localhost
- model_cache:/root/.cache/huggingface:delegated
- ./image_dir:/image_dir:default
training-base:
platform: linux/amd64
build:
context: ./ml-base
dockerfile: Dockerfile.training-base
args:
- BASE_IMAGE=stable-diffusion_base
environment:
- HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN}
volumes:
- conda_cache:/root/.conda:delegated
- pip_cache:/root/.cache/pip:delegated
# TODO: make this one sync w/ localhost
- model_cache:/root/.cache/huggingface:delegated
- ./image_dir:/image_dir:default
training:
# force amd so it's the same as remote
platform: linux/amd64
build:
context: ./docker/training
dockerfile: Dockerfile
args:
- BASE_IMAGE=stable-diffusion_training-base
# entrypoint:
# - ./train-style.sh
entrypoint: ./train.sh
command:
- --model=stabilityai/stable-diffusion-2-1
- --data=/gcs/md-ml/training-data-styles/jpl-512
- --output=/image_dir
- --steps=50
- --phrase=dopeaf
- --repeat=100
- --batch=10
- --token=poster
- --learning=0.01
- --kind=style
environment:
- HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN}
volumes:
- conda_cache:/root/.conda:delegated
- pip_cache:/root/.cache/pip:delegated
- ./model-cache:/root/.cache/huggingface:default
- ./image_dir:/image_dir:default
training-update:
# force amd so it's the same as remote
platform: linux/amd64
build:
context: ./docker/training-update
dockerfile: Dockerfile
args:
- BASE_IMAGE=stable-diffusion_training-base
# entrypoint:
# - ./train-style.sh
entrypoint: ./train.sh
command:
- --model=stabilityai/stable-diffusion-2-1
- --data=/gcs/md-ml/training-data-styles/jpl-512
- --output=/image_dir
- --steps=50
- --phrase=dopeaf
- --repeat=100
- --batch=10
- --token=poster
- --learning=0.01
- --kind=style
environment:
- HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN}
volumes:
- conda_cache:/root/.conda:delegated
- pip_cache:/root/.cache/pip:delegated
- ./model-cache:/root/.cache/huggingface:default
- ./image_dir:/image_dir:default
train:
build:
context: ./py-jobs
environment:
- HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN}
- GOOGLE_APPLICATION_CREDENTIALS=creds.json
- GOOGLE_CLOUD_PROJECT=md-wbeebe-0808-example-apps
- REGION=us-central1
- GCS_BUCKET=gs://md-ml
- GCP_TOPIC=training-requests
- GCP_SUBSCRIPTION=trainer-sub
# flow:
# build:
# context: ./flow
# command: python main.py
# environment:
# - HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN}
# - GOOGLE_APPLICATION_CREDENTIALS=creds.json
# - GOOGLE_CLOUD_PROJECT=md-wbeebe-0808-example-apps
# - REGION=us-central1
# - GCS_BUCKET=gs://md-ml
# - GCP_TOPIC=training-requests
# - GCP_SUBSCRIPTION=trainer-sub
model-loader:
build:
context: ./docker/model-loader
dockerfile: Dockerfile
environment:
- HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN}
- GOOGLE_APPLICATION_CREDENTIALS=creds.json
- PROJECT_ID=md-wbeebe-0808-example-apps
- REGION=us-central1
- GCS_BUCKET=gs://md-ml
model-server:
platform: linux/amd64
build:
context: ./model-server
dockerfile: Dockerfile
ports:
- 6000:5000
environment:
- HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN}
- GOOGLE_APPLICATION_CREDENTIALS=creds.json
- PROJECT_ID=md-wbeebe-0808-example-apps
- REGION=us-central1
- GCS_BUCKET=gs://md-ml
volumes:
- model_cache:/root/.cache/huggingface:delegated
kflow:
build:
context: ./kflow
dockerfile: Dockerfile
environment:
- HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN}
- GOOGLE_APPLICATION_CREDENTIALS=creds.json
- PROJECT_ID=md-wbeebe-0808-example-apps
- REGION=us-central1
- GCS_BUCKET=gs://md-ml
volumes:
- ./creds.json:/creds.json
- ./kflow/components:/os-shared:default
open-ai:
build:
context: ./open-ai
dockerfile: Dockerfile
ports:
- 6000:5000
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
gcloud:
image: google/cloud-sdk:latest
volumes:
- ./creds.json:/creds.json
- ./gcloud-vol:/root/gcloud-vol
command: >
bash -c "
mkdir -p /root/gcloud-vol/jpl4 &&
gcloud auth activate-service-account --key-file=/creds.json &&
gcloud config set project md-wbeebe-0808-example-apps &&
gsutil -m cp -r \
"gs://md-ml/training-job-1672624636/model" \
./root/gcloud-vol/jpl4
"