Skip to content

feat(operator): add administrative provider drain - #126

Open
nerdalert wants to merge 3 commits into
praxis-proxy:mainfrom
nerdalert:feat/provider-drain
Open

feat(operator): add administrative provider drain#126
nerdalert wants to merge 3 commits into
praxis-proxy:mainfrom
nerdalert:feat/provider-drain

Conversation

@nerdalert

Copy link
Copy Markdown
Member

Summary

Adds reversible administrative draining for individual inference providers and for all providers explicitly associated with a provider gateway.

A drained provider remains in the routing overlay as existing_only: existing affinity sessions may continue using it, while new sessions are placed elsewhere. Health, trust, freshness, and exclusion decisions continue to take precedence, so draining or undraining cannot make an otherwise ineligible provider routable.

Changes

  • Adds InferenceProvider.spec.trafficPolicy.drain to the API, generated CRDs, and Helm schema/template.
  • Adds optional InferenceProvider.spec.gatewayRef administrative grouping metadata.
  • Applies administrative drain after the operator's existing health and eligibility evaluation.
  • Adds cargo xtask env provider-drain with mutually exclusive --provider and --gateway selectors, dry-run support, bounded kubectl operations, and optional accepted/serving revision convergence checks.
  • Restores providers after qualification failures and rolls back providers already changed when gateway-wide fan-out fails partway through.
  • Extends the single-cluster multi-gateway qualification with individual drain, gateway-wide drain, affinity retention, new-session exclusion, operator restart persistence, unhealthy-provider precedence, invalid-selector handling, and restoration evidence.
  • Documents the drain contract and operational workflow.

gatewayRef is grouping metadata used by the administrative command. Gateway-wide drain is an explicit client-side fan-out; it does not add request-time Grid behavior or infer membership from endpoint URLs.

Validation

Static validation passed:

  • cargo test --workspace: 561 passed
  • cargo clippy --workspace --all-targets -- -D warnings
  • make test
  • make doc
  • make lint
  • nightly formatting check
  • git diff --check
  • Forge topology validation
  • focused provider-drain tests: 23 passed

Fresh Kind validation from the final source passed twice:

  • Run 2: 32/32 scenarios, automatic restoration and teardown passed
  • Run 3: 32/32 scenarios, automatic restoration and teardown passed

The initial attempt used the mock-provider image for the VCR backend and failed before scenarios; its automatic cleanup passed. The two corrected runs used fresh role-appropriate images and completed successfully.

No AI or Praxis changes are included.

@praxis-bot praxis-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praxis-bot review

Well-structured feature. The operator-side drain logic is clean and correct: apply_administrative_drain is pure, only caps NewAndExisting to ExistingOnly, and never overrides hard exclusions. CRD, Helm, and deploy artifacts are consistent. The RestorationGuard with Drop-based cleanup and the bounded retry/rollback in the xtask are solid operational safety patterns. Test coverage is thorough across unit, CRD round-trip, and e2e qualification scenarios.

Two medium findings below on the overlay lookup in the xtask convergence path.

Comment thread xtask/src/env/provider_drain.rs
Comment thread xtask/src/env/provider_drain.rs
Signed-off-by: Brent Salisbury <bsalisbu@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants