feat(gateway): define resource admission at the gateway level with a typed policy

未關閉
#5,941 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
22/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
rust
領域
api, backend

研究方向

Start by reading DriverAdmissionConfig in openshell-core and following where the gateway extracts allow_driver_config and resource_admission from each [openshell.drivers.<name>] table; then read the Configure and GetCapabilities message definitions that carry resource_admission_policy_json and the v1:-prefixed reply. Use the driver_dir deprecated-alias handling as the model for the new [openshell.gateway.resource_admission] table and its warning. Done means the typed policy round-trips, the mismatch rejection still fires, and tests cover legacy location, new location and the round trip. This is a protocol change with a deprecation window, so agree the message shape with a maintainer before editing.

由索引模型根據 Issue 內容生成。

描述

area:drivers

User Story

I operate the gateway with Docker, Podman or VM compute drivers and configure resource admission (allow_driver_config and resource_admission) for them. I directly encountered, while reviewing the launched-driver contract, that these gateway-level rules live in each driver's own table and travel to drivers as JSON text. This affects how clearly operators configure admission and how safely the protocol carries it.

Problem Statement

allow_driver_config and resource_admission are one shared policy type (DriverAdmissionConfig in openshell-core), enforced by the gateway and re-checked by each driver. It is configured under [openshell.drivers.<name>], so an operator repeats it per driver. The gateway pulls the two keys out of every driver table, and the launcher sends them to the driver as a JSON string (resource_admission_policy_json in Configure). The driver reports its effective policy back in GetCapabilities as another JSON string (resource_admission_policy, prefixed v1:), which the gateway compares with its own.

Impact / Why This Matters

The same policy is written in several places and carried as untyped text in two protocols. A typo or a format change is caught only at parse time, and the placement suggests a per-backend setting when it is a gateway rule.

Desired Workflow

Operators define resource admission once, under the gateway table (for example [openshell.gateway.resource_admission]). The driver-table location keeps working as a deprecated alias with a warning, as driver_dir does. The gateway sends the policy to launched drivers in a typed resource_admission_policy message in Configure, and drivers report it in GetCapabilities as the same typed message, so the gateway compares messages. The JSON fields are deprecated for one protocol version and then removed. Kubernetes and external drivers keep working through the existing capability handshake.

Acceptance Criteria

  • A gateway-level admission table is documented and takes precedence over the deprecated driver-table keys.
  • Configure and GetCapabilities carry a typed policy. resource_admission_policy_json is deprecated for one protocol version and then removed.
  • The gateway rejects a driver whose reported policy differs from its own, as it does today.
  • Tests cover the legacy driver-table location, the new location and the typed round trip.

Related: #5384, #5385. Deferred from the launcher PR.

主要語言
Rust
星號
21.5k
分支
2.1k
PR 合併指標
30 天內沒有已合併 PR

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

NVIDIA/OpenShell 的其他 Issue

查看 NVIDIA/OpenShell 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。