-
Notifications
You must be signed in to change notification settings - Fork 1
172 lines (146 loc) · 6.35 KB
/
docker.yml
File metadata and controls
172 lines (146 loc) · 6.35 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
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
name: Docker Build & Push
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: docker-${{ github.ref }}
cancel-in-progress: true
jobs:
# ── Rust API Image ──────────────────────────────────────────
api:
name: API
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push openmodelstudio/api
uses: docker/build-push-action@v6
with:
context: .
file: deploy/Dockerfile.api
push: ${{ github.event_name != 'pull_request' }}
tags: |
gacwr/openmodelstudio-api:latest
gacwr/openmodelstudio-api:${{ github.sha }}
cache-from: type=gha,scope=api
cache-to: type=gha,mode=max,scope=api
# ── Frontend Image ─────────────────────────────────────────
frontend:
name: Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push openmodelstudio/frontend
uses: docker/build-push-action@v6
with:
context: web
file: deploy/Dockerfile.frontend
push: ${{ github.event_name != 'pull_request' }}
tags: |
gacwr/openmodelstudio-frontend:latest
gacwr/openmodelstudio-frontend:${{ github.sha }}
build-args: |
NEXT_PUBLIC_API_URL=http://localhost:31001
NEXT_PUBLIC_GRAPHQL_URL=http://localhost:31002/graphql
cache-from: type=gha,scope=frontend
cache-to: type=gha,mode=max,scope=frontend
# ── PostGraphile Image ─────────────────────────────────────
postgraphile:
name: PostGraphile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push openmodelstudio/postgraphile
uses: docker/build-push-action@v6
with:
context: postgraphile
file: deploy/Dockerfile.postgraphile
push: ${{ github.event_name != 'pull_request' }}
tags: |
gacwr/openmodelstudio-postgraphile:latest
gacwr/openmodelstudio-postgraphile:${{ github.sha }}
cache-from: type=gha,scope=postgraphile
cache-to: type=gha,mode=max,scope=postgraphile
# ── Python Model Runner Image ──────────────────────────────
# Uses docker build + docker push (not Buildx push) to handle large PyTorch layers
model-runner-python:
name: Model Runner (Python)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build image
run: |
docker build \
-f deploy/Dockerfile.model-runner-python \
-t gacwr/openmodelstudio-model-runner-python:latest \
-t gacwr/openmodelstudio-model-runner-python:${{ github.sha }} \
model-runner/python
- name: Push image
if: github.event_name != 'pull_request'
run: |
docker push gacwr/openmodelstudio-model-runner-python:latest
docker push gacwr/openmodelstudio-model-runner-python:${{ github.sha }}
# ── Rust Model Runner Image ────────────────────────────────
model-runner-rust:
name: Model Runner (Rust)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push openmodelstudio/model-runner-rust
uses: docker/build-push-action@v6
with:
context: model-runner/rust
file: deploy/Dockerfile.model-runner-rust
push: ${{ github.event_name != 'pull_request' }}
tags: |
gacwr/openmodelstudio-model-runner-rust:latest
gacwr/openmodelstudio-model-runner-rust:${{ github.sha }}
cache-from: type=gha,scope=model-runner-rust
cache-to: type=gha,mode=max,scope=model-runner-rust
# ── Workspace Image ────────────────────────────────────────
# Uses docker build + docker push (not Buildx push) to handle large jupyter layers
workspace:
name: Workspace
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build image
run: |
docker build \
-f deploy/Dockerfile.workspace \
-t gacwr/openmodelstudio-workspace:latest \
-t gacwr/openmodelstudio-workspace:${{ github.sha }} \
.
- name: Push image
if: github.event_name != 'pull_request'
run: |
docker push gacwr/openmodelstudio-workspace:latest
docker push gacwr/openmodelstudio-workspace:${{ github.sha }}