Add Docker GitHub Workflow - #51
Conversation
|
@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 Comments from ChatGPT (not sure if they are relevent): |
…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
9117fd9 to
77e9b57
Compare
|
@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) |
|
@xashr Thank you for this great improvement! Merged. |
* 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
* 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
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-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 reduced 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. 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