Skip to content

ci: add reusable pack-build-image and pack-release workflows - #43

Merged
dcmcand merged 6 commits into
mainfrom
feat/pack-release-workflows
Jul 15, 2026
Merged

ci: add reusable pack-build-image and pack-release workflows#43
dcmcand merged 6 commits into
mainfrom
feat/pack-release-workflows

Conversation

@dcmcand

@dcmcand dcmcand commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Adds two reusable (workflow_call) workflows so Nebari software packs share one release pipeline instead of each maintaining its own copy. The nebari-llm-serving-pack is the first consumer; the data-science pack and software-pack-template can migrate onto these next.

What's here

pack-build-image.yaml - builds one image and pushes it to ghcr.io + quay.io, tagged sha-<short> (plus latest on the default branch). Parameterized on image / context / dockerfile / target / platforms / push, so packs with per-image build contexts work (a generalization of the data-science pack's single-Dockerfile-plus-target build). Fork PRs build without pushing (no secret exposure).

pack-release.yaml - on a caller's Chart.yaml change: reads the version, skips if that release already exists, pins the given values.yaml image tags to the release commit's sha-<short> in the packaged copy only (never committed back), packages the chart, creates a GitHub Release with --generate-notes (--prerelease when the version has a pre-release suffix), and syncs the chart to nebari-dev/helm-repository via the shared sync-chart action. Pinning uses the repo's own tested pin_image_tags.py, reached by checking out this repo at job.workflow_sha (the exact commit the caller pinned).

.github/scripts/pin_image_tags.py (+ pytest) - the value-pinning logic, ruamel round-trip so comments/quoting survive; fails loudly on a mistyped path.

Design notes

  • No writes to protected branches, no elevated identity. The release uses the default GITHUB_TOKEN; only the sync-chart step uses NEBARI_HELM_REPO_TOKEN. Image tags are pinned at package time (the "pin-at-release" model), so nothing needs to push sha tags back to main.
  • quay.io publishing of the chart happens downstream in helm-repository's own release workflow after the sync PR merges; this workflow deliberately does not call ensure-quay-repos (it has no access to that repo-scoped token, and it would race the downstream automation).
  • Additive only - no existing workflows are modified.
  • actionlint-clean; the scoped .github/actionlint.yaml suppresses two false positives where actionlint's built-in job-context type does not yet include the documented job.workflow_repository / job.workflow_sha properties (remove once actionlint catches up).

Verification

  • pytest .github/scripts/test_pin_image_tags.py - 6/6 pass (value set, comment preservation, multi-path, missing-key error, no partial write on failure).
  • actionlint on both workflows - clean.
  • Live behavior (quay push, OCI publish, GitHub Release) is exercised the first time a consumer pack runs these; the LLM pack consumer PR follows and pins this workflow at a tag cut from this branch.

dcmcand added 5 commits July 15, 2026 11:06
Adds pack-release.yaml, a workflow_call reusable workflow that reads a
chart's version from Chart.yaml, skips if that release already exists,
pins the given values.yaml image tag paths to sha-<short> of the
release commit in the working copy only, packages the chart, publishes
a GitHub Release with the .tgz attached, and syncs the chart source to
nebari-dev/helm-repository via the shared sync-chart action.

Also adds pin_image_tags.py (ruamel.yaml round-trip, comment-preserving)
and its pytest suite, which back the pin step (also inlined into the
workflow since it runs against the caller's checkout, not this repo's).
…e tested pin script

Replace the inlined python heredoc duplicate of pin_image_tags.py with a
real checkout of nebari-dev/.github at job.workflow_sha (the caller-pinned
commit) into _dot-github/, then invoke the tested script from there. This
was previously believed impossible for a reusable workflow, but the job
context's workflow_repository/workflow_sha properties exist exactly for
this case (not available on GHES, but nebari-dev is on github.com).

Also pass chart-path, chart-name, tag-paths and the sha into shell steps
via env: blocks instead of interpolating ${{ inputs.* }} directly into
run: bodies, as defense-in-depth for a shared workflow.

Adds .github/actionlint.yaml to silence two actionlint false positives:
it doesn't yet know about the job.workflow_repository/workflow_sha
context properties GitHub added for reusable workflows.
Ubuntu 24.04 runners do not alias 'python'/'pip' to python3; use
python3 and 'python3 -m pip' so the pin step is reliable on first run.
The workflow pins the release commit's sha, so consumers must trigger
their image build on Chart.yaml/chart changes too, not only source
changes. Documents the parallel-build, no-hard-gate v1 behavior.
…kflows

- pack-release.yaml: pass chart version/tag/repo through env instead of
  interpolating steps.*/github.* expressions directly into run: bodies
  (a crafted Chart.yaml version could otherwise inject shell commands).
- pack-release.yaml: add set -euo pipefail to run blocks that lacked
  it, guard the release step to require exactly one .tgz, set up
  Python via actions/setup-python before installing ruamel.yaml, and
  package the chart with an explicit --destination.
- pack-build-image.yaml: QUAY_TOKEN is now required: false since
  push:false (PR) builds never reach the Quay login/push steps, which
  are already gated on inputs.push.
- add lint-test.yaml: actionlint (pinned rhysd/actionlint image by
  digest) and pytest (actions/setup-python pinned by SHA) on pull
  requests and pushes to main, scoped to the workflows/scripts this
  change touches.
@dcmcand
dcmcand merged commit 268e5e5 into main Jul 15, 2026
2 checks passed
@dcmcand
dcmcand deleted the feat/pack-release-workflows branch July 15, 2026 16:04
dcmcand added a commit to nebari-dev/llm-serving-pack that referenced this pull request Jul 15, 2026
Now that nebari-dev/.github#43 is merged and tagged v1, pin the caller
refs to the release tag and drop the bring-up TODOs.
dcmcand added a commit to nebari-dev/llm-serving-pack that referenced this pull request Jul 15, 2026
…ishing (#139)

* operator: make model-downloader init image configurable via LLM_MODEL_DOWNLOADER_IMAGE

* chart: decouple image tags from appVersion; add configurable model-downloader image

* ci: consume reusable build/release workflows; add categorized changelog config

Replace the per-image build steps in build-images.yaml with thin caller
jobs that invoke the shared nebari-dev/.github pack-build-image reusable
workflow, add a release.yaml caller for pack-release, and add
.github/release.yml with changelog categories keyed on this repo's
labels. The @feat/pack-release-workflows ref is a bring-up ref and must
be re-pinned to v1 before this PR merges.

* docs: rewrite release process for pin-at-release OCI publishing

* ci: build images on Chart.yaml bump so release-commit shas exist

Add charts/nebari-llm-serving/Chart.yaml to the push trigger paths in
build-images.yaml so the release commit (a Chart.yaml version bump)
produces sha-<commit> images before the release workflow pins the
chart to that sha. Update the CI/CD docs to reflect that a release
now triggers both workflows in parallel instead of describing this as
a known gap.

* docs: update README and ui-development image paths to llm-serving-pack

Follows the repo rename; only the ghcr.io image paths change (the
github.com repo URLs are redirect-handled and left for the repo-rename
cleanup). Go module path untouched.

* ci: pin reusable release workflows to nebari-dev/.github@v1

Now that nebari-dev/.github#43 is merged and tagged v1, pin the caller
refs to the release tag and drop the bring-up TODOs.
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.

1 participant