Commit Graph
560 Commits
Author SHA1 Message Date
Evan Lezar 2ef7f2098a test(e2e): clarify backend-specific task names
Signed-off-by: Evan Lezar <elezar@nvidia.com>
2026-05-06 14:57:07 +02:00
Drew Newberry f17806caa6 fix(ci): sync mise lock header with CI (#1187) 2026-05-05 23:09:54 -07:00
Adam Miller d8b84773ca feat(rpm): add RPM packaging with Packit/COPR and GHA release publishing (#1126) 2026-05-05 15:42:00 -07:00
Taylor Mutch 5b29189b1e chore: Simplify codeowners rules (#1178) 2026-05-05 14:42:13 -07:00
Max Dubrinsky c0cc196a08 feat(cli): add openshell gateway list subcommand (#1179)
Wires up a first-class `gateway list` command that calls the existing
`run::gateway_list()` helper. Resolves the dead reference in
`crates/openshell-bootstrap/src/errors.rs:248`, where the port-conflict
recovery hint already pointed users at this command.

Updates the manage-gateways doc to teach the new verb instead of the
`gateway select`-with-no-arg fallback.

Closes #1173

Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>
2026-05-05 17:28:34 -04:00
Taylor Mutch 5116cc27b7 feat(helm): add kubernetes local-dev environment (#1158) 2026-05-05 13:42:21 -07:00
Drew Newberry e4b4e923ae test(e2e): run suites against docker gateway (#1153) 2026-05-05 13:28:08 -07:00
Colin Walters b77b60b304 Two podman driver fixes (#1077)
* fix(driver-podman): use explicit cap_drop instead of cap_drop:ALL

cap_drop:ALL removes every capability in Podman's default set — including
CAP_DAC_OVERRIDE, CAP_CHOWN, CAP_FOWNER, CAP_SETUID, CAP_SETGID — and the
original cap_add list failed to re-add them which we need.

We also don't need to add CAP_SETUID and CAP_SETGID - those are defaults.

Signed-off-by: Colin Walters <walters@verbum.org>

* fix(e2e): fix gateway health check and SSH port in e2e-podman.sh

Two bugs in the Podman e2e gateway startup:

1. Health check: curl probed /healthz on the main gRPC port, which always
   returns 404 because the health router is only served on --health-port
   (a separate listener, disabled by default). Allocate a second free port
   and pass --health-port to the gateway; health check now probes that port.

2. SSH port: --ssh-gateway-port was not set, so the gateway always told
   clients to connect SSH to port 8080 regardless of the actual port.
   Explicitly pass --ssh-gateway-port ${PORT} to fix sandbox exec/SSH.

Signed-off-by: Colin Walters <walters@verbum.org>

---------

Signed-off-by: Colin Walters <walters@verbum.org>
2026-05-05 13:35:38 -05:00
jtoelke2 8bfd3e1914 ci(os-49): fix release jobs on shared runners (#1172) 2026-05-05 10:46:14 -05:00
Alexander Watson 142a3a3d31 fix(examples): harden multi-agent notepad 409 retry and improve docs (#1166)
* fix(examples): harden multi-agent notepad 409 retry and improve docs

Add decorrelated jitter to the GitHub Contents API retry loop so racing
workers don't retry in lockstep, and widen the retry set to 5xx for
transient server errors. Without jitter, N concurrent workers trip the
same backoff schedule and re-collide on each beat.

Also:
- Extract the inline 220-line sandbox runner from demo.sh into a
  separate runner.sh. demo.sh stays as host orchestration; runner.sh
  is the per-sandbox program. demo.sh shrinks 460 to 240 lines.
- Rewrite README to lead with "Why GitHub as a shared notepad?" and
  add a "Memory architecture variants" section covering pile,
  append-journal, and indexed-memory patterns.
- Switch Quick Start to use \`gh auth token\` as the primary path.
- Pass the worker slice arg explicitly instead of reading \$9 from the
  outer dispatcher.
- Add .gitignore for personal run_demo.sh helpers.

* docs updates
2026-05-05 08:36:12 -07:00
jtoelke2 e73a4eae53 ci(os-49): draft release runner cutover (#1164) 2026-05-05 10:18:29 -05:00
Drew Newberry 9efb3464e2 chore: add new core maintainers to OpenShell (#1167) 2026-05-05 07:29:32 -07:00
Drew Newberry f56c09c7df docs: update gateway deployment architecture (#1108) 2026-05-04 22:52:29 -07:00
jtoelke2 9c53d1294a ci(os-49): remove obsolete shadow PR workflows (#1161) 2026-05-04 22:14:54 -05:00
John T. Myers e405e40914 fix(ci): include provider profiles in macos docker builds (#1163) 2026-05-04 19:27:34 -07:00
John T. Myers 043bde279a feat(providers): add profile-backed policy composition (#1037)
Foundation for providers v2. Add provider profiles and provider profile composition with user policies.
2026-05-04 18:34:33 -07:00
Saurabh Agarwal 04e48d585c feat(server): add request-ID middleware for request correlation (#1082)
Add a UUID-based request-ID middleware using tower-http's request-id
feature. Each inbound request receives a unique x-request-id header
(or preserves a client-supplied one), which is recorded in the tracing
span and propagated to the response.

This enables operators to correlate log lines across the middleware
stack for a single request under concurrent load, and lets clients
reference specific requests in bug reports.

Signed-off-by: sauagarwa <sauagarw@redhat.com>
2026-05-04 16:14:58 -07:00
Alexander Watson 25c4fdecd1 fix(examples): repair multi-agent notepad uploads (#1152) 2026-05-04 13:31:25 -07:00
Taylor Mutch d73860f523 feat(driver-kubernetes): sideload supervisor binary via init container (#1154)
* feat: Update kubernetes driver to side-load supervisor binary

* Update helm chart with supervisor image config

* chore(driver-kubernetes): fix rustfmt formatting
2026-05-04 13:00:28 -07:00
jtoelke2 4803889cc7 ci: cut over non-release workflows to shared runners (#1131)
Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>
2026-05-04 14:34:16 -05:00
John T. Myers 6b21804258 feat(policy): add GraphQL L7 inspection (#1083)
Support GraphQL L7 policies
2026-05-04 11:50:09 -07:00
Tinson Lai 213025d942 fix(bootstrap): add no-progress timeout to image build (#1109) 2026-05-04 10:39:54 -07:00
Drew Newberry a255ad9142 fix(e2e): stabilize wildcard host DNS test (#1144) 2026-05-04 07:59:56 -07:00
Drew Newberry 2e0afeabe1 feat(vm): derive guest rootfs from sandbox images (#957) 2026-05-03 23:23:30 -07:00
Drew Newberry 08001ca616 fix(docker): harden supervisor startup and gateway routing (#1128) 2026-05-03 21:38:20 -07:00
Mesut Oezdil 721c39f1f3 docs: fix tutorial links pointing to /tutorials instead of /get-started/tutorials (#1137) 2026-05-02 13:35:31 -07:00
Mesut Oezdil c0352272e5 docs: fix broken link and capitalise GitHub correctly (#1135)
Close the missing closing parenthesis on the Manage Providers link in
github-sandbox.mdx and correct four instances of "Github" to "GitHub"
across the docs.

Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
2026-05-02 08:06:34 -07:00
jtoelke2 32857eb650 fix(helm): grant node read access for GPU capacity checks (#1106)
* fix(helm): grant node read access for GPU capacity checks

Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>

* ci: add WSL GPU failure diagnostics

Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>

* fix(gpu): bump device plugin for WSL CDI

* fix(sandbox): allow WSL GPU paths in Landlock

Allow /dev/dxg and /usr/lib/wsl as GPU baseline paths so WSL CDI GPU sandboxes can initialize NVML. Native Linux skips these entries when the paths do not exist.

* ci: remove temporary WSL GPU diagnostics

---------

Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>
2026-05-01 17:49:49 -05:00
Mesut Oezdil 76093e78a3 refactor(sandbox): remove dead relay_response_to_client wrapper (#1125)
relay_response_to_client had no callers; all call sites use relay_response
directly. The allow(dead_code) comment on parse_target_query was also
misleading since proxy.rs calls it from production code, so that annotation
is removed along with the incorrect comment.
2026-05-01 15:15:41 -07:00
John T. Myers 5d0a44cbac fix(sandbox): invalidate stale l7 tunnels after reload (#1118)
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
2026-05-01 13:01:30 -07:00
ddurst-nvidia 4c2564892b fix(sandbox): accept ENOENT in drop_privileges identity lookup tests (#1123)
User::from_name / Group::from_name may return Ok(None), producing our explicit "Sandbox … not found" errors, or Err when NSS fails first with ENOENT ("ENOENT: No such file or directory") before a definitive unknown-name result.

Accept either wording so nonexistent user/group tests stay meaningful across environments.

Signed-off-by: ddurst <267424412+ddurst-nvidia@users.noreply.github.com>
2026-05-01 13:01:10 -07:00
ddurst-nvidia a3aed62cb2 chore(openshell-core): discover proto files in build script (#1122)
Walk ../../proto recursively instead of maintaining a hard-coded list. Sort paths for deterministic codegen and keep cargo:rerun-if-changed scoped to the proto tree.

Signed-off-by: ddurst <267424412+ddurst-nvidia@users.noreply.github.com>
2026-05-01 12:04:55 -07:00
John T. Myers 55f0e37127 chore(ci): label non-maintainer issues for triage (#1120)
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
2026-05-01 11:08:56 -07:00
John T. Myers 8e28209587 chore(ci): label maintainer issues by repo permission (#1116)
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
2026-05-01 09:09:30 -07:00
Drew Newberry 230824e74a fix(install): refresh dev gateway registration (#1110) 2026-05-01 08:34:00 -07:00
Drew Newberry fcefdd53b7 feat(driver-docker): use host networking for sandboxes (#1080) 2026-05-01 08:09:11 -07:00
Drew Newberry 9751872b2d feat(release): add Debian package publishing (#1069) 2026-05-01 07:51:45 -07:00
John T. Myers b39af3da85 chore(ci): label mon maintainer issues for triage (#1102)
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
2026-05-01 07:18:49 -07:00
jtoelke2 dd98eb25ef ci: drop duplicate shadow e2e workflow (#1104)
Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>
2026-04-30 22:31:03 -05:00
Taylor Mutch 888f1dde86 chore: sync Cargo.lock (#1084) 2026-04-30 20:09:01 -07:00
Piotr Mlocek f46b296daf test(e2e): skip docker gpu test in rust suite (#1103)
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
2026-04-30 18:59:43 -07:00
Seth Jennings ea4915ad30 feat(server): add feat: auto-detection of compute driver at startup (#1088)
When no drivers are explicitly configured, the server now automatically
detects the appropriate compute driver by checking the runtime environment:

- Kubernetes: detected via KUBERNETES_SERVICE_HOST env var (set inside pods)
- Podman: detected by checking if podman binary is available on PATH
- Docker: detected by checking if docker binary is available on PATH

Priority order: Kubernetes → Podman → Docker. VM is never auto-detected
and must be selected explicitly via --drivers vm.

The Auto variant is internal-only and does not serialize to config files.
The default --drivers value is now empty, triggering auto-detection.
2026-04-30 17:39:26 -07:00
Evan Lezar 0c0f3e32e1 feat(docker): enable CDI GPU sandboxes (#1036) 2026-04-30 13:23:57 -07:00
Evan Lezar 182cbc6750 fix(docker): set apparmor=unconfined on sandbox containers (#1078)
Docker's default AppArmor profile blocks mount(2) with MS_SHARED even
when SYS_ADMIN is granted, which prevents ip-netns from creating
network namespaces required for proxy-mode network isolation. The
sandbox enforces its own isolation (seccomp, Landlock, network
namespaces), so the host AppArmor profile provides no meaningful
additional defence inside a container that already holds SYS_ADMIN.
2026-04-30 13:23:36 -07:00
Drew Newberry 51351e4745 chore(ci): update checkout action to v6 (#1086)
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
2026-04-30 13:22:47 -07:00
Mrunal Patel 084505425b feat(auth): add OIDC/Keycloak authentication with RBAC and scope-based permissions (#935)
* feat(auth): add OIDC/Keycloak authentication with RBAC

Add OAuth2/OIDC authentication to the gateway server with role-based
access control, CLI login flows, and full deployment plumbing.

Server: JWT validation against configurable OIDC issuer (oidc.rs),
JWKS key caching with TTL and rotation handling, method classification
(unauthenticated/sandbox-secret/dual-auth/bearer), identity extraction
with provider-agnostic Identity type, and RBAC enforcement via
AuthzPolicy with configurable admin/user roles and auth-only mode.

CLI: browser-based Authorization Code + PKCE flow, Client Credentials
flow for CI/automation, token storage with refresh, gateway add/login/
logout commands, OIDC bearer token injection over mTLS transport,
discovery endpoint for auto-configuration.

Security: sandbox-secret scope restriction on UpdateConfig (policy
sync only), anti-spoofing header stripping, dual-auth fallthrough
from sandbox-secret to Bearer token.

Deployment: OIDC config wired through DeployOptions, Docker env vars,
Helm values/templates, HelmChart manifest, cluster-entrypoint.sh, and
bootstrap scripts. Keycloak dev server script with pre-configured
realm (test users, roles, PKCE client, CI client).

Tested with Keycloak. The roles claim path and role names are
configurable to support other OIDC providers.

* feat(auth): add OAuth2 scope-based fine-grained permissions

Add opt-in scope enforcement on top of existing OIDC role-based access
control. When --oidc-scopes-claim is set, the server extracts scopes
from the JWT and checks them per-method against an exhaustive scope map.

Scopes: sandbox:read, sandbox:write, provider:read, provider:write,
config:read, config:write, inference:read, inference:write, and
openshell:all (wildcard). Methods not in the scope map require
openshell:all. Scopes layer on top of roles and cannot escalate
privilege. Auth-only mode (empty role names) still enforces scopes
when enabled.

Server: scopes_claim in OidcConfig, scope extraction from JWT
(space-delimited and JSON array formats), standard OIDC scope
filtering, scope check in AuthzPolicy after role check.

CLI: --oidc-scopes on gateway add/start stored in metadata and
consumed by gateway login, --oidc-scopes-claim on gateway start
forwarded to server, scopes parameter in browser and client
credentials OAuth2 flows with openid deduplication.

Deployment: oidc_scopes_claim wired through DeployOptions, docker.rs,
Helm, bootstrap scripts, and cluster entrypoint.

Keycloak: realm config updated with built-in OIDC scopes and 9
OpenShell client scopes as optional on openshell-cli and openshell:all
as default on openshell-ci.

* fix(auth): address branch review findings

Add GetInferenceBundle to sandbox-secret methods so sandbox inference
route refresh works under OIDC. Make GetSandboxConfig dual-auth so CLI
users can read sandbox settings with Bearer tokens.

Preserve OIDC gateway metadata on restart — a bare gateway start
without --oidc-* flags no longer erases the stored OIDC registration.

Document CI client ID requirement (openshell-ci vs openshell-cli) in
the testing guide. Add security note about auth-only mode blast radius
for GitHub Actions.

* fix(auth): complete review findings for OIDC auth boundary

Move OpenShell/GetSandboxConfig from sandbox-secret-only to dual-auth
so CLI users can read sandbox settings with Bearer tokens while sandbox
supervisors continue using the shared secret.

Add sandbox secret interceptor to the inference bundle fetch path so
GetInferenceBundle works under OIDC-enabled gateways. Extract shared
interceptor constructor to avoid duplication.

Add GetSandboxConfig to the config:read scope map so scope enforcement
applies consistently when scopes are enabled.

Refactor OIDC metadata preservation into apply_oidc_gateway_metadata()
with explicit resume semantics — only preserve existing OIDC metadata
on real resume paths, not on fresh deployments.

Update architecture docs and testing guide to reflect the corrected
method classifications and add new test coverage for interceptor
injection, scope requirements, metadata preservation, and dual-auth
classification.

* refactor(auth): use oauth2 crate for CLI OIDC flows

Replace hand-written PKCE generation, authorization URL construction,
token exchange, client credentials, and token refresh with the oauth2
crate's typed API.

Eliminates sha2, hex, and getrandom dependencies from the CLI. The
custom urlencoded() helper and manual form POST logic are replaced by
BasicClient methods with proper type-state safety.

Discovery and the callback server remain custom since the oauth2 crate
does not provide OIDC discovery or a localhost redirect listener.

* refactor(auth): move server auth modules into auth/ directory

Group oidc.rs, authz.rs, identity.rs, and the auth HTTP endpoints
under src/auth/ module directory. No behavioral changes.

  auth/mod.rs      — module root, re-exports HTTP router
  auth/oidc.rs     — JWT validation, JWKS caching, method classification
  auth/authz.rs    — role and scope authorization policy
  auth/identity.rs — provider-agnostic Identity type
  auth/http.rs     — /auth/connect and /auth/oidc-config endpoints

* fix(auth): use RequestBody auth type for client credentials flow

The oauth2 crate defaults to BasicAuth (HTTP Basic header) but Keycloak
and most OIDC providers expect client_secret_post (credentials in the
request body). Set AuthType::RequestBody explicitly to match the
pre-refactor behavior.

Also re-export Identity, IdentityProvider, and JwksCache from the auth
module so ServerState's public API remains nameable by external consumers.

* fix(auth): forward OPENSHELL_OIDC_SCOPES through cluster bootstrap

Pass --oidc-scopes to gateway start so the metadata includes requested
scopes after cluster bootstrap. Without this, users had to manually
edit metadata.json to set scopes for gateway login.

Usage: OPENSHELL_OIDC_SCOPES="openshell:all" mise run cluster

* test(auth): add OIDC e2e tests for RBAC, scopes, and client credentials

Add 10 end-to-end tests covering OIDC authentication against a live
K3s cluster with Keycloak:

RBAC (5 tests): admin can create providers, user cannot, user can list
sandboxes, unauthenticated requests rejected, health probe works
without auth.

Scopes (4 tests): sandbox-scoped token can list sandboxes but not
providers, openshell:all grants full access, no-scopes token denied.

Client credentials (1 test): CI token via client_credentials grant.

Tests are opt-in via OPENSHELL_E2E_OIDC=1 and OPENSHELL_E2E_OIDC_SCOPES=1
env vars. They derive the Keycloak URL from gateway metadata to match
the server's configured issuer.

Run with:

  OPENSHELL_E2E_OIDC=1 OPENSHELL_E2E_OIDC_SCOPES=1 \
  PYTHONPATH=python uv run pytest e2e/python/oidc/ -v

* fix(docs): fix markdown lint errors in OIDC architecture docs

Add blank lines before lists and fenced code blocks to satisfy
markdownlint MD031 and MD032 rules.
2026-04-30 10:37:23 -07:00
jtoelke2 5c77b06124 ci: add OS-49 phase 5 shadow workflows (#1075)
Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>
2026-04-30 12:18:08 -05:00
Alexander Watson ebbd9dee5a docs(examples): add multi-agent notepad demo (#991)
Signed-off-by: Alexander Watson <zredlined@gmail.com>
2026-04-30 09:25:19 -07:00
jtoelke2 78f0b6fff7 ci(rust): keep sccache stats non-blocking 2026-04-29 21:20:43 -05:00
jtoelke2 a656ed7b91 ci(docker): use prebuilt Rust binaries by default (#1027)
* ci(docker): use prebuilt Rust binaries by default

Flip Docker image builds to consume staged native Rust artifacts, remove in-Docker Rust build stages, and publish per-arch images with a manifest merge.

Add local staging support for prebuilt gateway and sandbox binaries so development image builds continue to work without CI artifacts.

Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>

* ci(docker): address prebuilt build review feedback

* ci(rust): allow existing vfio complexity

* ci(rust): pin toolchain to 1.95

---------

Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>
2026-04-29 19:23:02 -05:00