Skip to content

Commit dd67ed8

Browse files
fix: split Docker builds into separate jobs to avoid disk space exhaustion (#209)
Each bake target now runs in its own runner via matrix strategy, preventing the "No space left on device" error that occurred when building all 8 images on a single runner. Co-authored-by: Tim Pietrusky <timpietrusky@gmail.com>
1 parent ffdf4d7 commit dd67ed8

2 files changed

Lines changed: 40 additions & 7 deletions

File tree

.changeset/split-docker-builds.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"worker-comfyui": patch
3+
---
4+
5+
fix: split Docker builds into separate jobs to avoid running out of disk space

.github/workflows/release.yml

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515

1616
outputs:
1717
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
18+
version: ${{ steps.version.outputs.version }}
1819

1920
steps:
2021
- name: Checkout
@@ -42,6 +43,13 @@ jobs:
4243
env:
4344
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4445

46+
- name: Read version from package.json
47+
id: version
48+
if: >-
49+
github.event_name == 'workflow_dispatch' ||
50+
(steps.changesets.outputs.hasChangesets == 'false' && contains(github.event.head_commit.message, 'chore: version packages'))
51+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
52+
4553
docker:
4654
needs: release
4755
if: >-
@@ -51,6 +59,19 @@ jobs:
5159
permissions:
5260
contents: write
5361

62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
target:
66+
- base
67+
- sdxl
68+
- sd3
69+
- flux1-schnell
70+
- flux1-dev
71+
- flux1-dev-fp8
72+
- z-image-turbo
73+
- base-cuda12-8-1
74+
5475
steps:
5576
- name: Checkout
5677
uses: actions/checkout@v4
@@ -62,10 +83,6 @@ jobs:
6283
rm -rf "/usr/local/share/boost"
6384
rm -rf "$AGENT_TOOLSDIRECTORY"
6485
65-
- name: Read version from package.json
66-
id: version
67-
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
68-
6986
- name: Set up QEMU
7087
uses: docker/setup-qemu-action@v3
7188

@@ -78,16 +95,27 @@ jobs:
7895
username: ${{ secrets.DOCKERHUB_USERNAME }}
7996
password: ${{ secrets.DOCKERHUB_TOKEN }}
8097

81-
- name: Build and push the images to Docker Hub
98+
- name: Build and push ${{ matrix.target }}
8299
uses: docker/bake-action@v2
83100
with:
101+
targets: ${{ matrix.target }}
84102
push: true
85103
set: |
86104
*.args.DOCKERHUB_REPO=${{ vars.DOCKERHUB_REPO }}
87105
*.args.DOCKERHUB_IMG=${{ vars.DOCKERHUB_IMG }}
88-
*.args.RELEASE_VERSION=${{ steps.version.outputs.version }}
106+
*.args.RELEASE_VERSION=${{ needs.release.outputs.version }}
89107
*.args.HUGGINGFACE_ACCESS_TOKEN=${{ secrets.HUGGINGFACE_ACCESS_TOKEN }}
90108
109+
post-release:
110+
needs: [release, docker]
111+
runs-on: ubuntu-latest
112+
permissions:
113+
contents: write
114+
115+
steps:
116+
- name: Checkout
117+
uses: actions/checkout@v4
118+
91119
- name: Update description on Docker Hub
92120
uses: peter-evans/dockerhub-description@v3
93121
with:
@@ -98,4 +126,4 @@ jobs:
98126
- name: Create GitHub release
99127
env:
100128
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101-
run: gh release create "${{ steps.version.outputs.version }}" --generate-notes
129+
run: gh release create "${{ needs.release.outputs.version }}" --generate-notes

0 commit comments

Comments
 (0)