fix(kind): pull the published harness image by default (#154) - #164
Merged
Merged
Conversation
setup-kind.sh built the harness image locally on every run, so a first-time quickstart hit the source build path — and any build breakage (e.g. rossoctl#154's non-hermetic codegen, fixed separately in rossoctl#161) blocked install with no workaround beyond --skip-build. Default to pulling the published image (ghcr.io/rossoctl/serverless-harness:latest, a public GHCR package) and loading it into kind, falling back transparently to a local build if the pull is unavailable (offline / image missing). This removes the local Docker build from the first-time path while staying non-regressing: - --build forces a local build (for testing local source changes) - --skip-build reuses a preloaded dev.local tag (unchanged) - --image / SH_IMAGE override the pulled image Image provisioning is extracted into ensure_harness_image() with a SH_SOURCE_ONLY guard so it can be unit-tested without a cluster; the new deploy/knative/tests/setup-kind-image.test.sh mocks docker/kind and asserts the pull / fallback-build / force-build / skip decision paths. The new-Revision build-ts stamp now fires whenever an image is (re)loaded (pull or build), not only on build. Docs (README-kind.md, serverless-harness-demo.md) updated for the new default. Refs rossoctl#154 Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Paolo Dettori <dettori@us.ibm.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.
What
deploy/knative/setup-kind.shnow pulls the published harness image by default and loads it into the kind cluster, instead of building it locally on every run. If the pull is unavailable (offline, or image missing) it transparently falls back to a local build.Why (#154)
Issue #154 reported that a first-time
./deploy/knative/setup-kind.shfailed during the local Docker build. The build failure itself was the non-hermeticpi-forkcodegen and is already fixed onmainby #161 (hermetic build; identical root cause to #160).The second point in #154 — "I didn't expect a first-time quickstart to build the image;
--skip-buildworks around it, should we default to that?" — is what this PR addresses. Rather than default to--skip-build(which requires the user to pre-load an image), the script now does the load for them:flowchart TD S["setup-kind.sh (step 7)"] --> Q{"flag?"} Q -->|"--skip-build"| K["reuse preloaded dev.local tag"] Q -->|"--build"| B["docker build --load → kind load"] Q -->|"default"| P["docker pull ghcr.io/rossoctl/serverless-harness:latest"] P -->|success| T["tag dev.local → kind load"] P -->|"pull unavailable"| BThe published image
ghcr.io/rossoctl/serverless-harness:latestis a public GHCR package (anonymously pullable), so this works for first-time users with no auth. The pull path is also inherently immune to source-build breakage, since it uses a pre-built artifact.Behavior
--build(FORCE_BUILD=1)--skip-builddev.local/serverless-harness:local(unchanged)--image <ref>/SH_IMAGE=<ref>Non-regressing: devs testing local changes use
--build; the new-Revisionbuild-tsstamp now fires whenever an image is (re)loaded (pull or build), not only on build.Tests
Image provisioning is extracted into
ensure_harness_image()behind aSH_SOURCE_ONLYguard so it is unit-testable without a cluster. Newdeploy/knative/tests/setup-kind-image.test.shmocksdocker/kindand asserts the four decision paths (pull-success, pull-fail→build, force-build, skip).shellcheckclean.Docs
README-kind.mdandserverless-harness-demo.mdupdated for the new default and the--buildescape hatch.Follow-up (not in this PR)
build.yamlstill hardcodes the publish target asghcr.io/kagenti/…(currently not anonymously pullable) while the public image lives underghcr.io/rossoctl/…post org-rename. Worth reconciling the publish namespace solateststays fresh — tracked separately.Refs #154
Assisted-By: Claude Code