Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
IMAGE_NAME: marksverdhei/bakery
ARM64_CACHE_DIR: /var/lib/buildx-cache/bakery-arm64

jobs:
build-amd64:
Expand Down Expand Up @@ -42,6 +43,12 @@ jobs:
docker push "$tag"
done

- name: Cleanup
if: always()
run: |
docker rmi ${{ env.IMAGE_NAME }}:ci-build 2>/dev/null || true
docker image prune -f --filter "label=org.opencontainers.image.source=https://github.com/marksverdhei/bakery" --filter "until=72h" 2>/dev/null || true

build-arm64:
runs-on: [self-hosted, linux, x64]
needs: build-amd64
Expand All @@ -55,6 +62,12 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-config-inline: |
[worker.oci]
[[worker.oci.gcpolicy]]
maxUsedSpace = "20GB"
keepDuration = 604800

- name: Login to DockerHub
uses: docker/login-action@v3
Expand All @@ -72,6 +85,9 @@ jobs:
type=semver,pattern={{version}},suffix=-arm64
type=sha,prefix=,suffix=-arm64

- name: Prepare cache
run: mkdir -p ${{ env.ARM64_CACHE_DIR }}

- name: Build and push (arm64)
uses: docker/build-push-action@v6
with:
Expand All @@ -80,5 +96,22 @@ jobs:
platforms: linux/arm64
push: true
provenance: false
sbom: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=${{ env.ARM64_CACHE_DIR }}
cache-to: type=local,dest=${{ env.ARM64_CACHE_DIR }}-new,mode=max

- name: Rotate cache
if: always()
run: |
rm -rf ${{ env.ARM64_CACHE_DIR }}
if [ -d "${{ env.ARM64_CACHE_DIR }}-new" ]; then
mv ${{ env.ARM64_CACHE_DIR }}-new ${{ env.ARM64_CACHE_DIR }}
fi

- name: Cleanup
if: always()
run: |
docker buildx prune -f --keep-storage 20g 2>/dev/null || true
docker image prune -f --filter "until=72h" 2>/dev/null || true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
WORKDIR /opt/bakery
COPY pyproject.toml uv.lock README.md LICENSE ./
COPY src/ src/
RUN uv pip install ".[qlora]"
RUN uv pip install ".[qlora]" wandb flash-linear-attention

# Verify installation
RUN python3 -c "import bakery; import torch; print(f'bakery OK, torch={torch.__version__}, cuda_built={torch.version.cuda}')"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN uv pip install torch --index-url https://download.pytorch.org/whl/cu128
WORKDIR /opt/bakery
COPY pyproject.toml uv.lock README.md LICENSE ./
COPY src/ src/
RUN uv pip install ".[qlora]"
RUN uv pip install ".[qlora]" wandb flash-linear-attention

# Verify installation
RUN python3 -c "import bakery; import torch; print(f'bakery OK, torch={torch.__version__}, cuda_built={torch.version.cuda}')"
Expand Down
Loading