Skip to content

feat(lab): multi-instance isolation for concurrent stacks#142

Merged
samcm merged 2 commits into
masterfrom
feat/multi-instance-isolation
Jun 25, 2026
Merged

feat(lab): multi-instance isolation for concurrent stacks#142
samcm merged 2 commits into
masterfrom
feat/multi-instance-isolation

Conversation

@samcm

@samcm samcm commented Jun 24, 2026

Copy link
Copy Markdown
Member

Makes every xcli lab stack a named, isolated instance so multiple stacks can run concurrently on one host (e.g. from different worktrees) without colliding on ports, Docker resources, or shared state: an authoritative workspace resolver (fixing the wrong-cwd override trap), per-instance manifest/registry with a full port allocator under a global lock (slot 0 keeps today's ports, others are offset), runtime-derived configs (no hard-coded ../xatu-cbt or localhost:8123/9000/6380), instance-scoped Docker resources, safe lifecycle verbs where down/stop preserve data and only destroy/reset remove it (no more unconditional volume teardown or Redis FLUSHALL), and cross-instance list/status --all/show/stop|destroy --instance. Depends on ethpandaops/xatu-cbt#288 for the --project-name infra contract.

Breaking (hard cutover): no migration of pre-instance .xcli state — tear down any existing stack once before upgrading.

Make every xcli lab stack a named, isolated instance so multiple stacks can
run concurrently on one host (e.g. from different worktrees) without colliding
on ports, Docker resources, or shared state.

- Authoritative workspace resolver: one config/overrides/repo-path root,
  resolved upward from the config file; fixes the wrong-cwd override trap.
- Per-instance identity + manifest + registry, with a full port allocator
  (app, infra, metrics, observability, Command Center) under a global lock;
  slot 0 keeps today's familiar ports, additional instances are offset.
- Generated configs derive all paths/ports from the instance runtime
  (no hard-coded ../xatu-cbt or localhost:8123/9000/6380).
- Instance-scoped Docker resources; xatu-cbt infra invoked with
  --project-name + per-instance port env (requires xatu-cbt #288).
- Safe lifecycle verbs: down/stop preserve data; destroy/reset are the only
  data-removing paths. No more unconditional volume teardown or Redis FLUSHALL.
- Cross-instance control: list, status --all (with stale/orphan
  reconciliation), show, and stop/destroy --instance from any directory.

Hard cutover: no migration of pre-instance .xcli state. Tear down any existing
stack once before upgrading.
@samcm samcm requested a review from mattevans as a code owner June 24, 2026 08:58
- Auto-fix wsl_v5/nlreturn/whitespace formatting
- Extract repeated literals to constants (goconst)
- Add nolint directives for internal-arg G204 and config-file G306 (gosec)
- Rename shadowed err vars (govet), drop unused printWorkspaceSelection
- Use comma-ok type assertion (errcheck), preallocate redis args (prealloc)
- Replace deprecated client.IsErrNotFound with cerrdefs.IsNotFound (staticcheck)
- Wrap long JSX line (prettier)
@samcm samcm merged commit 439c961 into master Jun 25, 2026
6 checks passed
@samcm samcm deleted the feat/multi-instance-isolation branch June 25, 2026 03:47
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.

2 participants