fix(config): wire K8s env vars into HiveStack and API server#12
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(config): wire K8s env vars into HiveStack and API server#12cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
HiveConfig.from_env() was never used by hive_api_server.py, so K8s/Helm settings (HIVE_VALIDATE_INPUTS, HIVE_RATE_LIMIT, HIVE_MAX_NODES, HIVE_MAX_CONTENT_BYTES, TTL) had no effect at runtime. - Pass max_memory_nodes to RustBrain.max_nodes - Honor max_content_bytes from config when not overridden - Auto-create RateLimiter when HIVE_RATE_LIMIT > 0 - Accept HIVE_MAX_NODES alias used in deploy manifests - Load HiveConfig.from_env() in the REST API server Regression tests added for env wiring and /route validation. Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
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.
Bug and impact
K8s/Helm deployments set
HIVE_VALIDATE_INPUTS,HIVE_RATE_LIMIT,HIVE_MAX_NODES,HIVE_MAX_CONTENT_BYTES, and TTL env vars, butscripts/hive_api_server.pyconstructedHiveStack()with hardcoded defaults and never calledHiveConfig.from_env().Impact:
HIVE_VALIDATE_INPUTS=truehad no effect — malformed/routepayloads were accepted despite schema validation being "enabled" in the manifestHIVE_RATE_LIMITwas ignored — no rate limiting in productionHIVE_MAX_NODES/ memory caps were ignored —RustBrainalways used the 10k default regardless of operator configHIVE_MAX_CONTENT_BYTESwas ignored — compress DoS limit not applied from envRoot cause
HiveConfigwas introduced for enterprise deployments but only partially wired intoHiveStack(tenant_isolation,default_ttl_s,validate_inputs). The REST API server never loaded config from the environment. K8s manifests also usedHIVE_MAX_NODESwhile the config field maps toHIVE_MAX_MEMORY_NODES.Fix
HiveConfig.from_env()inhive_api_server.pymax_memory_nodes→RustBrain(max_nodes=...)max_content_bytesfrom config when not explicitly overriddenRateLimiterwhenrate_limit > 0HIVE_MAX_NODESas alias formax_memory_nodesValidation