Skip to content

chore: add commands to seed cluster dev instance with test data - #320

Open
sabinem wants to merge 2 commits into
mainfrom
chore/just-cluster-recipes
Open

sabinem wants to merge 2 commits into
mainfrom
chore/just-cluster-recipes

Conversation

@sabinem

@sabinem sabinem commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Add just commands to seed, dump and reset the test data on the cluster's dev instance.

The deployed dev instance had no supported way to reset its data:
emptying it meant hand-running kubectl and psql against the cluster,
and the seed binary is not shipped in the backend image.

`just cluster::{backup,wipe,reseed} <context>` does it from a
laptop. Every recipe, including the private _wipe-db, takes the kube
context explicitly and refuses a cluster whose ingress does not
serve hackagon-dev.dscompute.ch; wipe and reseed take a pg_dumpall
first and ask for the context name to be typed back. Only the
`hackagon` database is recreated, so Keycloak and its logins
survive. reseed refuses unless HEAD contains origin/main and
components/backend matches it, since the seed migrates the schema
before writing anything.
@sabinem
sabinem force-pushed the chore/just-cluster-recipes branch from 32d7e6d to 9c5705b Compare October 6, 2026 10:30
reseed now builds the seed and fetches the backend's config and
database password before it confirms, backs up or wipes, so a
compile error or a wrong resource name leaves dev untouched rather
than empty.

_wipe-db no longer restarts the backend behind an
environment flag;  wipe and reseed each bring it back through a named
restore_backend in an EXIT trap.

The backup is written to .partial and renamed only on success, the port-forward wait fails with a message, and the wait for backend pods gives up after two minutes.
@sabinem
sabinem requested a review from marftn October 7, 2026 04:26
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