Skip to content

Add Docker GitHub Workflow - #51

Merged
0xShug0 merged 4 commits into
0xShug0:mainfrom
xashr:feat/docker_workflow_pr
Jul 19, 2026
Merged

Add Docker GitHub Workflow#51
0xShug0 merged 4 commits into
0xShug0:mainfrom
xashr:feat/docker_workflow_pr

Conversation

@xashr

@xashr xashr commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

#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-cpu

See 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

  1. check-commits — Compares HEAD to last-docker-build tag. Skips the entire run if no new commits since the last daily build. workflow_dispatch with force_build=true overrides the skip.

  2. metadata — Computes build_date and date_tag once so all jobs use the same timestamp.

  3. build — Runs in parallel across architectures (amd64, arm64) and variants (cpu, cuda12, cuda13). Each job:

    • Builds a single-arch image targeting the full stage
    • Pushes by digest to ghcr.io
    • Uploads the digest as an artifact for the merge stage
  4. merge — Downloads per-arch digests and uses docker buildx imagetools create to assemble multi-arch manifests with OCI annotations. Produces:

    • full-cpu — mutable "latest" tag
    • full-cpu-YYYYMMDD-HHHHHHH — immutable pinned tag
    • full-cuda12 — mutable "latest" tag
    • full-cuda12-YYYYMMDD-HHHHHHH — immutable pinned tag
    • full-cuda13 — mutable "latest" tag
    • full-cuda13-YYYYMMDD-HHHHHHH — immutable pinned tag
  5. update-tag — Force-pushes the last-docker-build git 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 reduced performance. llama.cpp offers the option to build with GGML_CPU_ALL_VARIANTS=ON which 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. Otherwise I could try to enable native cpu for local and disable it for published images for now.
    => Will create separate issue. For now: OFF for published builds, ON for local builds
  • arm64 build warning
    => Removed "free disk space" step, currently not needed

@xashr
xashr marked this pull request as draft July 14, 2026 17:59
@xashr
xashr marked this pull request as ready for review July 18, 2026 22:46
@0xShug0

0xShug0 commented Jul 19, 2026

Copy link
Copy Markdown
Owner

@xashr Thanks! One runtime concern: The image currently copies binaries only. Current audio.cpp needs package specs unless the build uses embedded specs, so the Docker build should either enable AUDIOCPP_DEPLOYMENT_BUILD=ON or include model_specs/ in the runtime image.

Comments from ChatGPT (not sure if they are relevent):
Add permissions: contents: read
move the commet outside the build-args block: ENGINE_ENABLE_NATIVE_CPU=OFF # disable for cross-arch portability

xashr added 2 commits July 19, 2026 08:31
…U configurable

- Drop free-disk-space step (no longer needed with target: full)
- Add ENGINE_ENABLE_NATIVE_CPU build-arg (default ON) for local builds
- Set OFF in GitHub Actions for cross-arch portability
- Re-enable CUDA 13 builds
@xashr
xashr force-pushed the feat/docker_workflow_pr branch from 9117fd9 to 77e9b57 Compare July 19, 2026 08:40
@xashr

xashr commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

@0xShug0 : Valuable feedback! Look's like I was testing with the only model that does not require a model spec (pocket tts)... Fixed that. I will add another example which requires a model with spec in the follow up PR (docs).

Applied the other two suggestions as well. (permissions setting not needed if repo default, but makes it more explicit)

@0xShug0
0xShug0 merged commit b3a0812 into 0xShug0:main Jul 19, 2026
4 checks passed
@0xShug0

0xShug0 commented Jul 19, 2026

Copy link
Copy Markdown
Owner

@xashr Thank you for this great improvement! Merged.

dleiferives pushed a commit to dleiferives/audio.cpp that referenced this pull request Jul 25, 2026
* Add Docker GitHub workflow

* ci(docker): remove free-disk-space step; make ENGINE_ENABLE_NATIVE_CPU configurable

- Drop free-disk-space step (no longer needed with target: full)
- Add ENGINE_ENABLE_NATIVE_CPU build-arg (default ON) for local builds
- Set OFF in GitHub Actions for cross-arch portability
- Re-enable CUDA 13 builds

* ci(docker): include model_specs in docker image

* ci(docker): make workflow permission more explicit; remove comment in build-args block
Anc813 pushed a commit to Anc813/audio.cpp that referenced this pull request Jul 25, 2026
* Add Docker GitHub workflow

* ci(docker): remove free-disk-space step; make ENGINE_ENABLE_NATIVE_CPU configurable

- Drop free-disk-space step (no longer needed with target: full)
- Add ENGINE_ENABLE_NATIVE_CPU build-arg (default ON) for local builds
- Set OFF in GitHub Actions for cross-arch portability
- Re-enable CUDA 13 builds

* ci(docker): include model_specs in docker image

* ci(docker): make workflow permission more explicit; remove comment in build-args block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants