Docker Workflow (WIP) - #1
Closed
xashr wants to merge 30 commits into
Closed
Conversation
Builds and publishes multi-arch images to ghcr.io: full-cpu (latest, mutable) full-cpu-<sha> (pinned to commit) full-cuda12 (latest, mutable) full-cuda12-<sha> (pinned to commit) CPU builds are enabled; CUDA 12 builds are present but skipped by default for initial testing.
- Pass IMAGE_URL and IMAGE_SOURCE via build-args instead of hardcoding them in Dockerfiles, so the labels always reflect the actual repository (works correctly for forks). - Add OCI index annotations (created, revision, url, source) to merged multi-arch manifests via imagetools create. - Make merge job strict: fail if 1/2 arch digests are missing (partial build failure), exit cleanly if 0/2 (intentionally skipped).
- Update default CUDA version from 12.9.0 to 12.9.2 - Add cuda13 tag (CUDA 13.3.0) for both amd64 and arm64 - Extend merge matrix to produce full-cuda13 / full-cuda13-<sha> images
- Rename workflow from 'Publish Docker image' to 'Build and publish Docker images' - Move schedule trigger before workflow_dispatch (schedule first, dispatch optional) - Remove stale 'remove after testing' comment
Replace short SHA (e.g. a1b2c3d4) with date (e.g. 20260711) for immutable Docker image tags. Immutable tags are now human-readable and sortable, e.g. full-cuda12-20260711 instead of full-cuda12-a1b2c3d4.
Disable ENGINE_ENABLE_NATIVE_CPU in Docker builds so the compiled binaries do not use -march=native. This prevents SIGILL crashes when running arm64 images on a different ARM CPU than the build runner (e.g. Ampere Altra CI runner vs Apple M-series). Matches the approach used by llama.cpp's Docker images.
- Enable CPU image builds for amd64 and arm64 (skip: false) - Disable CUDA 12 and CUDA 13 builds (skip: true) This allows the CPU images to be published with the GGML_NATIVE fix, while CUDA builds are temporarily disabled for testing.
- Add 7-char commit SHA to immutable tags (full-cpu-YYYYMMDD-HHHHHHH) - Add check-commits job to skip daily builds when no new commits - Manual trigger (workflow_dispatch) always builds, bypassing the check - Rename matrix skip flag to enabled for clarity - Track last built commit via lightweight git tag last-docker-build
- Add workflow_dispatch input 'force_build' (default: true) - When force_build=false, manual trigger respects commit check (skip if no new commits) - Revert schedule from hourly back to daily (4:12 AM UTC)
- actions/checkout: v4 -> v5 (Node 24 runtime) - docker/build-push-action: v6 -> v7 (Node 24 runtime, ESM) - actions/upload-artifact: v4 -> v7 (Node 24 runtime, ESM) - actions/download-artifact: v4 -> v8 (Node 24 runtime, ESM) No input parameter changes needed; all changes are version label bumps on the floating major-version tags.
Rename workflow jobs to use consistent verb-first naming: - Check commits -> Check for new commits - Metadata -> Generate metadata - Build variants -> Build (tag, platform) - Merge variants -> Merge (tag) - Update last-docker-build tag -> Update build tag
- Replace 3-line === separator style with single-line ── header style - Match comment style from docker.yml workflow - Pad all section headers to exactly 80 characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 30 added Dockerfiles for CPU and CUDA including examples. This PR adds a full GitHub workflow for building, caching and publishing multi-architecture Docker images to GHCR. Inspired by llama.cpp, adapted to audio.cpp.
This allows the user to simply reference a public docker image without having to build it locally (which is still supported).
Example (if merged):
docker pull ghcr.io/0xShug0/audio.cpp:full-cpuSee the fork workflow and fork image tags in action.
Workflow
Trigger
Workflow gets triggered daily at 3:21 UTC or manually. The workflow checks for new commits. If there is no new commit since the last build, the workflow jobs get cancelled to avoid wasting resources.
Can be adjusted as needed, e.g. build weekly to reduce actions usage.
Stages
check-commits— Compares HEAD tolast-docker-buildtag. Skips the entire run if no new commits since the last daily build.workflow_dispatchwithforce_build=trueoverrides the skip.metadata— Computesbuild_dateanddate_tagonce so all jobs use the same timestamp.build— Runs in parallel across architectures (amd64,arm64) and variants (cpu,cuda12,cuda13). Each job:fullstageghcr.iomerge— Downloads per-arch digests and usesdocker buildx imagetools createto assemble multi-arch manifests with OCI annotations. Produces:full-cpu— mutable "latest" tagfull-cpu-YYYYMMDD-HHHHHHH— immutable pinned tagfull-cuda12— mutable "latest" tagfull-cuda12-YYYYMMDD-HHHHHHH— immutable pinned tagfull-cuda13— mutable "latest" tagfull-cuda13-YYYYMMDD-HHHHHHH— immutable pinned tagupdate-tag— Force-pushes thelast-docker-buildgit tag to HEAD, enabling the skip-detection in step 1.Tested variants
Tested:
amd64: cpu, cuda12, cuda13 on Intel CPU + RTX 5090
arm64: cpu on Macbook Pro M5
Not tested (lacking hardware):
arm64: cuda12, cuda13
What is not included in this PR
This PR provides the workflow. If the PR gets accepted and the workflow works reliably, I can extend the documentation and examples.
Open issues
ENGINE_ENABLE_NATIVE_CPU=OFF. For local Docker builds this can be set to ON for improved performance. For published Docker builds it needs to be OFF to ensure portability, resulting in worse performance. llama.cpp offers the option to build withGGML_CPU_ALL_VARIANTS=ONwhich builds multiple separate CPU backend shared libraries, each optimized for a different CPU generation and loaded dynamically. It would be great to have that option for audio.cpp as well.