feat(k3s): idempotent local bring-up, vendored service overlays, and a smoke test - #17
Open
arnoldcastro5000 wants to merge 1 commit into
Open
feat(k3s): idempotent local bring-up, vendored service overlays, and a smoke test#17arnoldcastro5000 wants to merge 1 commit into
arnoldcastro5000 wants to merge 1 commit into
Conversation
…smoke test Harden the local k3d capture->verify backend so a fresh clone can run the whole stack with prepare-linux.sh (or prepare.sh) -> up.sh -> smoke.sh: - up.sh: build gate (build or pull only when the image is absent from the node), a --rebuild flag that also rolls the Deployment, self-heal of unhealthy or stale Deployments, a disk preflight, and idempotent CoreDNS and gateway steps. - Vendor the local-dev kustomize overlays for the capture-pipeline services (treetracker-api, field-data, admin-api, images-api, bulk-pack-transformer-v2, bulk-pack-processor) and the admin-client, with plain local Secrets replacing the base sealed-secrets. Local-dev credentials only. - smoke.sh: a 17-check end-to-end test (cluster, gateway, auth, DB schemas, and a forged bulk-pack row flowing processor -> transformer-v2 -> field-data). - prepare-linux.sh: a Linux host bootstrap that mirrors prepare.sh, including the submodule-branch switching. - Bump treetracker-admin-client to 2.0.0, which the vendored Dockerfile builds. Validated by a full down -> up -> smoke cycle from cold: 17 of 17 (step 8 is an XFAIL by design, the v1 transformer is not deployed).
Author
|
@dadiorchen for your review |
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.
Summary
This makes the local backend easy and reliable to run on your own machine. The
backend runs in a small local Kubernetes cluster (k3d). After this change, a
fresh clone can bring the whole thing up with three commands and check that it
works:
What changed:
k3s/up.shis now safe to run again and again. It only builds an image whenthat image is missing, so a second run takes seconds instead of minutes. It
can heal a half-broken stack, and it warns you before it fills the disk. Use
./k3s/up.sh --rebuildto force a fresh build of one service or all of them.k3s/services/now holds the local setup for each backend service (the"kustomize overlays"): treetracker-api, field-data, admin-api, images-api,
the bulk-pack transformer, the bulk-pack processor, and the admin panel. The
passwords in these files are local-only dummy values (for example
postgres:postgres); there are no real secrets.k3s/smoke.shis a new test. It runs 17 checks end to end: the cluster ishealthy, the gateway answers, admin login works, the database has the right
tables, and a fake tree-capture flows all the way through the pipeline into
the database.
k3s/prepare-linux.shis a new setup script for Linux users. It does the samejob as the macOS
prepare.sh, including pointing the submodules at the rightbranch.
treetracker-admin-clientsubmodule is bumped to 2.0.0, because thelocal admin-panel image is built from that version.
Testing
Ran the full lifecycle from a cold start (no cluster, images built from source):
Result:
up.shfinished with all pods running, andsmoke.shreported17 passed, 0 failed. (Check 8 is a known expected "XFAIL": the old v1
transformer is not deployed, so one processed-flag cannot flip. This is by
design, not a failure.)
A second
./k3s/up.shright after built nothing and changed nothing, whichconfirms it is safe to run repeatedly.
Notes
maincame from earlier PRs. This PR builds on topof it. There are also open k3s PRs (feat: add k3s setup for treetracker #3, feat: one-command e2e harness (k3s/e2e.sh) + drop treetracker-rn #14, feat: deploy wallet app in local k3s #15); happy to coordinate if any
of this overlaps with them.
k3s/README.md(inherited frommain, not changed here)still has some machine-specific and out-of-date content, for example a proxy
section and an old status line. It is worth a separate cleanup pass; I kept
this PR's README change to just the quick-start so the diff stays focused.