feat(lab): multi-instance isolation for concurrent stacks#142
Merged
Conversation
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.
Savid
approved these changes
Jun 25, 2026
- 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)
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.
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-cbtorlocalhost:8123/9000/6380), instance-scoped Docker resources, safe lifecycle verbs wheredown/stoppreserve data and onlydestroy/resetremove it (no more unconditional volume teardown or RedisFLUSHALL), and cross-instancelist/status --all/show/stop|destroy --instance. Depends on ethpandaops/xatu-cbt#288 for the--project-nameinfra contract.Breaking (hard cutover): no migration of pre-instance
.xclistate — tear down any existing stack once before upgrading.