ci: build and publish the server container image to GHCR - #2
Merged
Conversation
Signed-off-by: Matthew Mckenzie <matthew.m.mckenzie@gmail.com>
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.
Why
Upstream publishes wheels to PyPI and five crates to crates.io; nothing produces a container image. Deploying this fork therefore means a full release cargo build on a workstation (~10–15 min cold) before anything can be pushed to a registry.
This fork builds its own image instead.
What
.github/workflows/release-image.yml— builds the repository's rootDockerfileand pushesswitchyard-servertoghcr.io/crunchymonkies/switchyard.*.*.*tag, plusworkflow_dispatchwith an optionaltag_suffixfor building an unreleased branch on demand.loads the image locally first, runs--dry-runagainst a minimal passthrough config, and only then pushes. An image whose binary cannot start or parse config is never published.linux/amd64only:.cargo/config.tomlcompiles forx86-64-v3, and a cross-architecture Rust release build under QEMU costs hours for no target node.docker/metadata-action, which also suppliesorg.opencontainers.image.source— that label is what links the GHCR package back to this repo, so noLABELin the Dockerfile is needed.Cargo.toml,Cargo.lock,rust-toolchain.toml,.cargo, andcrates, and every workspace member lives undercrates/..github/workflows/publish.yml— agithub.repository == 'NVIDIA-NeMo/Switchyard'guard on the two jobs that have noneeds. Every other job chains off one of them and a skipped dependency skips its dependents, so two lines neutralise PyPI and crates.io publishing in this fork without touchingon:, which keeps the file mergeable when upstream changes it.Notes
cache-to: type=ghahelps the base and apt layers and makes the push step nearly free, but any source change still busts the singlecargo buildlayer. Real incremental caching would need cargo-chef in the Dockerfile — deliberately out of scope.switchyard-server --config … --dry-runprintsserver OK: smoke.