Open-source inference server and production cluster for all the models your agent needs.
Python bgecolbertdata-pipelinedeep-learningembeddingsinferenceinference-serverinformation-retrievalllmmlmlopsnatural-language-processingnlppythonrerankingretrievalretrieval-augmented-generationsemantic-searchspladevector-search
release: v0.6.1
github-actions[bot]36d564132f71
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e8f0c6adb..9b6d99c51 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,12 @@# Changelog+## v0.6.1++- chore(main): release 0.6.1+- fix(gateway): fail fast on invalid static pool config+- fix(gateway): canonicalize static queue pool names+- feat(gateway): support static queue pools+## v0.6.0- chore(main): release 0.6.0diff --git a/deploy/helm/sie-cluster/Chart.yaml b/deploy/helm/sie-cluster/Chart.yamlindex 2eedfe597..96de85802 100644--- a/deploy/helm/sie-cluster/Chart.yaml+++ b/deploy/helm/sie-cluster/Chart.yaml@@ -4,8 +4,8 @@ description: >-SIE (Search Inference Engine) Kubernetes deployment with gateway, GPU workers,and observabilitytype: application-version: 0.6.0 # x-release-please-version-appVersion: v0.6.0 # x-release-please-version+version: 0.6.1 # x-release-please-version+appVersion: v0.6.1 # x-release-please-versionkeywords:- inference- embeddingdiff --git a/deploy/helm/sie-cluster/README.md b/deploy/helm/sie-cluster/README.mdindex 7f1d1b10d..82a46fb98 100644--- a/deploy/helm/sie-cluster/README.md+++ b/deploy/helm/sie-cluster/README.md@@ -145,9 +145,15 @@ rtx6000 default bundle scales 3–10 — see# Worker pool configuration (must explicitly enable pools)# The map key is the Kubernetes capacity family/resource name. When# machineProfile is omitted, it defaults to that map key. machineProfile is the-# runtime lane label used by routing and metrics. queuePool is the logical queue-# namespace / tenant boundary; when omitted it inherits workers.common.queuePool,-# then falls back to the worker group key.+# runtime lane label used by routing and metrics. queuePool is the logical+# queue namespace / tenant boundary; by default all worker groups use the+# shared `default` queue pool so SDK calls can pass just gpu="<profile>".+# Set queuePool on a worker group only for a dedicated tenant/logical pool,+# then target it explicitly as gpu="<queuePool>/<machineProfile>".+# With poolAdmission enabled, named non-default queue pools must also exist as+# gateway-visible pool objects. For deploy-owned pools, declare them under+# queueRouting.staticQueuePools. For API-owned pools, create/renew them through+# /v1/pools.# Each worker group renders its own StatefulSet + ScaledObject named# worker-<pool>-<bundle>.workers:@@ -178,6 +184,48 @@ autoscaling:cooldownPeriod: 600 # 10 min before scale-down```+### Queue Pool Patterns++Use one of these patterns deliberately:++- **Shared baseline pool**: leave `workers.common.queuePool: default`.+ Workers render with `SIE_POOL=default` and their own+ `SIE_MACHINE_PROFILE`; SDK calls use `gpu="<machineProfile>"`.+- **Static custom queue namespace**: set a worker group's `queuePool` to a+ named value and declare the same name under+ `queueRouting.staticQueuePools`. These pool objects are synthesized by the+ gateway at startup and do not expire. Example:++ ```yaml+ queueRouting:+ staticQueuePools:+ companyA:+ gpus:+ l4: 0+ gpuCaps: {}+ workers:+ pools:+ l4:+ queuePool: companyA+ ```++ `gpuCaps: {}` means uncapped admission for matching workers. Use+ `gpuCaps: {l4: 10}` to cap admission for that machine profile.+- **Dynamic isolated pool**: set a worker group's `queuePool` to the dedicated+ pool name, keep `queueRouting.poolAdmission.enabled=true`, and create/renew+ the matching pool through `/v1/pools`. SDK calls use+ `gpu="<queuePool>/<machineProfile>"`.++Missing named pools intentionally do not fail open. Falling back from+`pool=default,machineProfile=l4` to `pool=l4,machineProfile=l4` would cross the+logical capacity boundary without an explicit caller request.++For emergency or legacy static namespaces that are not backed by either+`queueRouting.staticQueuePools` or `/v1/pools`, disabling+`queueRouting.poolAdmission.enabled` lets workers pull without the admission+gate. Prefer declaring static pools instead, so capped/dynamic pools keep their+fail-closed isolation behavior.+### Upgrading from the legacy single-bundle pool schemaReleases up to and including 0.4.x used a flat schema where each pooldiff --git a/deploy/helm/sie-cluster/templates/gateway-deployment.yaml b/deploy/helm/sie-cluster/templates/gateway-deployment.yamlindex 1039c55c7..07188ec4c 100644--- a/deploy/helm/sie-cluster/templates/gateway-deployment.yaml+++ b/deploy/helm/sie-cluster/templates/gateway-deployment.yaml@@ -210,6 +210,10 @@ spec:{{- with .Values.queueRouting }}- name: SIE_STREAM_MAX_AGE_Svalue: {{ .streamMaxAgeSec | default 120 | quote }}+ {{- with .staticQueuePools }}+ - name: SIE_GATEWAY_STATIC_QUEUE_POOLS+ value: {{ toJson . | quote }}+ {{- end }}{{- end }}{{- if .Values.config.enabled }}# URL of the sie-config control plane. The gateway uses it fordiff --git a/deploy/helm/sie-cluster/templates/keda-scaledobject.yaml b/deploy/helm/sie-cluster/templates/keda-scaledobject.yamlindex 92b7af47f..3bdc7b983 100644--- a/deploy/helm/sie-cluster/templates/keda-scaledobject.yaml+++ b/deploy/helm/sie-cluster/templates/keda-scaledobject.yaml@@ -80,7 +80,7 @@ data:{{- range $poolName, $pool := .Values.workers.pools }}{{- if $pool.enabled }}{{- $machineProfile := default $poolName $pool.machineProfile }}-{{- $queuePool := default (default $poolName $root.Values.workers.common.queuePool) $pool.queuePool }}+{{- $queuePool := default (default "default" $root.Values.workers.common.queuePool) $pool.queuePool }}{{- range $bundleName, $bundleCfg := $pool.bundles }}{{- if dig "enabled" true $bundleCfg }}{{- $bundle := $bundleName }}diff --git a/deploy/helm/sie-cluster/templates/worker-statefulset.yaml b/deploy/helm/sie-cluster/templates/worker-statefulset.yamlindex 763ffe4f7..a23f8a906 100644--- a/deploy/helm/sie-cluster/templates/worker-statefulset.yaml+++ b/deploy/helm/sie-cluster/templates/worker-statefulset.yaml@@ -23,7 +23,7 @@ fast at render time.{{- end }}{{- $platform := default $root.Values.workers.common.platform $pool.platform }}{{- $machineProfile := default $poolName $pool.machineProfile }}-{{- $queuePool := default (default $poolName $root.Values.workers.common.queuePool) $pool.queuePool }}+{{- $queuePool := default (default "default" $root.Values.workers.common.queuePool) $pool.queuePool }}{{- range $bundleName, $bundleCfg := $pool.bundles }}{{- if dig "enabled" true $bundleCfg }}{{- if not (hasKey $bundleCfg "minReplicas") }}diff --git a/deploy/helm/sie-cluster/values.yaml b/deploy/helm/sie-cluster/values.yamlindex 3c20dff2e..cd5d7215f 100644--- a/deploy/helm/sie-cluster/values.yaml+++ b/deploy/helm/sie-cluster/values.yaml@@ -340,16 +340,16 @@ workers:passthroughMode: true# -- Logical queue pool consumed by workers in queue-routing mode.- # When unset (the default), each pool uses its own name as the queue- # pool, so a worker in `workers.pools.rtx6000` subscribes to- # `sie.work.rtx6000.rtx6000.default.*` for the default bundle,- # preventing the cross-pool durable-consumer collision that happens- # when every pool shares one queue. Set this- # to a fixed string (e.g. `"default"`) only to deliberately share a- # queue across multiple pools (e.g. `l4` + `l4-spot` competing for- # the same work). Per-pool overrides via `workers.pools.<name>.queuePool`- # take precedence over both.- queuePool: ""+ # The default baseline queue pool is `default`, so SDK calls like+ # `gpu="l4"` route to `(pool=default, machineProfile=l4)` without+ # requiring callers to spell the pool as `gpu="default/l4"`.+ # Routing, metrics, and KEDA still stay lane-specific because the+ # NATS subject and Prometheus labels include machineProfile and bundle.+ # Set per-pool `workers.pools.<name>.queuePool` only when a worker group+ # should consume from a dedicated logical queue namespace / tenant pool+ # such as `customer-acme`, in which case callers must send that pool+ # explicitly (SDK `gpu="customer-acme/l4"`).+ queuePool: default# -- Runtime class for workers (e.g., "nvidia" to enable GPU runtime)runtimeClassName: ""@@ -599,7 +599,7 @@ workers:# (e.g. `<repo>:<tag>-cpu-<bundle>`),# NOT propagated to a pod env var.# queuePool: string. Optional override of common.queuePool.- # If both are unset, defaults to the worker group key.+ # Defaults to `default` via workers.common.queuePool.# resources: requests/limits for the Python ``worker``# container (the GPU-bound forward-pass server).# runtimeClassName: Optional override of common.runtimeClassName.@@ -1058,6 +1058,20 @@ queueRouting:# -- Maximum age (seconds) for messages in the pool-level stream.# Messages older than this are discarded. Set higher for slow model loads.streamMaxAgeSec: 120+ # -- Non-expiring pool objects synthesized by the gateway for Helm-declared+ # queue namespaces. Keys are queue pool names. Use this when+ # poolAdmission.enabled=true and a worker group sets a named non-default+ # workers.pools.<name>.queuePool but the pool is static/deploy-owned rather+ # than created through the expiring /v1/pools API.+ #+ # Example:+ # staticQueuePools:+ # companyA:+ # gpus:+ # l4: 0+ # gpuCaps: {}+ # minimumWorkerCount: 0+ staticQueuePools: {}# -- NATS fetch budget: max messages pulled per fetch() call.# This is the primary driver of GPU batch size in queue mode; the worker# groups fetched messages by model and dispatches them as a single forward pass.@@ -1065,6 +1079,11 @@ queueRouting:natsFetchBudget: 64# -- Worker admission gate for capped pools. Workers ask the gateway whether# their pod is in the pool's assigned_workers before pulling from NATS.+ # The baseline `default` pool fails open. Named non-default queue pools are+ # runtime pool/admission boundaries: if you set `workers.pools.<name>.queuePool`+ # to a custom value without declaring the matching `staticQueuePools` entry+ # or creating the matching `/v1/pools/<queuePool>` object, workers will pause+ # instead of pulling.poolAdmission:enabled: truecheckIntervalSec: 10diff --git a/integrations/sie_chroma/pyproject.toml b/integrations/sie_chroma/pyproject.tomlindex 9083912e3..18ef55205 100644--- a/integrations/sie_chroma/pyproject.toml+++ b/integrations/sie_chroma/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-chroma"-version = "0.6.0"+version = "0.6.1"description = "SIE integration for ChromaDB"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_crewai/pyproject.toml b/integrations/sie_crewai/pyproject.tomlindex 8b6490f78..1090dbf8b 100644--- a/integrations/sie_crewai/pyproject.toml+++ b/integrations/sie_crewai/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-crewai"-version = "0.6.0"+version = "0.6.1"description = "SIE integration for CrewAI"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_dspy/pyproject.toml b/integrations/sie_dspy/pyproject.tomlindex d83133cb7..ff4da775c 100644--- a/integrations/sie_dspy/pyproject.toml+++ b/integrations/sie_dspy/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-dspy"-version = "0.6.0"+version = "0.6.1"description = "SIE integration for DSPy"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_haystack/pyproject.toml b/integrations/sie_haystack/pyproject.tomlindex e55bdc12a..d623b352f 100644--- a/integrations/sie_haystack/pyproject.toml+++ b/integrations/sie_haystack/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-haystack"-version = "0.6.0"+version = "0.6.1"description = "SIE integration for Haystack"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_lancedb/pyproject.toml b/integrations/sie_lancedb/pyproject.tomlindex ddc1b2a58..f29e7cf97 100644--- a/integrations/sie_lancedb/pyproject.toml+++ b/integrations/sie_lancedb/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-lancedb"-version = "0.6.0"+version = "0.6.1"description = "SIE integration for LanceDB"requires-python = ">=3.12"dependencies = [diff --git a/integrations/sie_langchain/pyproject.toml b/integrations/sie_langchain/pyproject.tomlindex 27e9c7f63..401778fa9 100644--- a/integrations/sie_langchain/pyproject.toml+++ b/integrations/sie_langchain/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-langchain"-version = "0.6.0"+version = "0.6.1"description = "SIE integration for LangChain"requires-python = ">=3.10"dependencies = [diff --git a/integrations/sie_llamaindex/pyproject.toml b/integrations/sie_llamaindex/pyproject.tomlindex d9bc28b53..78ca1f820 100644--- a/integrations/sie_llamaindex/pyproject.toml+++ b/integrations/sie_llamaindex/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-llamaindex"-version = "0.6.0"+version = "0.6.1"description = "SIE integration for LlamaIndex"requires-python = ">=3.10"dependencies = [diff --git a/integrations/sie_qdrant/pyproject.toml b/integrations/sie_qdrant/pyproject.tomlindex 67a69bf08..276485780 100644--- a/integrations/sie_qdrant/pyproject.toml+++ b/integrations/sie_qdrant/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-qdrant"-version = "0.6.0"+version = "0.6.1"description = "SIE integration for Qdrant"readme = "README.md"requires-python = ">=3.10"diff --git a/integrations/sie_ts_chroma/package.json b/integrations/sie_ts_chroma/package.jsonindex 788099cb1..6f23101dd 100644--- a/integrations/sie_ts_chroma/package.json+++ b/integrations/sie_ts_chroma/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-chroma",- "version": "0.6.0",+ "version": "0.6.1","description": "SIE embedding function for ChromaDB","type": "module","main": "./dist/index.cjs",diff --git a/integrations/sie_ts_lancedb/package.json b/integrations/sie_ts_lancedb/package.jsonindex 14b76f5d7..c9e36e8ee 100644--- a/integrations/sie_ts_lancedb/package.json+++ b/integrations/sie_ts_lancedb/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-lancedb",- "version": "0.6.0",+ "version": "0.6.1","description": "SIE embedding function and reranker for LanceDB","type": "module","main": "./dist/index.cjs",diff --git a/integrations/sie_ts_langchain/package.json b/integrations/sie_ts_langchain/package.jsonindex 9b438caf6..b833db149 100644--- a/integrations/sie_ts_langchain/package.json+++ b/integrations/sie_ts_langchain/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-langchain",- "version": "0.6.0",+ "version": "0.6.1","description": "SIE embeddings integration for LangChain.js","type": "module","main": "./dist/index.cjs",diff --git a/integrations/sie_ts_llamaindex/package.json b/integrations/sie_ts_llamaindex/package.jsonindex 33ded824b..4691239d9 100644--- a/integrations/sie_ts_llamaindex/package.json+++ b/integrations/sie_ts_llamaindex/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-llamaindex",- "version": "0.6.0",+ "version": "0.6.1","description": "SIE embeddings integration for LlamaIndex.TS","type": "module","main": "./dist/index.cjs",diff --git a/integrations/sie_weaviate/pyproject.toml b/integrations/sie_weaviate/pyproject.tomlindex ad3367e12..43b552c2b 100644--- a/integrations/sie_weaviate/pyproject.toml+++ b/integrations/sie_weaviate/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-weaviate"-version = "0.6.0"+version = "0.6.1"description = "SIE integration for Weaviate"readme = "README.md"requires-python = ">=3.10"diff --git a/packages/sie_gateway/Cargo.lock b/packages/sie_gateway/Cargo.lockindex ac685854f..c8231d89d 100644--- a/packages/sie_gateway/Cargo.lock+++ b/packages/sie_gateway/Cargo.lock@@ -2959,7 +2959,7 @@ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"[[package]]name = "sie-gateway"-version = "0.6.0"+version = "0.6.1"dependencies = ["arc-swap","async-nats",diff --git a/packages/sie_gateway/Cargo.toml b/packages/sie_gateway/Cargo.tomlindex e00068cb1..21622d26c 100644--- a/packages/sie_gateway/Cargo.toml+++ b/packages/sie_gateway/Cargo.toml@@ -1,6 +1,6 @@[package]name = "sie-gateway"-version = "0.6.0"+version = "0.6.1"edition = "2021"publish = falsediff --git a/packages/sie_gateway/docs/architecture-guide.md b/packages/sie_gateway/docs/architecture-guide.mdindex 8337d70a3..53ee78d8c 100644--- a/packages/sie_gateway/docs/architecture-guide.md+++ b/packages/sie_gateway/docs/architecture-guide.md@@ -721,10 +721,10 @@ POST /v1/pools`gpus` is required capacity; `gpu_caps` is an optional assignment cap. `bundle` is an optional assignment filter: when omitted, the logical pool may span multiple worker bundles and `status.assigned_workers[]` records each worker's actual bundle so `active_lease_gpus` can stay lane-aware. The `default` pool has zero requirements and no caps. The worker-sidecar polls pool status every 10 seconds before NATS pulls when the admission gate is enabled. Capped named pools fail closed unless this pod appears in `status.assigned_workers`; the `default` pool fails open during transient gateway/status errors so baseline capacity remains available. HA gateways sort workers deterministically and persist named-pool assignment status.-Helm publishes canonical machine profiles in `SIE_GATEWAY_CONFIGURED_GPUS` and request aliases in `SIE_GATEWAY_GPU_ALIASES`.+Helm publishes canonical machine profiles in `SIE_GATEWAY_CONFIGURED_GPUS`, request aliases in `SIE_GATEWAY_GPU_ALIASES`, and optional deploy-owned static queue pools in `SIE_GATEWAY_STATIC_QUEUE_POOLS`.-Each pool gets its own JetStream stream (`WORK_POOL_{name}`) with subjects `sie.work.{name}.*.*.*`. Workers are deployed with `SIE_POOL={name}`, `SIE_MACHINE_PROFILE={profile}`, and `SIE_BUNDLE={bundle}`; they consume only from their concrete `sie.work.{name}.{profile}.{bundle}.*` lane. The pool is the tenant/logical-capacity boundary; machine profile and bundle are the runtime lane inside that pool. A cold `X-SIE-POOL` request without `X-SIE-MACHINE-PROFILE` can emit lane-specific `pending_demand` only when the registered pool spec contains exactly one machine profile; multi-profile pools require the caller to send the profile because the gateway must not guess which StatefulSet KEDA should scale.+Each pool gets its own JetStream stream (`WORK_POOL_{name}`) with subjects `sie.work.{name}.*.*.*`. Workers are deployed with `SIE_POOL={name}`, `SIE_MACHINE_PROFILE={profile}`, and `SIE_BUNDLE={bundle}`; they consume only from their concrete `sie.work.{name}.{profile}.{bundle}.*` lane. The pool is the tenant/logical-capacity boundary; machine profile and bundle are the runtime lane inside that pool. Helm's baseline default puts enabled worker groups in `SIE_POOL=default`, so SDK calls can pass just the machine profile (`gpu="l4"`) for shared-cluster capacity. Dedicated pool deployments override `queuePool` and require callers to name the pool explicitly, for example `gpu="customer-acme/l4"`. A cold `X-SIE-POOL` request without `X-SIE-MACHINE-PROFILE` can emit lane-specific `pending_demand` only when the registered pool spec contains exactly one machine profile; multi-profile pools require the caller to send the profile because the gateway must not guess which StatefulSet KEDA should scale.-Creating a usable custom pool is a two-step operation: add the pool to Helm values so a `StatefulSet` of workers actually exists with `queuePool`/`SIE_POOL` set to the logical pool name, then register the pool on the gateway via `POST /v1/pools` so it tracks fulfillment and admission. Clients then target the pool with an `X-SIE-POOL: customer-acme` header. Pools expire after their TTL unless renewed with `POST /v1/pools/{name}/renew`; the `default` pool is protected and cannot be deleted.+Creating a usable custom pool has two supported shapes. For deploy-owned static pools, add the worker group to Helm values with `queuePool`/`SIE_POOL` set to the logical pool name and declare the same name under `queueRouting.staticQueuePools`; the gateway synthesizes a non-expiring pool object at startup for sidecar admission. For dynamic/lease-owned pools, add the worker group to Helm values and then register or renew the pool through `POST /v1/pools`; those pools expire after their TTL unless renewed with `POST /v1/pools/{name}/renew`. Clients target either shape with an explicit `X-SIE-POOL` header, for example `X-SIE-POOL: customer-acme`, or SDK `gpu="customer-acme/l4"`. The `default` pool is protected and cannot be deleted. Missing named pools intentionally fail closed so capped/dynamic pool isolation is not weakened by a silent fallback.Model configs registered via the control plane (`sie-config`) are not tied to a pool — they describe what the cluster can serve, not who gets to serve it. Pool membership, worker counts, and GPU types are Helm-driven and independent of the config API.diff --git a/packages/sie_gateway/openapi.json b/packages/sie_gateway/openapi.jsonindex 67a1f38c6..834d487d2 100644--- a/packages/sie_gateway/openapi.json+++ b/packages/sie_gateway/openapi.json@@ -2890,7 +2890,7 @@"url": "https://www.apache.org/licenses/LICENSE-2.0.html"},"title": "SIE Gateway",- "version": "0.6.0"+ "version": "0.6.1"},"openapi": "3.1.0","paths": {diff --git a/packages/sie_gateway/src/config.rs b/packages/sie_gateway/src/config.rsindex 90ff6ae30..5be02a54a 100644--- a/packages/sie_gateway/src/config.rs+++ b/packages/sie_gateway/src/config.rs@@ -1,6 +1,10 @@use std::collections::HashMap;use std::env;+use serde::Deserialize;++use crate::types::pool::PoolSpec;+#[derive(Debug, Clone)]pub struct Config {// Server@@ -61,6 +65,10 @@ pub struct Config {// Pre-computed lowercase→original map for GPU profile resolution (avoids HashMap rebuild per request)pub gpu_profile_map: HashMap<String, String>,+ // Helm-declared queue pools that are long-lived admission boundaries.+ // API-created pools remain lease-based; these specs do not expire.+ pub static_queue_pools: Vec<PoolSpec>,+// Job/friendly model aliases: lowercase alias → canonical model id. Lets a// caller request `model: "code"` and have it resolve to the recommended// model before the registry lookup. Ships with built-in defaults (see@@ -141,6 +149,61 @@ fn env_json_string_map(key: &str) -> HashMap<String, String> {}}+#[derive(Debug, Deserialize)]+#[serde(rename_all = "camelCase")]+struct StaticQueuePoolEnvSpec {+ #[serde(default)]+ bundle: Option<String>,+ #[serde(default)]+ gpus: HashMap<String, u32>,+ #[serde(default, alias = "gpu_caps")]+ gpu_caps: HashMap<String, u32>,+ #[serde(default, alias = "minimum_worker_count")]+ minimum_worker_count: u32,+}++fn env_static_queue_pools(key: &str) -> Vec<PoolSpec> {+ let parsed = match env::var(key) {+ Ok(s) if !s.trim().is_empty() => {+ match serde_json::from_str::<HashMap<String, StaticQueuePoolEnvSpec>>(&s) {+ Ok(parsed) => parsed,+ Err(error) => {+ panic!("failed to parse {key}: {error}; fix or unset {key}")+ }+ }+ }+ _ => HashMap::new(),+ };++ let mut specs: Vec<PoolSpec> = parsed+ .into_iter()+ .filter_map(|(name, spec)| {+ let name = name.trim().to_string();+ if name.is_empty() {+ return None;+ }+ let bundle = spec.bundle.and_then(|bundle| {+ let bundle = bundle.trim().to_string();+ if bundle.is_empty() {+ None+ } else {+ Some(bundle)+ }+ });+ Some(PoolSpec {+ name,+ bundle,+ gpus: spec.gpus,+ gpu_caps: spec.gpu_caps,+ ttl_seconds: None,+ minimum_worker_count: spec.minimum_worker_count,+ })+ })+ .collect();+ specs.sort_by(|a, b| a.name.cmp(&b.name));+ specs+}+/// Job/friendly model aliases: lowercase alias → model id (or `bundle:/model`).////// Ships with built-in defaults so `model="code"` works without operator@@ -277,6 +340,7 @@ impl Config {configured_gpus,gpu_profile_map,+ static_queue_pools: env_static_queue_pools("SIE_GATEWAY_STATIC_QUEUE_POOLS"),model_aliases,bundles_dir: env_default("SIE_BUNDLES_DIR", "bundles"),@@ -557,6 +621,60 @@ mod tests {});}+ #[test]+ fn test_env_static_queue_pools_accepts_helm_shape() {+ with_env(+ &[(+ "_TEST_STATIC_QUEUE_POOLS",+ r#"{+ "companyA": {+ "gpus": {"l4": 0},+ "gpuCaps": {},+ "minimumWorkerCount": 1+ },+ "companyB": {+ "bundle": "sglang",+ "gpus": {"a100": 1},+ "gpu_caps": {"a100": 2},+ "minimum_worker_count": 2+ }+ }"#,+ )],+ || {+ let result = env_static_queue_pools("_TEST_STATIC_QUEUE_POOLS");++ assert_eq!(result.len(), 2);+ assert_eq!(result[0].name, "companyA");+ assert_eq!(result[0].gpus.get("l4"), Some(&0));+ assert!(result[0].gpu_caps.is_empty());+ assert_eq!(result[0].minimum_worker_count, 1);+ assert_eq!(result[0].ttl_seconds, None);++ assert_eq!(result[1].name, "companyB");+ assert_eq!(result[1].bundle.as_deref(), Some("sglang"));+ assert_eq!(result[1].gpus.get("a100"), Some(&1));+ assert_eq!(result[1].gpu_caps.get("a100"), Some(&2));+ assert_eq!(result[1].minimum_worker_count, 2);+ },+ );+ }++ #[test]+ fn test_env_static_queue_pools_invalid_panics() {+ with_env(&[("_TEST_STATIC_QUEUE_POOLS", "not-json")], || {+ let result = std::panic::catch_unwind(|| {+ let _ = env_static_queue_pools("_TEST_STATIC_QUEUE_POOLS");+ });+ let panic = result.expect_err("invalid static queue pool JSON must fail fast");+ let message = panic+ .downcast_ref::<String>()+ .map(String::as_str)+ .or_else(|| panic.downcast_ref::<&str>().copied())+ .unwrap_or("");+ assert!(message.contains("failed to parse _TEST_STATIC_QUEUE_POOLS"));+ });+ }+#[test]fn test_build_gpu_profile_map_preserves_canonical_and_aliases() {let mut aliases = HashMap::new();@@ -811,6 +929,7 @@ mod tests {stream_max_age_s: 0,configured_gpus: Vec::new(),gpu_profile_map: HashMap::new(),+ static_queue_pools: Vec::new(),model_aliases: HashMap::new(),bundles_dir: String::new(),models_dir: String::new(),diff --git a/packages/sie_gateway/src/handlers/config_api.rs b/packages/sie_gateway/src/handlers/config_api.rsindex f8ebbf18a..e3c1c60c8 100644--- a/packages/sie_gateway/src/handlers/config_api.rs+++ b/packages/sie_gateway/src/handlers/config_api.rs@@ -459,6 +459,7 @@ mod tests {stream_max_age_s: 120,configured_gpus: Vec::new(),gpu_profile_map: HashMap::new(),+ static_queue_pools: Vec::new(),model_aliases: HashMap::new(),bundles_dir: bundles_dir.to_string(),models_dir: models_dir.to_string(),diff --git a/packages/sie_gateway/src/handlers/models.rs b/packages/sie_gateway/src/handlers/models.rsindex 4155e49b8..1ac8e5e11 100644--- a/packages/sie_gateway/src/handlers/models.rs+++ b/packages/sie_gateway/src/handlers/models.rs@@ -348,6 +348,7 @@ mod route_tests {stream_max_age_s: 120,configured_gpus: Vec::new(),gpu_profile_map: HashMap::new(),+ static_queue_pools: Vec::new(),model_aliases: HashMap::new(),bundles_dir: bundles_dir.to_string(),models_dir: models_dir.to_string(),diff --git a/packages/sie_gateway/src/handlers/proxy.rs b/packages/sie_gateway/src/handlers/proxy.rsindex f0142d9f3..6a963c242 100644--- a/packages/sie_gateway/src/handlers/proxy.rs+++ b/packages/sie_gateway/src/handlers/proxy.rs@@ -9378,6 +9378,7 @@ mod tests {stream_max_age_s: 300,configured_gpus: vec!["l4".to_string()],gpu_profile_map,+ static_queue_pools: Vec::new(),model_aliases: std::collections::HashMap::new(),bundles_dir: bundles_dir.path().to_string_lossy().to_string(),models_dir: models_dir.path().to_string_lossy().to_string(),diff --git a/packages/sie_gateway/src/main.rs b/packages/sie_gateway/src/main.rsindex 6cf889d09..b83503721 100644--- a/packages/sie_gateway/src/main.rs+++ b/packages/sie_gateway/src/main.rs@@ -393,6 +393,20 @@ async fn run_server(cfg: Config) -> Result<(), Box<dyn std::error::Error>> {if pools_enabled {pool_manager.create_default_pool().await;+ if !config.static_queue_pools.is_empty() {+ match pool_manager+ .sync_static_pools(&config.static_queue_pools)+ .await+ {+ Ok(count) if count > 0 => {+ info!(count = count, "synced static Helm queue pools");+ }+ Ok(_) => {}+ Err(e) => {+ return Err(e);+ }+ }+ }// Restore pools from K8s backend on startupmatch pool_manager.restore_from_k8s().await {Ok(count) if count > 0 => {diff --git a/packages/sie_gateway/src/middleware/auth.rs b/packages/sie_gateway/src/middleware/auth.rsindex ba01f470e..398700be1 100644--- a/packages/sie_gateway/src/middleware/auth.rs+++ b/packages/sie_gateway/src/middleware/auth.rs@@ -347,6 +347,7 @@ mod tests {stream_max_age_s: 0,configured_gpus: Vec::new(),gpu_profile_map: HashMap::new(),+ static_queue_pools: Vec::new(),model_aliases: HashMap::new(),bundles_dir: String::new(),models_dir: String::new(),diff --git a/packages/sie_gateway/src/state/pool_manager.rs b/packages/sie_gateway/src/state/pool_manager.rsindex 75d4aa250..aa40f885e 100644--- a/packages/sie_gateway/src/state/pool_manager.rs+++ b/packages/sie_gateway/src/state/pool_manager.rs@@ -14,15 +14,25 @@ const TIMESTAMP_TOLERANCE_S: f64 = 0.001;type WorkerAssignment = (String, String, String, String, String);#[derive(Debug)]-pub struct DefaultPoolProtectedError;+pub enum PoolDeletionProtectedError {+ Default,+ Static(String),+}-impl std::fmt::Display for DefaultPoolProtectedError {+impl std::fmt::Display for PoolDeletionProtectedError {fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {- write!(f, "Cannot delete the default pool '{}'", DEFAULT_POOL_NAME)+ match self {+ PoolDeletionProtectedError::Default => {+ write!(f, "Cannot delete the default pool '{}'", DEFAULT_POOL_NAME)+ }+ PoolDeletionProtectedError::Static(name) => {+ write!(f, "Cannot delete static Helm queue pool '{}'", name)+ }+ }}}-impl std::error::Error for DefaultPoolProtectedError {}+impl std::error::Error for PoolDeletionProtectedError {}#[derive(Debug)]pub struct DefaultPoolMutationError;@@ -35,6 +45,19 @@ impl std::fmt::Display for DefaultPoolMutationError {impl std::error::Error for DefaultPoolMutationError {}+#[derive(Debug)]+pub struct StaticPoolMutationError {+ pub name: String,+}++impl std::fmt::Display for StaticPoolMutationError {+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {+ write!(f, "Cannot modify static Helm queue pool '{}'", self.name)+ }+}++impl std::error::Error for StaticPoolMutationError {}+#[derive(Debug)]pub struct InvalidMachineProfileError {pub invalid_profiles: Vec<String>,@@ -63,6 +86,7 @@ pub struct PoolManager {pools: RwLock<HashMap<String, Pool>>,lease_duration_s: f64,configured_profiles: Vec<String>,+ static_pool_names: RwLock<HashSet<String>>,/// Optional K8s ConfigMap backend for pool persistence.k8s_backend: Option<Arc<K8sPoolBackend>>,}@@ -73,6 +97,7 @@ impl PoolManager {pools: RwLock::new(HashMap::new()),lease_duration_s: DEFAULT_LEASE_DURATION_S,configured_profiles,+ static_pool_names: RwLock::new(HashSet::new()),k8s_backend: None,}}@@ -92,12 +117,16 @@ impl PoolManager {};let k8s_pools = backend.list_pools().await?;+ let static_pool_names = self.static_pool_names.read().await.clone();let mut pools = self.pools.write().await;let mut count = 0;for pool in k8s_pools {if !Self::should_restore_pool_from_k8s(&pool) {continue;}+ if static_pool_names.contains(&normalize_pool_name(&pool.spec.name)) {+ continue;+ }if !pools.contains_key(&pool.spec.name) {info!(pool = %pool.spec.name, "restored pool from K8s");pools.insert(pool.spec.name.clone(), pool);@@ -126,6 +155,186 @@ impl PoolManager {.unwrap_or((DEFAULT_LEASE_DURATION_S as u64).min(i32::MAX as u64) as i32)}+ fn normalize_gpus_and_caps(+ mut gpus: HashMap<String, u32>,+ gpu_caps: &HashMap<String, u32>,+ ) -> HashMap<String, u32> {+ for gpu_type in gpu_caps.keys() {+ if !gpus+ .keys()+ .any(|required_gpu| required_gpu.eq_ignore_ascii_case(gpu_type))+ {+ gpus.insert(gpu_type.clone(), 0);+ }+ }+ gpus+ }++ fn validate_pool_profiles(+ &self,+ gpus: &HashMap<String, u32>,+ gpu_caps: &HashMap<String, u32>,+ ) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {+ if self.configured_profiles.is_empty() {+ return Ok(());+ }++ let invalid: Vec<String> = gpus+ .keys()+ .chain(gpu_caps.keys())+ .filter(|k| {+ !self+ .configured_profiles+ .iter()+ .any(|p| p.eq_ignore_ascii_case(k))+ })+ .cloned()+ .collect();++ if invalid.is_empty() {+ Ok(())+ } else {+ Err(Box::new(InvalidMachineProfileError {+ invalid_profiles: invalid,+ valid_profiles: self.configured_profiles.clone(),+ }))+ }+ }++ async fn is_static_pool(&self, name: &str) -> bool {+ self.static_pool_names+ .read()+ .await+ .contains(&normalize_pool_name(name))+ }++ pub async fn sync_static_pools(+ &self,+ specs: &[PoolSpec],+ ) -> Result<usize, Box<dyn std::error::Error + Send + Sync>> {+ let mut normalized_specs = Vec::new();+ let mut desired_names = HashSet::new();+ for spec in specs {+ let name = normalize_pool_name(&spec.name);+ if name.is_empty() || name == DEFAULT_POOL_NAME {+ continue;+ }++ let gpus = Self::normalize_gpus_and_caps(spec.gpus.clone(), &spec.gpu_caps);+ self.validate_pool_profiles(&gpus, &spec.gpu_caps)?;+ let bundle = spec.bundle.as_ref().and_then(|bundle| {+ let bundle = bundle.trim().to_string();+ if bundle.is_empty() {+ None+ } else {+ Some(bundle)+ }+ });+ let static_spec = PoolSpec {+ name: name.clone(),+ bundle,+ gpus,+ gpu_caps: spec.gpu_caps.clone(),+ ttl_seconds: None,+ minimum_worker_count: spec.minimum_worker_count,+ };+ if !desired_names.insert(static_spec.name.clone()) {+ return Err(format!("duplicate static queue pool '{}'", name).into());+ }+ normalized_specs.push(static_spec);+ }+ normalized_specs.sort_by(|a, b| a.name.cmp(&b.name));++ let previous_names = {+ let mut static_pool_names = self.static_pool_names.write().await;+ let previous_names = static_pool_names.clone();+ *static_pool_names = desired_names.clone();+ previous_names+ };++ let now = Self::now_secs();+ let mut pools = self.pools.write().await;+ for name in previous_names.difference(&desired_names) {+ if pools.remove(name).is_some() {+ info!(pool = %name, "removed static Helm queue pool");+ }+ }+ let shadowed_names: Vec<String> = pools+ .keys()+ .filter(|name| {+ let normalized = normalize_pool_name(name);+ desired_names.contains(&normalized) && **name != normalized+ })+ .cloned()+ .collect();+ for name in &shadowed_names {+ if pools.remove(name).is_some() {+ info!(+ pool = %name,+ static_pool = %normalize_pool_name(name),+ "removed case-variant pool shadowed by static Helm queue pool"+ );+ }+ }++ let mut count = 0;+ for spec in normalized_specs {+ count += 1;+ if let Some(existing) = pools.get_mut(&spec.name) {+ if existing.spec != spec {+ existing.spec = spec;+ existing.status.state = PoolState::Pending;+ existing.status.assigned_workers.clear();+ existing.status.last_renewed = now;+ info!(pool = %existing.spec.name, "updated static Helm queue pool");+ crate::metrics::POOL_EVENTS+ .with_label_values(&["updated"])+ .inc();+ } else {+ existing.status.last_renewed = now;+ crate::metrics::POOL_EVENTS+ .with_label_values(&["renewed"])+ .inc();+ }+ continue;+ }++ let name = spec.name.clone();+ pools.insert(+ name.clone(),+ Pool {+ spec,+ status: PoolStatus {+ state: PoolState::Pending,+ assigned_workers: Vec::new(),+ created_at: now,+ last_renewed: now,+ },+ },+ );+ info!(pool = %name, "created static Helm queue pool");+ crate::metrics::POOL_EVENTS+ .with_label_values(&["created"])+ .inc();+ }+ drop(pools);++ if let Some(ref backend) = self.k8s_backend {+ let mut backend_cleanup_names = desired_names.clone();+ backend_cleanup_names.extend(shadowed_names);+ for name in &backend_cleanup_names {+ if let Err(e) = backend.delete_pool(name).await {+ warn!(pool = %name, error = %e, "failed to delete stale dynamic pool state for static Helm queue pool");+ }+ if let Err(e) = backend.delete_lease(name).await {+ warn!(pool = %name, error = %e, "failed to delete stale dynamic pool lease for static Helm queue pool");+ }+ }+ }++ Ok(count)+ }+pub async fn create_default_pool(&self) {if self.configured_profiles.is_empty() {info!("no machine profiles configured, skipping default pool creation");@@ -176,41 +385,19 @@ impl PoolManager {pub async fn create_pool_with_caps(&self,name: &str,- mut gpus: HashMap<String, u32>,+ gpus: HashMap<String, u32>,gpu_caps: HashMap<String, u32>,bundle: Option<String>,ttl_seconds: Option<u64>,minimum_worker_count: u32,) -> Result<Pool, Box<dyn std::error::Error + Send + Sync>> {- for gpu_type in gpu_caps.keys() {- if !gpus- .keys()- .any(|required_gpu| required_gpu.eq_ignore_ascii_case(gpu_type))- {- gpus.insert(gpu_type.clone(), 0);- }- }-- // Validate profiles- if !self.configured_profiles.is_empty() {- let invalid: Vec<String> = gpus- .keys()- .chain(gpu_caps.keys())- .filter(|k| {- !self- .configured_profiles- .iter()- .any(|p| p.eq_ignore_ascii_case(k))- })- .cloned()- .collect();-- if !invalid.is_empty() {- return Err(Box::new(InvalidMachineProfileError {- invalid_profiles: invalid,- valid_profiles: self.configured_profiles.clone(),- }));- }+ let gpus = Self::normalize_gpus_and_caps(gpus, &gpu_caps);+ self.validate_pool_profiles(&gpus, &gpu_caps)?;+ let is_static_pool = self.is_static_pool(name).await;+ if is_static_pool {+ return Err(Box::new(StaticPoolMutationError {+ name: name.to_string(),+ }));}let now = Self::now_secs();@@ -290,14 +477,13 @@ impl PoolManager {.with_label_values(&["created"]).inc();- // Persist to K8s backend (best-effort)- if let Some(ref backend) = self.k8s_backend {- if let Err(e) = backend.save_pool(&pool).await {- warn!(error = %e, pool = name, "failed to persist pool to K8s");- }-- // Create K8s Lease for crash-safe TTL (skip default pool)- if name != DEFAULT_POOL_NAME {+ // Persist dynamic named pools to K8s. The default pool is synthetic+ // per gateway replica and is not a lease-owned runtime pool.+ if name != DEFAULT_POOL_NAME {+ if let Some(ref backend) = self.k8s_backend {+ if let Err(e) = backend.save_pool(&pool).await {+ warn!(error = %e, pool = name, "failed to persist pool to K8s");+ }let ttl = Self::lease_ttl_seconds(&pool);if let Err(e) = backend.create_or_renew_lease(name, ttl).await {warn!(error = %e, pool = name, "failed to create K8s Lease");@@ -310,7 +496,8 @@ impl PoolManager {pub async fn get_pool(&self, name: &str) -> Option<Pool> {let pools = self.pools.read().await;- pools.get(name).cloned()+ let key = pool_key_for_name(&pools, name)?;+ pools.get(&key).cloned()}pub async fn capped_lane_status(@@ -324,7 +511,8 @@ impl PoolManager {}let pools = self.pools.read().await;- let pool = pools.get(pool_name)?;+ let key = pool_key_for_name(&pools, pool_name)?;+ let pool = pools.get(&key)?;let cap = pool.spec.gpu_caps@@ -363,13 +551,14 @@ impl PoolManager {}let pools = self.pools.read().await;- let Some(pool) = pools.get(pool_name) else {+ let Some(key) = pool_key_for_name(&pools, pool_name) else {return if pool_name.eq_ignore_ascii_case(DEFAULT_POOL_NAME) {None} else {Some(HashSet::new())};};+ let pool = pools.get(&key)?;let cap = pool.spec.gpu_caps@@ -398,7 +587,8 @@ impl PoolManager {/// KEDA can observe `pending_demand{pool,machine_profile,bundle}`.pub async fn single_machine_profile_for_pool(&self, pool_name: &str) -> Option<String> {let pools = self.pools.read().await;- let pool = pools.get(pool_name)?;+ let key = pool_key_for_name(&pools, pool_name)?;+ let pool = pools.get(&key)?;let mut profiles: Vec<String> = Vec::new();for profile in pool.spec.gpus.keys().chain(pool.spec.gpu_caps.keys()) {if profiles@@ -421,26 +611,30 @@ impl PoolManager {pools.values().cloned().collect()}- pub async fn delete_pool(&self, name: &str) -> Result<bool, DefaultPoolProtectedError> {+ pub async fn delete_pool(&self, name: &str) -> Result<bool, PoolDeletionProtectedError> {if name == DEFAULT_POOL_NAME {- return Err(DefaultPoolProtectedError);+ return Err(PoolDeletionProtectedError::Default);+ }+ if self.is_static_pool(name).await {+ return Err(PoolDeletionProtectedError::Static(name.to_string()));}let mut pools = self.pools.write().await;- let removed = pools.remove(name).is_some();+ let key = pool_key_for_name(&pools, name).unwrap_or_else(|| name.to_string());+ let removed = pools.remove(&key).is_some();drop(pools); // release write lock before K8s callif removed {- info!(pool = name, "deleted pool");+ info!(pool = %key, "deleted pool");crate::metrics::POOL_EVENTS.with_label_values(&["deleted"]).inc();if let Some(ref backend) = self.k8s_backend {- if let Err(e) = backend.delete_pool(name).await {- warn!(error = %e, pool = name, "failed to delete pool from K8s");+ if let Err(e) = backend.delete_pool(&key).await {+ warn!(error = %e, pool = %key, "failed to delete pool from K8s");}- if let Err(e) = backend.delete_lease(name).await {- warn!(error = %e, pool = name, "failed to delete K8s Lease");+ if let Err(e) = backend.delete_lease(&key).await {+ warn!(error = %e, pool = %key, "failed to delete K8s Lease");}}}@@ -448,31 +642,38 @@ impl PoolManager {}pub async fn renew_pool(&self, name: &str) -> bool {- let found = {+ let is_static_pool = self.is_static_pool(name).await;+ let found_key = {let mut pools = self.pools.write().await;- if let Some(pool) = pools.get_mut(name) {- pool.status.last_renewed = Self::now_secs();- true+ if let Some(key) = pool_key_for_name(&pools, name) {+ if let Some(pool) = pools.get_mut(&key) {+ pool.status.last_renewed = Self::now_secs();+ Some(key)+ } else {+ None+ }} else {- false+ None}}; // write lock dropped here- // Renew the K8s Lease (best-effort, skip default pool)- if found && name != DEFAULT_POOL_NAME {+ // Renew the K8s Lease (best-effort, skip default and static Helm pools)+ if let Some(key) = found_key.as_ref() {if let Some(ref backend) = self.k8s_backend {- if let Err(e) = backend.renew_lease(name).await {- warn!(error = %e, pool = name, "failed to renew K8s Lease");+ if key != DEFAULT_POOL_NAME && !is_static_pool {+ if let Err(e) = backend.renew_lease(key).await {+ warn!(error = %e, pool = %key, "failed to renew K8s Lease");+ }}}}- if found {+ if found_key.is_some() {crate::metrics::POOL_EVENTS.with_label_values(&["renewed"]).inc();}- found+ found_key.is_some()}pub async fn assign_workers(@@ -480,11 +681,15 @@ impl PoolManager {pool_name: &str,available_workers: &[WorkerAssignment], // (name, url, gpu, bundle, queue_pool)) -> bool {+ let is_static_pool = self.is_static_pool(pool_name).await;let mut pools = self.pools.write().await;- let pool = match pools.get_mut(pool_name) {- Some(p) => p,+ let pool_key = match pool_key_for_name(&pools, pool_name) {+ Some(key) => key,None => return false,};+ let pool = pools+ .get_mut(&pool_key)+ .expect("pool key resolved from the same map");let filtered: Vec<&WorkerAssignment> = available_workers.iter()@@ -546,7 +751,7 @@ impl PoolManager {}}- let state = if pool_name == DEFAULT_POOL_NAME {+ let state = if pool_key == DEFAULT_POOL_NAME {if assigned.is_empty() {PoolState::Pending} else {@@ -568,10 +773,10 @@ impl PoolManager {let backend = self.k8s_backend.clone();drop(pools);- if status_changed && pool_name != DEFAULT_POOL_NAME {+ if status_changed && pool_key != DEFAULT_POOL_NAME && !is_static_pool {if let Some(ref backend) = backend {- if let Err(e) = backend.update_pool_status(pool_name, &new_status).await {- warn!(error = %e, pool = pool_name, "failed to persist pool assignment status to K8s");+ if let Err(e) = backend.update_pool_status(&pool_key, &new_status).await {+ warn!(error = %e, pool = %pool_key, "failed to persist pool assignment status to K8s");}}}@@ -606,6 +811,9 @@ impl PoolManager {if name == DEFAULT_POOL_NAME {return;}+ if self.is_static_pool(&name).await {+ return;+ }let mut pools = self.pools.write().await;if let Some(existing) = pools.get(&name) {@@ -635,6 +843,9 @@ impl PoolManager {if name == DEFAULT_POOL_NAME {return;}+ if self.is_static_pool(name).await {+ return;+ }let mut pools = self.pools.write().await;if pools.remove(name).is_some() {@@ -645,11 +856,14 @@ impl PoolManager {pub async fn check_expired_leases(&self) -> Vec<String> {let now = Self::now_secs();let mut expired = Vec::new();+ let static_pool_names = self.static_pool_names.read().await.clone();{let pools = self.pools.read().await;for (name, pool) in pools.iter() {- if name == DEFAULT_POOL_NAME {+ if name == DEFAULT_POOL_NAME+ || static_pool_names.contains(&normalize_pool_name(name))+ {continue;}let ttl = pool@@ -669,7 +883,10 @@ impl PoolManager {match backend.list_expired_leases().await {Ok(k8s_expired) => {for name in k8s_expired {- if name == DEFAULT_POOL_NAME || expired.contains(&name) {+ if name == DEFAULT_POOL_NAME+ || expired.contains(&name)+ || static_pool_names.contains(&normalize_pool_name(&name))+ {continue;}let pools = self.pools.read().await;@@ -733,6 +950,17 @@ fn normalize_pool_name(name: &str) -> String {name.trim().to_ascii_lowercase()}+fn pool_key_for_name(pools: &HashMap<String, Pool>, name: &str) -> Option<String> {+ if pools.contains_key(name) {+ return Some(name.to_string());+ }+ let normalized = normalize_pool_name(name);+ pools+ .keys()+ .find(|pool_name| normalize_pool_name(pool_name) == normalized)+ .cloned()+}+#[cfg(test)]mod tests {use super::*;@@ -858,6 +1086,265 @@ mod tests {assert!(pool.is_none());}+ #[tokio::test]+ async fn test_sync_static_pools_creates_uncapped_non_expiring_pool() {+ let pm = PoolManager::new(vec!["l4-spot".to_string()]);++ let mut gpus = HashMap::new();+ gpus.insert("l4-spot".to_string(), 0);+ let specs = vec![PoolSpec {+ name: "company-a".to_string(),+ bundle: None,+ gpus,+ gpu_caps: HashMap::new(),+ ttl_seconds: Some(1),+ minimum_worker_count: 0,+ }];++ let count = pm.sync_static_pools(&specs).await.unwrap();+ assert_eq!(count, 1);++ let pool = pm.get_pool("company-a").await.unwrap();+ assert_eq!(pool.spec.ttl_seconds, None);+ assert!(pool.spec.gpu_caps.is_empty());+ assert!(pm+ .admitted_worker_names_for_capped_lane("company-a", "l4-spot", "default")+ .await+ .is_none());++ {+ let mut pools = pm.pools.write().await;+ pools.get_mut("company-a").unwrap().status.last_renewed -=+ DEFAULT_LEASE_DURATION_S + 10.0;+ }++ let expired = pm.check_expired_leases().await;+ assert!(!expired.contains(&"company-a".to_string()));+ assert!(pm.get_pool("company-a").await.is_some());+ }++ #[tokio::test]+ async fn test_static_pool_caps_are_assignable_and_lane_scoped() {+ let pm = PoolManager::new(vec!["l4-spot".to_string()]);++ let mut gpu_caps = HashMap::new();+ gpu_caps.insert("l4-spot".to_string(), 1);+ let specs = vec![PoolSpec {+ name: "bench".to_string(),+ bundle: None,+ gpus: HashMap::new(),+ gpu_caps,+ ttl_seconds: None,+ minimum_worker_count: 0,+ }];++ pm.sync_static_pools(&specs).await.unwrap();+ let pool = pm.get_pool("bench").await.unwrap();+ assert_eq!(pool.spec.gpus.get("l4-spot"), Some(&0));++ let workers = vec![+ worker_in_pool("w2", "http://w2:8080", "l4-spot", "default", "bench"),+ worker_in_pool("w1", "http://w1:8080", "l4-spot", "default", "bench"),+ worker("default-worker", "http://w3:8080", "l4-spot", "default"),+ ];+ assert!(pm.assign_workers("bench", &workers).await);++ let admitted = pm+ .admitted_worker_names_for_capped_lane("bench", "l4-spot", "default")+ .await+ .expect("static cap should make admission lane-scoped");+ assert_eq!(admitted, HashSet::from(["w1".to_string()]));+ }++ #[tokio::test]+ async fn test_static_pool_rejects_api_mutation_and_delete() {+ let pm = PoolManager::new(vec!["l4-spot".to_string()]);++ let mut gpus = HashMap::new();+ gpus.insert("l4-spot".to_string(), 0);+ let specs = vec![PoolSpec {+ name: "bench".to_string(),+ bundle: None,+ gpus,+ gpu_caps: HashMap::new(),+ ttl_seconds: None,+ minimum_worker_count: 0,+ }];+ pm.sync_static_pools(&specs).await.unwrap();++ let mut changed_gpus = HashMap::new();+ changed_gpus.insert("l4-spot".to_string(), 1);+ let result = pm+ .create_pool("bench", changed_gpus, None, Some(60), 0)+ .await;+ assert!(result.is_err());+ assert!(result+ .unwrap_err()+ .to_string()+ .contains("static Helm queue pool"));++ let delete_result = pm.delete_pool("bench").await;+ assert!(delete_result.is_err());+ assert!(delete_result+ .unwrap_err()+ .to_string()+ .contains("static Helm queue pool"));+ assert!(pm.renew_pool("bench").await);+ }++ #[tokio::test]+ async fn test_static_pool_case_variants_are_protected() {+ let pm = PoolManager::new(vec!["l4-spot".to_string()]);++ let mut gpus = HashMap::new();+ gpus.insert("l4-spot".to_string(), 0);+ let specs = vec![PoolSpec {+ name: "Bench".to_string(),+ bundle: None,+ gpus,+ gpu_caps: HashMap::new(),+ ttl_seconds: None,+ minimum_worker_count: 0,+ }];+ pm.sync_static_pools(&specs).await.unwrap();++ assert_eq!(pm.get_pool("Bench").await.unwrap().spec.name, "bench");++ let mut changed_gpus = HashMap::new();+ changed_gpus.insert("l4-spot".to_string(), 1);+ let result = pm+ .create_pool("BENCH", changed_gpus, None, Some(60), 0)+ .await;+ assert!(result.is_err());+ assert!(result+ .unwrap_err()+ .to_string()+ .contains("static Helm queue pool"));++ let delete_result = pm.delete_pool("BENCH").await;+ assert!(delete_result.is_err());+ assert!(delete_result+ .unwrap_err()+ .to_string()+ .contains("static Helm queue pool"));+ assert!(pm.renew_pool("BENCH").await);+ }++ #[tokio::test]+ async fn test_static_pool_rejects_duplicate_case_variants() {+ let pm = PoolManager::new(vec!["l4-spot".to_string()]);++ let mut gpus = HashMap::new();+ gpus.insert("l4-spot".to_string(), 0);+ let specs = vec![+ PoolSpec {+ name: "Bench".to_string(),+ bundle: None,+ gpus: gpus.clone(),+ gpu_caps: HashMap::new(),+ ttl_seconds: None,+ minimum_worker_count: 0,+ },+ PoolSpec {+ name: "bench".to_string(),+ bundle: None,+ gpus,+ gpu_caps: HashMap::new(),+ ttl_seconds: None,+ minimum_worker_count: 0,+ },+ ];++ let result = pm.sync_static_pools(&specs).await;+ assert!(result.is_err());+ assert!(result+ .unwrap_err()+ .to_string()+ .contains("duplicate static queue pool 'bench'"));+ assert!(pm.list_pools().await.is_empty());+ }++ #[tokio::test]+ async fn test_static_pool_removes_shadowed_case_variant_pool() {+ let pm = PoolManager::new(vec!["l4-spot".to_string()]);++ let mut dynamic_gpus = HashMap::new();+ dynamic_gpus.insert("l4-spot".to_string(), 1);+ pm.create_pool("Bench", dynamic_gpus, None, Some(60), 0)+ .await+ .unwrap();++ let mut static_gpus = HashMap::new();+ static_gpus.insert("l4-spot".to_string(), 0);+ let specs = vec![PoolSpec {+ name: "bench".to_string(),+ bundle: None,+ gpus: static_gpus,+ gpu_caps: HashMap::new(),+ ttl_seconds: None,+ minimum_worker_count: 0,+ }];+ pm.sync_static_pools(&specs).await.unwrap();++ let pools = pm.list_pools().await;+ assert_eq!(pools.len(), 1);+ assert_eq!(pools[0].spec.name, "bench");+ assert_eq!(pools[0].spec.gpus.get("l4-spot"), Some(&0));+ assert_eq!(pm.get_pool("Bench").await.unwrap().spec.name, "bench");+ }++ #[tokio::test]+ async fn test_static_pool_ignores_remote_k8s_watch_events() {+ let pm = PoolManager::new(vec!["l4-spot".to_string()]);++ let mut gpus = HashMap::new();+ gpus.insert("l4-spot".to_string(), 0);+ let specs = vec![PoolSpec {+ name: "bench".to_string(),+ bundle: None,+ gpus,+ gpu_caps: HashMap::new(),+ ttl_seconds: None,+ minimum_worker_count: 0,+ }];+ pm.sync_static_pools(&specs).await.unwrap();++ let mut remote_gpus = HashMap::new();+ remote_gpus.insert("l4-spot".to_string(), 1);+ let remote = Pool {+ spec: PoolSpec {+ name: "bench".to_string(),+ bundle: Some("other".to_string()),+ gpus: remote_gpus,+ gpu_caps: HashMap::new(),+ ttl_seconds: Some(60),+ minimum_worker_count: 1,+ },+ status: PoolStatus {+ state: PoolState::Active,+ assigned_workers: vec![AssignedWorker {+ name: "remote-worker".to_string(),+ url: "http://remote-worker:8080".to_string(),+ gpu: "l4-spot".to_string(),+ bundle: "other".to_string(),+ }],+ created_at: 9999.0,+ last_renewed: 9999.0,+ },+ };++ pm.apply_remote_pool(remote).await;+ let found = pm.get_pool("bench").await.unwrap();+ assert_eq!(found.spec.bundle, None);+ assert_eq!(found.spec.gpus.get("l4-spot"), Some(&0));+ assert_eq!(found.spec.ttl_seconds, None);+ assert_eq!(found.status.state, PoolState::Pending);+ assert!(found.status.assigned_workers.is_empty());++ pm.remove_remote_pool("bench").await;+ assert!(pm.get_pool("bench").await.is_some());+ }+#[tokio::test]async fn test_assign_workers() {let pm = PoolManager::new(vec!["l4-spot".to_string()]);diff --git a/packages/sie_sdk/pyproject.toml b/packages/sie_sdk/pyproject.tomlindex b0df46057..a4c794671 100644--- a/packages/sie_sdk/pyproject.toml+++ b/packages/sie_sdk/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-sdk"-version = "0.6.0"+version = "0.6.1"description = "Search Inference Engine - Python SDK"requires-python = ">=3.12"license = { text = "Apache-2.0" }diff --git a/packages/sie_server/openapi.json b/packages/sie_server/openapi.jsonindex 67b16b8ec..232311d06 100644--- a/packages/sie_server/openapi.json+++ b/packages/sie_server/openapi.json@@ -3,7 +3,7 @@"info": {"title": "SIE Server","description": "Search Inference Engine - GPU inference server for search workloads",- "version": "0.6.0"+ "version": "0.6.1"},"paths": {"/": {diff --git a/packages/sie_server/pyproject.toml b/packages/sie_server/pyproject.tomlindex 899255710..4692a069f 100644--- a/packages/sie_server/pyproject.toml+++ b/packages/sie_server/pyproject.toml@@ -1,6 +1,6 @@[project]name = "sie-server"-version = "0.6.0"+version = "0.6.1"description = "Search Inference Engine - GPU inference server for search workloads"requires-python = ">=3.12,<3.13"license = { text = "Apache-2.0" }diff --git a/packages/sie_server_sidecar/Cargo.lock b/packages/sie_server_sidecar/Cargo.lockindex 16dd5be98..08a566944 100644--- a/packages/sie_server_sidecar/Cargo.lock+++ b/packages/sie_server_sidecar/Cargo.lock@@ -2216,7 +2216,7 @@ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"[[package]]name = "sie-server-sidecar"-version = "0.6.0"+version = "0.6.1"dependencies = ["anyhow","async-nats",diff --git a/packages/sie_server_sidecar/Cargo.toml b/packages/sie_server_sidecar/Cargo.tomlindex 1789a7ce4..2f964be63 100644--- a/packages/sie_server_sidecar/Cargo.toml+++ b/packages/sie_server_sidecar/Cargo.toml@@ -1,6 +1,6 @@[package]name = "sie-server-sidecar"-version = "0.6.0"+version = "0.6.1"edition = "2021"description = "SIE worker sidecar: NATS JetStream consumer, scheduler, IPC client, and GPU-independent prep for sie-server pods."diff --git a/packages/sie_ts_sdk/package.json b/packages/sie_ts_sdk/package.jsonindex 660ea3810..c3671f0d5 100644--- a/packages/sie_ts_sdk/package.json+++ b/packages/sie_ts_sdk/package.json@@ -1,6 +1,6 @@{"name": "@superlinked/sie-sdk",- "version": "0.6.0",+ "version": "0.6.1","description": "Official TypeScript SDK for SIE (Search Inference Engine)","type": "module","main": "./dist/index.cjs",diff --git a/packages/sie_ts_sdk/src/version.ts b/packages/sie_ts_sdk/src/version.tsindex 8b18ba9e6..95e2f968f 100644--- a/packages/sie_ts_sdk/src/version.ts+++ b/packages/sie_ts_sdk/src/version.ts@@ -1 +1 @@-export const SDK_VERSION = "0.6.0"; // x-release-please-version+export const SDK_VERSION = "0.6.1"; // x-release-please-versiondiff --git a/uv.lock b/uv.lockindex 48fe4fc21..78f71a183 100644--- a/uv.lock+++ b/uv.lock@@ -5635,7 +5635,7 @@ dev = [[[package]]name = "sie-admin"-version = "0.6.0"+version = "0.6.1"source = { editable = "packages/sie_admin" }dependencies = [{ name = "httpx" },@@ -5668,7 +5668,7 @@ requires-dist = [[[package]]name = "sie-bench"-version = "0.6.0"+version = "0.6.1"source = { editable = "packages/sie_bench" }dependencies = [{ name = "aiohttp" },@@ -5753,7 +5753,7 @@ requires-dist = [[[package]]name = "sie-chroma"-version = "0.6.0"+version = "0.6.1"source = { editable = "integrations/sie_chroma" }dependencies = [{ name = "chromadb" },@@ -5825,7 +5825,7 @@ dev = [[[package]]name = "sie-crewai"-version = "0.6.0"+version = "0.6.1"source = { editable = "integrations/sie_crewai" }dependencies = [{ name = "crewai" },@@ -5850,7 +5850,7 @@ requires-dist = [[[package]]name = "sie-dspy"-version = "0.6.0"+version = "0.6.1"source = { editable = "integrations/sie_dspy" }dependencies = [{ name = "dspy" },@@ -5875,7 +5875,7 @@ requires-dist = [[[package]]name = "sie-haystack"-version = "0.6.0"+version = "0.6.1"source = { editable = "integrations/sie_haystack" }dependencies = [{ name = "haystack-ai" },@@ -5902,7 +5902,7 @@ requires-dist = [[[package]]name = "sie-lancedb"-version = "0.6.0"+version = "0.6.1"source = { editable = "integrations/sie_lancedb" }dependencies = [{ name = "lancedb" },@@ -5929,7 +5929,7 @@ requires-dist = [[[package]]name = "sie-langchain"-version = "0.6.0"+version = "0.6.1"source = { editable = "integrations/sie_langchain" }dependencies = [{ name = "langchain-core" },@@ -5956,7 +5956,7 @@ requires-dist = [[[package]]name = "sie-llamaindex"-version = "0.6.0"+version = "0.6.1"source = { editable = "integrations/sie_llamaindex" }dependencies = [{ name = "llama-index-core" },@@ -5983,7 +5983,7 @@ requires-dist = [[[package]]name = "sie-qdrant"-version = "0.6.0"+version = "0.6.1"source = { editable = "integrations/sie_qdrant" }dependencies = [{ name = "qdrant-client" },@@ -6006,7 +6006,7 @@ requires-dist = [[[package]]name = "sie-sdk"-version = "0.6.0"+version = "0.6.1"source = { editable = "packages/sie_sdk" }dependencies = [{ name = "aiohttp" },@@ -6055,7 +6055,7 @@ requires-dist = [[[package]]name = "sie-server"-version = "0.6.0"+version = "0.6.1"source = { editable = "packages/sie_server" }dependencies = [{ name = "blake3" },@@ -6170,7 +6170,7 @@ dev = [][[package]]name = "sie-weaviate"-version = "0.6.0"+version = "0.6.1"source = { editable = "integrations/sie_weaviate" }dependencies = [{ name = "sie-sdk" },