Skip to content

Commit 8e5029b

Browse files
Bake in models into runner image
1 parent 21c5539 commit 8e5029b

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/ai-runner-live-pipelines-docker.yaml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ jobs:
144144
type=raw,value=latest,enable={{is_default_branch}},prefix=live-app-${{ matrix.pipeline }}-
145145
146146
- name: Build and push pipeline app image
147+
id: build
147148
uses: docker/build-push-action@v6
148149
with:
149150
context: "{{defaultContext}}:runner"
@@ -156,9 +157,41 @@ jobs:
156157
tags: ${{ steps.meta.outputs.tags }}
157158
annotations: ${{ steps.meta.outputs.annotations }}
158159
labels: ${{ steps.meta.outputs.labels }}
159-
cache-from: type=registry,ref=livepeer/ai-runner:live-app-${{ matrix.pipeline }}-dockerbuildcache
160+
cache-from: |
161+
type=registry,ref=livepeer/ai-runner:live-app-${{ matrix.pipeline }}-dockerbuildcache
162+
livepeer/ai-runner:latest
160163
cache-to: type=registry,ref=livepeer/ai-runner:live-app-${{ matrix.pipeline }}-dockerbuildcache,mode=max
161164

165+
- name: Extract metadata for app image with /models directory
166+
id: meta-models
167+
uses: docker/metadata-action@v5
168+
with:
169+
images: livepeer/ai-runner-models
170+
tags: |
171+
type=raw,value=live-app-${{ matrix.pipeline }}-with-models,enable={{is_default_branch}}
172+
type=sha,prefix=live-app-${{ matrix.pipeline }}-with-models-
173+
type=ref,event=pr,prefix=live-app-${{ matrix.pipeline }}-with-models-
174+
type=ref,event=tag,prefix=live-app-${{ matrix.pipeline }}-with-models-
175+
type=raw,value=latest,enable={{is_default_branch}},prefix=live-app-${{ matrix.pipeline }}-with-models-
176+
177+
- name: Build and push pipeline app image with /models directory
178+
uses: docker/build-push-action@v6
179+
with:
180+
context: "{{defaultContext}}:runner"
181+
file: docker/Dockerfile.live-app__PIPELINE__-models-rtx-4090
182+
build-args: |
183+
BASE=livepeer/ai-runner@${{ steps.build.outputs.Digest }}
184+
platforms: linux/amd64
185+
push: true
186+
tags: ${{ steps.meta-models.outputs.tags }}
187+
annotations: ${{ steps.meta-models.outputs.annotations }}
188+
labels: ${{ steps.meta.outputs-models.labels }}
189+
cache-from: |
190+
livepeer/ai-runner-models:latest
191+
livepeer/ai-runner@${{ steps.build.outputs.Digest }}
192+
type=registry,ref=livepeer/ai-runner:live-app-${{ matrix.pipeline }}-with-models-dockerbuildcache
193+
cache-to: type=registry,ref=livepeer/ai-runner:live-app-${{ matrix.pipeline }}-with-models-dockerbuildcache,mode=max
194+
162195
- name: Notify new build upload
163196
run: curl -X POST https://holy-bread-207a.livepeer.workers.dev
164197

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ARG BASE
2+
FROM ${BASE}
3+
4+
COPY --from=livepeer/ai-runner-models:latest-tensorrt-rtx-4090 /models /models

0 commit comments

Comments
 (0)