feat(dev): add lite mode for control-plane-only local stack - #3129
feat(dev): add lite mode for control-plane-only local stack#3129daryllimyt wants to merge 3 commits into
Conversation
|
✅ No security or compliance issues detected. Reviewed everything up to 4bb0620. Security Overview
Detected Code Changes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0693eb602
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Lines 222 to 225 in fa88164
When lite mode starts with a fresh registry or the current platform version, this unconditional startup sync schedules _build_platform_registry_artifact(), which calls blob.ensure_bucket_exists() and uploads to blob storage. Because docker-compose.lite.yml deliberately supplies neither MinIO nor a blob endpoint, the storage client falls back to AWS S3's default credential chain, so the supposedly control-plane-only stack still attempts external storage and may stall or fail in the background. Preserve the database/index portion of platform registry sync for action listing, but suppress its artifact build/upload while lite mode is enabled.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Re the second Codex finding (registry artifact upload attempted in lite mode, review body on Fixed in 4bb0620 with a startup-scoped guard in Verified on a live lite cluster — the warning is gone, replaced by: Registry sync unit tests pass (42 passed). @codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Adds a development-only
liteprofile that runs Tracecat's control plane only — Postgres, API, UI, Caddy — with no Temporal, Redis, MinIO, or worker/executor containers.The full dev stack runs 16 services and takes ~27s to become healthy. Most control-plane work (auth, workspaces, secrets, settings, tables, RBAC, workflow CRUD and the graph editor, registry action listing, cases) needs none of the data plane. This makes that iteration loop cheap.
What actually blocked a data-plane-free boot
Exactly one thing: the five awaited
ensure_bucket_existscalls plusconfigure_bucket_lifecyclein the API lifespan. Without MinIO they raise and the app never finishes startup. Everything else was already fire-and-forget or wrapped.So the change is deliberately narrow:
TRACECAT__LITE_MODEonly skips startup work. It does not touch a single request-time code path.ensure_bucket_existsx5 +configure_bucket_lifecycleadd_temporal_search_attributestaskstart_case_trigger_consumerstart_case_duration_sync_consumerStill runs, since all are Postgres-only:
ensure_default_organization,setup_rbac_defaults,load_platform_catalog_on_startup, and the platform registry sync.Explicitly not done
An earlier draft added a typed
DataPlaneUnavailableexception, a 503 handler, fast-fail guards insideget_temporal_client/get_redis_client/_get_storage_client, and router-level dependencies. That was reverted: those are hot paths, and a dev-only convenience has no business reaching into them.config.pydocuments this so it does not creep back:The one property worth keeping from that draft is preserved with config instead of code. The Temporal client retries connects 10 times with exponential backoff capped at 120s — roughly six minutes of stalling per request against a Temporal that is not deployed.
docker-compose.lite.ymlsetsTEMPORAL__CONNECT_RETRIES: 1so it errors promptly.Why a standalone compose file rather than an overlay or profiles
Neither alternative can cut the
api->temporal/minio/redisdependency edges:-f a.yml -f b.yml):depends_onmerges by union across files, so an overlay can add edges but never remove them.profiles:: Compose auto-enables a profiled service when an active servicedepends_onit, which is the opposite of what is needed.liteis wired in as a fourth profile inget_compose_file(), sologs,ps,db,attach,restart, anddownall work unchanged. The sandbox overlay is skipped for this profile — it only patchesexecutor/agent-executor, and layering it here declares services with neither an image nor a build context, which Compose rejects outright.The stack reuses the
core-dbvolume name, so a cluster slot's data carries over between-p devand-p lite.Verification
Booted for real (
just cluster -p lite up -d):API startup complete0.43s after the lite-mode log line/api/health200 in 12ms; org, workspace, dev users, and default tier all seeded normallyplatform_registry_indexrows with the version promoted, so action listing and the graph editor workruff check/ruff format --checkclean;basedpyright --warnings0 errors, 0 warningsLimitations
TRACECAT__LITE_MODEis intentionally absent from.env.exampleand the other compose files. If it were present-and-falsein a generated.env,${TRACECAT__LITE_MODE:-true}in the lite compose would resolve tofalseand silently disable the profile.deployments/fargate/changes: this is a local development flag, not a deployment knob.Review guide
tracecat/api/app.py— the lifespan guard; the diff is mostly re-indentation of the existing block into anelse:tracecat/config.py— the flag and the note on scopedocker-compose.lite.yml— the five servicesscripts/cluster—liteprofile,TRACECAT__LITE_MODEexport ordering (must land after.envis sourced), seeding,portsoutput, sandbox-overlay skipSummary by cubic
Adds a dev-only lite mode that runs the control plane only for faster local iteration. It skips data‑plane startup work, removes orphaned data‑plane containers on
up, and keeps registry version promotion by skipping artifact build in lite.New Features
docker-compose.lite.ymlwith Postgres, API, UI, Caddy; no Temporal/Redis/MinIO/workers. SetsTEMPORAL__CONNECT_RETRIES=1to fail fast.scripts/clusterwith-p lite; exportsTRACECAT__LITE_MODE=true, seeds by default, skips the sandbox overlay, updates port output, and adds--remove-orphansonup.config.TRACECAT__LITE_MODEand skips bucket provisioning/lifecycle, Temporal search attributes, and Redis consumers.artifact_uri.Migration
just cluster -p lite up -dWritten for commit 4bb0620. Summary will update on new commits.