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

Aberta
#5,941 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
22/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
rust
Domínio
api, backend

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Rust
Estrelas
21.5k
Forks
2.1k
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de NVIDIA/OpenShell

Todas as issues de NVIDIA/OpenShell

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.