feat(deploy): catch-all tenant at provision + remove hardcoded tenant ids from pro.yaml#341
Merged
Merged
Conversation
… hardcoded tenant ids from pro.yaml Lifecycle Option A: provision() now generates a fresh catch-all tenant id (uuid.uuid4), sets it on the proxy env as LLMTRACE_DEFAULT_TENANT_ID before the proxy is created, and after the proxy is healthy materialises a "catch-all" tenant row via the idempotent POST /api/v1/tenants path. The id is returned to the caller as TenantInstances.catch_all_tenant_id. Operator tenant id is now caller-owned with no hardcoded fallback: a supplied tenant_uuid is used as the stable id; an empty/absent one triggers a fresh uuid4, which is used, returned as operator_tenant_id, and logged with a WARNING that the identity is ephemeral unless the caller stores and re-passes it. pro.yaml: tenant_uuid default is now empty (no hardcoded UUID) and the LLMTRACE_DEFAULT_TENANT_ID env line is removed (lifecycle sets it, proxy self-provisions if absent). The 6ae1ab34 id no longer appears anywhere.
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.
Removes the hardcoded
6ae1ab34tenant id I should never have baked in, and implements the catch-all (Option A — lifecycle-provided). Pairs with the proxy Option-B fallback PR.Changes
provision()generates a freshuuid.uuid4(), sets it on the proxy env asLLMTRACE_DEFAULT_TENANT_IDbefore the proxy starts, then creates the "catch-all" tenant (idempotent) once healthy. Returned to the caller ascatch_all_tenant_id._resolve_operator_tenant_iduses a caller-suppliedtenant_uuid/LLMTRACE_TENANT_UUIDverbatim (stable identity across recreate); if empty, generates a fresh uuid, returns it, and warns it is ephemeral unless stored + re-passed. No hardcoded fallback.tenant_uuid: "${LLMTRACE_TENANT_UUID:-}"(no default);LLMTRACE_DEFAULT_TENANT_IDline removed.6ae1ab34appears nowhere (guard test enforces this).Tests
6 new (catch-all generated/set/created/returned; no catch-all when auth off; supplied vs empty tenant_uuid; whitespace; pro.yaml 6ae1ab34 guard); persistent-storage test strengthened for the second (catch-all) create.
Verification
py_compile0; pro.yamlyaml.safe_load0.pytest deployments/basilica/tests: +6 new passing vs base; 0 new failures (4 fail / 2 error are pre-existing env issues — basilica SDK shadow + network-sandbox DNS — reproduced identically on base).Note: this is deploy tooling + pro.yaml — it does NOT change the baked proxy image; it takes effect at the next provision. Operator-tenant id value is yours to set via
LLMTRACE_TENANT_UUID.