Skip to content

Commit aa975cc

Browse files
rodbuttersmoezdildrewTaylorMutchsjenning
authored
Resync to v56 (#2)
* fix(ci): eliminate image-tag race between concurrent workflows (#1413) - Add publish-manifest input to docker-build.yml (default true); single-arch branch callers set it false so the merge job is skipped and the shared bare :SHA tag in GHCR is never written by branch workflows - branch-kubernetes-e2e: retag :SHA-amd64 to :SHA before kind load so Helm's image.tag matches what is loaded in kind containerd - branch-e2e: pass image-tag as :SHA-arm64 to e2e-test so the arch-specific GHCR tag is used directly without depending on the bare tag - bare :SHA in GHCR is now written only by test-gpu.yml (multi-arch build), eliminating the last-writer-wins race across concurrent workflows * test(server): cover service endpoint plaintext security (#1352) * test(server): cover service endpoint plaintext security * test(server): align tls test with from_files Option<&Path> signature TlsAcceptor::from_files now accepts the client CA path as Option<&Path> (per the require_client_auth refactor on main). Wrap the helper's CA path in Some(...) so the new plaintext-service-http tests compile after rebasing onto current main. --------- Co-authored-by: Taylor Mutch <[email protected]> * fix(cli): add auth and TLS support to completion client (#1489) * fix(scripts): use portable lowercase in normalize_bool for Bash 3.2 (#1493) * refactor(server): extract shared relay-await and sandbox-scan helpers (#1495) * fix(sandbox): skip fork-exec socket ambiguity test on SELinux-enforcing hosts (#1449) Exec'ing /bin/sleep (SELinux label bin_t) from a user_home_t test binary causes /proc/<pid>/exe readlink to return ENOENT on SELinux-enforcing hosts due to the cross-domain boundary. Skip the test at runtime when getenforce reports Enforcing. Also adds a ChildGuard drop guard for safe child cleanup on panic and increases the exec-detection deadline from 2s to 5s. Signed-off-by: Derek Carr <[email protected]> * fix(sandbox): allow first-label L7 host wildcards (#1304) * fix(sandbox): allow first-label L7 host wildcards * docs(sandbox): document L7 host wildcard contract + add OPA runtime tests - Add Host Wildcards section to architecture/security-policy.md describing accepted (first-label *, **, intra-label *-X) and rejected (bare, TLD, non-first-label, recursive-in-label) forms, and noting that wildcards never cross '.' boundaries. - Expand the policy-schema.mdx 'host' field description to reflect the same contract instead of only mentioning '*.example.com'. - Add OPA runtime tests asserting '*-aiplatform.googleapis.com' matches 'us-central1-aiplatform.googleapis.com' and does not match 'us-central1.aiplatform.googleapis.com' (cross-dot boundary). Locks validator/runtime alignment for intra-label wildcards. * chore: update mise lockfile * test(server): tolerate serialized inference upserts --------- Co-authored-by: John Myers <[email protected]> * feat(cli): add JSON/YAML output format to gateway list (#1500) Add -o/--output flag to `openshell gateway list` matching the existing sandbox list pattern, enabling machine-readable output for scripting. Signed-off-by: Florent Benoit <[email protected]> * refactor: deduplicate repeated patterns across crates (#1499) Remove ~280 lines of duplicated code across 30 files in 5 areas: - centered_rect: consolidate 5 identical TUI layout helpers into a single pub fn in openshell-tui/src/ui/mod.rs - server test helpers: replace ~100 inline Store::connect() calls with local test_store() helpers; deduplicate test_server_state() in grpc/service.rs to use the shared test_support version - rogue PKI: extract 20-line rogue CA+client cert generation block (duplicated in two integration tests) into generate_rogue_pki() in tests/common/mod.rs - provider tests: replace 8 identical 28-line test modules with a single macro_rules! test_discovers_env_credential! invocation - label constants: centralize openshell.ai/ container label keys in openshell-core::driver_utils; update Docker and Kubernetes drivers to import from there instead of redefining them locally * fix(ci): resolve mirror gate statuses for fork PRs (#1504) Signed-off-by: Piotr Mlocek <[email protected]> * fix(server): respect OPENSHELL_PODMAN_SOCKET env var in embedded driver (#1483) The env var was only wired up via clap in the standalone openshell-driver-podman binary. When the Podman driver runs embedded in the gateway, config came exclusively from TOML deserialization and the env var was never consulted. Apply it as a post-deserialization override, matching the existing OPENSHELL_K8S_WORKSPACE_DEFAULT_STORAGE_SIZE pattern. Closes #1446 * refactor(sandbox,driver-vm): Start moving to rustix (esp over libc unsafe) (#1505) In the Rust ecosystem there's largely three ways to do system calls: - raw libc - nix - rustix Of the three, libc is almost all `unsafe` and really 95% of use cases should be either nix or rustix. nix is the original one, but after having looked at the code of both, I think rustix is just better designed and organized. It's also reached 1.0, whereas nix is still making semver-breaking changes (in fact we're behind here in this project). Now in practice, we have both *transitively* in the depchain already, and that's true for quite a lot of projects. But I think rustix is better, so let's add rustix as a workspace dependency (process feature) and migrate a few use cases to it - it's especially better than the raw libc which is suprisingly widespread. If we agree to do this, then many other calls can be ported. Signed-off-by: Colin Walters <[email protected]> * fix(packaging): add upgrade migration docs and podman socket retry (#1507) After #1415 ships, users upgrading from previous releases need guidance on the gateway.env deprecation, port/bind/database path changes, and the podman.socket restart requirement. - docs(rpm): add 'Migrating from gateway.env' section to TROUBLESHOOTING covering backward compatibility, env-to-TOML key mapping, and three breaking changes (default port 8080->17670, bind address 0.0.0.0->127.0.0.1, database path move). Add podman.socket restart step to upgrade procedure. - docs(rpm): add upgrade callout to CONFIGURATION.md pointing at migration section. - fix(podman): retry PodmanComputeDriver ping up to 5 times with 2s delay to tolerate transient socket unavailability after package upgrades. The systemd unit uses Wants=podman.socket (not Requires) so the gateway can start while the socket is briefly re-activating after an RPM upgrade changes its unit file on disk. - chore(rpm): update EnvironmentFile comment in RPM spec to explain backward-compatibility intent. Signed-off-by: Adam Miller <[email protected]> * ci: deduplicate e2e workflows (#1512) Signed-off-by: Taylor Mutch <[email protected]> * feat(auth): per-sandbox authentication to gateway (#1404) * docs(sandboxes): add policy advisor guide (#1480) Signed-off-by: John Myers <[email protected]> * fix(docker): use host-gateway callbacks on macOS (#1516) * ci(e2e): load single-arch images into kind (#1518) Signed-off-by: Taylor Mutch <[email protected]> * docs(rfc): add sandbox resource requirements proposal (#1360) * docs(rfc): add sandbox resource requirements proposal Signed-off-by: Evan Lezar <[email protected]> * docs(rfc): finalize sandbox resource requirements --------- Signed-off-by: Evan Lezar <[email protected]> * ci(canary): keep helm jwt secret generation enabled (#1521) Signed-off-by: Taylor Mutch <[email protected]> * fix(cli): add json output for policy get (#1410) * fix(cli): add json output for policy get * test(cli): cover policy get full json output * fix(cli): address policy get json clippy --------- Co-authored-by: John Myers <[email protected]> * feat(providers): derive discovery from profiles (#1503) * feat(providers): derive discovery from profiles Signed-off-by: John Myers <[email protected]> * fix(providers): keep v2 discovery profile-only Signed-off-by: John Myers <[email protected]> * docs(providers): update providers v2 behavior Signed-off-by: John Myers <[email protected]> * fix(providers): make github profile read-only Signed-off-by: John Myers <[email protected]> --------- Signed-off-by: John Myers <[email protected]> * docs: update NemoClaw/OpenClaw references (#1529) * ci: seed shared Rust caches from main (#1530) * fix(release): build host Linux binaries with glibc floor (#1490) * fix(homebrew): repair local driver bootstrap state (#1527) * fix(homebrew): repair local driver bootstrap state * fix(bootstrap): satisfy default SAN doc lint * ci: install cargo-zigbuild from release binaries (#1533) * fix(cli): propagate --gateway-insecure to OIDC auth flows (#1535) Thread the gateway_insecure flag through gateway_add(), gateway_login(), and all OIDC HTTP clients so that --gateway-insecure and OPENSHELL_GATEWAY_INSECURE apply to OIDC discovery, token exchange, and token refresh requests. Previously, the flag only affected gRPC connections to the gateway. OIDC HTTP clients (reqwest::get and http_client) always verified TLS certificates, causing gateway registration and login to fail when the OIDC issuer used a self-signed certificate (common on OpenShift with edge-terminated routes). Fixes #1534 Signed-off-by: Adel Zaalouk <[email protected]> * ci(release): smoke test rpm artifacts on fedora (#1558) Signed-off-by: Piotr Mlocek <[email protected]> * chore(deps): bump docker/login-action from 4.1.0 to 4.2.0 (#1554) Bumps [docker/login-action](https://github.com/docker/login-action) from 4.1.0 to 4.2.0. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/4907a6ddec9925e35a0a9e82d7399ccc52663121...650006c6eb7dba73a995cc03b0b2d7f5ca915bee) --- updated-dependencies: - dependency-name: docker/login-action dependency-version: 4.2.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(helm): add missing SPDX header to gateway-config template (#1545) * chore(helm): add missing SPDX header to gateway-config template * chore(scripts): remove helm templates from license header exclusions The bypass had no known rationale. Removing it ensures the header script covers deploy/helm/openshell/templates uniformly going forward. Signed-off-by: mesutoezdil <[email protected]> --------- Signed-off-by: mesutoezdil <[email protected]> * ci(release): skip python rpm in gateway smoke test (#1559) Signed-off-by: Piotr Mlocek <[email protected]> * ci: pin azure/setup-helm and helm/kind-action to commit SHAs (#1544) * ci: pin azure/setup-helm and helm/kind-action to commit SHAs * chore(python): add py.typed marker for PEP 561 compliance * ci: use full semver in pinned action version comments Signed-off-by: mesutoezdil <[email protected]> --------- Signed-off-by: mesutoezdil <[email protected]> * refactor: deduplicate shared code across ocsf builders and driver crates (#1526) Extract repeated patterns into shared helpers: - Add impl_builder_setters! macro to openshell-ocsf/builders that generates the identical severity(), status(), and message() setter methods present on all 7 OCSF event builders - Add SandboxContext::apply_common_fields() to consolidate the four-line build() finalization (set_status, set_message, set_device, set_container) repeated in every builder - Add driver_utils::sandbox_token_path() to centralize the XDG state path construction for sandbox JWT files used by both the Docker and Podman drivers - Add driver_utils::build_capabilities_response() to eliminate the identical GetCapabilitiesResponse struct literal repeated across the Docker, Podman, and Kubernetes compute drivers * fix(python): raise SandboxError instead of FileNotFoundError or KeyError (#1547) * fix(python): raise SandboxError instead of FileNotFoundError or KeyError * fix(python): suppress exception chaining in SandboxError raises Add `from None` to both `raise SandboxError(...)` calls inside `except FileNotFoundError` blocks to satisfy ruff B904. * fix(scripts): replace mapfile with bash 3.2-compatible read loop in helm-k3s-local (#1539) macOS ships bash 3.2 which lacks mapfile/readarray. Replace all three occurrences in configure_ghcr_credentials, cluster_has_image, and cluster_image_platform with a portable while-read loop, consistent with the fix applied to docker-build-image.sh in #1334. * docs: add macOS compiler troubleshooting (#1569) Signed-off-by: Ann Marie Fred <[email protected]> * fix(gateway): configure local dev auth (#1575) This makes it so you can run the dev gateway and sandbox with: ``` mise run gateway # in another shell mise run sandbox ``` Signed-off-by: Kris Hicks <[email protected]> * docs: add Pi as supported sandbox (#1572) * fix(sandbox): add mechanistic smoke test for L4 deny and document the L4/L7 split (#1412) * fix(sandbox): add mechanistic smoke test for L4 deny and document the L4/L7 split The old smoke script exercised an L7 PUT which hung because the denial aggregator is only wired to L4 CONNECT denies, not L7 enforcement. Add mechanistic-smoke.sh which triggers an L4 deny, waits for the aggregator to flush, and asserts a pending chunk appears under openshell rule get --status pending. Document the intentional L4-only scope of the mechanistic mapper in architecture/sandbox.md. Fixes #1333 Signed-off-by: mesutoezdil <[email protected]> * refactor(smoke): remove redundant variable inits and merge double step call Signed-off-by: mesutoezdil <[email protected]> * fix(smoke): wire mechanistic smoke into mise and guard TMP_DIR - Initialize TMP_DIR before trap to prevent unbound variable on early exit - Add e2e:mechanistic-smoke mise task with gateway setup - Document mechanistic smoke in policy-advisor README * test(proxy): verify L4 deny enqueues a DenialEvent Signed-off-by: mesutoezdil <[email protected]> * fix(proxy): remove unnecessary path qualifications in L4 denial smoke test --------- Signed-off-by: mesutoezdil <[email protected]> * docs(readme): whitespace (#1578) Signed-off-by: Kris Hicks <[email protected]> * fix(cli): replace outdated name reference (#1582) Signed-off-by: Kris Hicks <[email protected]> * fix(sandbox): probe Landlock before build, skip on unsupported kernels (#1585) On kernels without Landlock (e.g. gVisor's sentry returns ENOSYS for syscall 444), the previous best_effort path still logged "Applying Landlock" + "Landlock ruleset built" events even though no enforcement was happening. Probe at the top of `landlock::prepare` and short-circuit with a single High-severity "Sandbox Unavailable" finding. Signed-off-by: Davanum Srinivas <[email protected]> * fix(sandbox): decouple GPU baseline from network policy (#1524) Signed-off-by: Evan Lezar <[email protected]> * docs(kubernetes): note that Sandbox volumeClaimTemplates is immutable (#1543) * fix(sandbox): use succinct endpoint denial reason (#1584) Signed-off-by: Kris Hicks <[email protected]> * feat(docker): add provisioning progress events (#1567) * docs(kubernetes): add RBAC section to setup page (#1540) Documents the ServiceAccount, Role, and ClusterRole created by the Helm chart inline on the setup page, per reviewer feedback on #1250. Reflects the current chart templates including pods/get for sandbox identity and tokenreviews/create for projected token validation. Closes #1018 * fix(sandbox): delegate PID limits to runtimes (#1497) Signed-off-by: mjamiv <[email protected]> * fix(gateway): make readiness health checks dependency-aware (#1328) * feat(gateway): add readiness probe metrics and test-only store close Emit Prometheus readiness metrics for database probes (healthy gauge and outcome-labeled latency histogram) with coverage in health HTTP tests. Restrict Store::close behind test support cfg to prevent accidental runtime pool shutdown under live traffic. Signed-off-by: Adrien Langou <[email protected]> * test(e2e): add simple e2e test with kubernetes to test /readyz Signed-off-by: Adrien Langou <[email protected]> --------- Signed-off-by: Adrien Langou <[email protected]> * fix(vm): scope rootfs cache by openshell version (#1587) Signed-off-by: Drew Newberry <[email protected]> * fix(cli): preserve symlinks during sandbox upload (#1595) * fix(cli): preserve symlinks during sandbox upload * docs(sandboxes): document upload symlink behavior * fix(core): preserve SSH gateway default ports (#1602) Signed-off-by: Taylor Mutch <[email protected]> * feat(server): declare gRPC auth (mode + scope + role) at the handler, enforce at the router (#1596) * feat(server): per-handler gRPC auth annotations Move scope, role, and auth-mode metadata to the handler definition site via #[rpc_authz] + #[rpc_auth] proc macros. The previously hand-maintained SCOPED_METHODS, ADMIN_METHODS, UNAUTHENTICATED_METHODS, and ALLOWED_SANDBOX_METHODS tables are now generated from per-method annotations on the tonic service impls, with canonical gRPC paths derived from the service name and method name. Adds a new openshell-server-macros proc-macro crate, an aggregator in auth/method_authz.rs, and an exhaustiveness test that decodes the protobuf FileDescriptorSet (now emitted by openshell-core/build.rs) and verifies every RPC has an annotation. Signed-off-by: Mrunal Patel <[email protected]> * refactor(server): rename `sandbox-secret` auth mode to `sandbox` PR #1404 replaced the shared sandbox secret with per-sandbox gateway-minted JWTs. A handler marked `sandbox` now authenticates as a specific `Principal::Sandbox`, not as a holder of a shared credential. Rename `auth = "sandbox-secret"` to `auth = "sandbox"` and `AuthMode::SandboxSecret` to `AuthMode::Sandbox` so the name matches the post-#1404 identity model. Signed-off-by: Mrunal Patel <[email protected]> * fix(server): enforce per-handler AuthMode at the router Addresses review feedback on the per-handler auth-annotation work. - Router-level enforcement of #[rpc_auth] auth mode (HIGH). The previous router only checked is_sandbox_callable() for Principal::Sandbox; user principals still flowed into AuthzPolicy::check() and bypassed the per-handler declaration. A user with `openshell:all` could therefore reach `sandbox`-only handlers like GetSandboxProviderEnvironment, ReportPolicyStatus, PushSandboxLogs, and SubmitPolicyAnalysis even though their annotations said sandbox-only. Adds an is_user_callable() predicate and rejects User principals at the router for `sandbox` / `unauthenticated` methods. - Proc macro now errors on duplicate keys in #[rpc_auth(...)] (LOW). A second `auth`, `scope`, or `role` previously silently overwrote the first value; now it fails to compile. - Regression tests: a unit test for is_user_callable() and a router test that proves a user with admin role + openshell:all cannot reach the nine sandbox-only handlers. Signed-off-by: Mrunal Patel <[email protected]> * docs(server): finish renaming sandbox-secret to sandbox in method_authz doc comments Signed-off-by: Mrunal Patel <[email protected]> * refactor(server-macros): drop standalone `rpc_auth` stub The stub was a safety net that fired only when a method had `#[rpc_auth(...)]` without an enclosing `#[rpc_authz]`. Triggering it required `rpc_auth` to be imported, which is why both call sites carried `#[allow(unused_imports)] use openshell_server_macros::{rpc_auth, rpc_authz};`. Drop the stub and the unused-import workaround. A missing `#[rpc_authz]` now surfaces as rustc's standard "cannot find attribute `rpc_auth` in this scope" — clear enough, and one fewer import + lint exception. Addresses review comment on PR #1596. Signed-off-by: Mrunal Patel <[email protected]> * refactor(server-macros): emit fixed `AUTH_METADATA` const per service The previous trait-derived const name turned `OpenShell` into `OPEN_SHELL_AUTH_METADATA`, splitting the project name across an underscore. Each impl already lives in its own module (`crate::grpc::`, `crate::inference::`), so the module path is enough to disambiguate between services — a fixed `AUTH_METADATA` name reads more naturally. Aggregator in `auth/method_authz.rs` now references `crate::grpc::AUTH_METADATA` and `crate::inference::AUTH_METADATA` directly. Addresses review comment on PR #1596. Signed-off-by: Mrunal Patel <[email protected]> * docs(server-macros): fix typo in AUTH_METADATA_CONST doc comment OpenShell is one word; reference name in the doc should be OPENSHELL_AUTH_METADATA, not OPEN_SHELL_AUTH_METADATA. Addresses review nit on PR #1596. Signed-off-by: Mrunal Patel <[email protected]> --------- Signed-off-by: Mrunal Patel <[email protected]> * ci(snap): add snap release pipeline (#1600) * docs: refresh landing terminal demo and apply NVIDIA fern theme (#1615) - Extract landing-page terminal demo into a reusable <CommandTerminal /> component with inline styles (no global CSS dependency) - Animate a second command line cycling through claude/opencode/codex via @keyframes scoped inside the component - Inline BadgeLinks layout styles so the component renders correctly without relying on .badge-links from main.css - Add jsx.d.ts shim so editors do not flag the React global in component TSX files - Switch fern instance to global-theme: nvidia with multi-source enabled - Bump fern CLI to 5.40.0 and drop the basepath-aware experimental flag - Register fern/components/ as a second mdx-components directory - Remove the unused Adobe analytics script tag * build(macos): remove unused import of tracing::warn (#1619) Signed-off-by: Calum Murray <[email protected]> * chore: align .python-version with mise.toml (#1618) Signed-off-by: Calum Murray <[email protected]> * feat(helm): add optional PostgreSQL backing store (#1579) * feat(helm): add optional PostgreSQL backing store with Secret-based credentials - Add postgres.enabled and postgres.deploy values to control database backend (SQLite vs PostgreSQL) and subchart deployment independently. - Introduce db-secret.yaml template for Opaque Secret with assembled postgresql:// connection string injected via OPENSHELL_DB_URL env var. - Add Bitnami PostgreSQL as optional subchart dependency keyed on postgres.deploy to prevent subchart deployment in external mode. - Externalize JWT signing key file mode via sandboxJwt.secretDefaultMode with 0400 default matching upstream. - Add validation guard for postgres.deploy=true without postgres.enabled. - Add helm unit tests covering internal, external, URL-override, special character encoding, and misconfiguration error paths. - Update README with Kubernetes and OpenShift install examples for bundled and external PostgreSQL configurations. - Add helm dependency build to lint and unittest tasks. * fix(helm): add database backend docs to README.md.gotmpl and regenerate The helm-docs CI check failed because the Database backend section was added directly to README.md instead of README.md.gotmpl. Move the content to the template and regenerate so the check passes. * fix(helm): use Secret-based DB credentials and support existingSecret Replace the inline db-url stringData pattern with a proper Secret containing individual fields plus a uri key. When postgres.deploy=true the Bitnami service-binding secret is referenced directly; when deploy=false users can supply postgres.external.existingSecret to bring their own Secret, or let the chart generate one from the external field values. Also restructures the README database section for clarity, adds helm-unittest coverage for the new secret resolution paths, and fixes a markdown lint issue in the root README. * refactor(helm): move OpenShift e2e script to e2e/rust/ and add mise task Move test-openshift-scenarios.sh from deploy/helm/openshell/ci/ to e2e/rust/e2e-openshift.sh, matching the existing e2e script naming convention. Register it as `e2e:openshift` in tasks/test.toml — not wired into the `test` or `e2e` aggregates so it only runs on explicit invocation against a live OpenShift cluster. * feat(e2e): add database backend scenarios to Kubernetes e2e Extend with-kube-gateway.sh with an optional multi-scenario loop gated by OPENSHELL_E2E_KUBE_DB_SCENARIOS=1. When enabled, the script installs the Helm chart three times — SQLite (default), bundled PostgreSQL, and external PostgreSQL with existingSecret — running the full test suite against each backend. When unset, existing single-install behavior is unchanged. Also adds helm dependency build before helm install, fixing CI failures caused by the missing PostgreSQL subchart dependency. * refactor(helm): simplify PostgreSQL config to two orthogonal controls Replace postgres.deploy and postgres.external.* with two simple controls: - postgres.enabled: deploy the bundled Bitnami PostgreSQL subchart - server.externalDbSecret: name of a pre-existing Secret with a uri key Delete db-secret.yaml — the chart no longer generates Secrets from individual credential fields. Users either get the Bitnami service-binding secret (bundled) or bring their own via server.externalDbSecret. Add validation that postgres.serviceBindings.enabled must stay true when using bundled PostgreSQL, preventing a confusing runtime failure. * docs(config): update gateway config reference (#1624) * feat(flake): add Nix development shell (#1592) * feat(build): add simple nix flake with formatter for nix code * feat(flake): setup rust toolchain, able to build and run unit tests * feat(flake): add support for arm linux and macos * feat(toolchain): add rust-src and rust-analyzer to the toolchain * refactor(proto): move phase and current_policy_version into status (#1565) * refactor(proto): move phase and current_policy_version into SandboxStatus Move phase and current_policy_version from SandboxSpec into SandboxStatus to correctly model mutable runtime state. Update all callers in the gateway server, TUI, and Python SDK to read and write these fields through SandboxStatus accessors. Signed-off-by: Derek Carr <[email protected]> * fix(server): preserve sandbox status on statusless driver updates When a driver update arrives without a status payload (e.g. before Kubernetes populates the status subresource), preserve the stored phase, conditions, and current policy version instead of resetting them. Adds a regression test covering the edge case. Signed-off-by: Derek Carr <[email protected]> --------- Signed-off-by: Derek Carr <[email protected]> * feat(python-sdk): support OIDC Bearer auth on SandboxClient (#1621) * feat(python-sdk): support OIDC Bearer auth on SandboxClient PR #1596 hardened the gateway side of the OIDC story; the Python SDK was the remaining gap — it only supported plaintext or mTLS, with no Bearer metadata anywhere. Deployments with OIDC enabled (the recommended posture since PR #935 / PR #1404) were unreachable from the SDK. Adds: - `bearer_token: str | Callable[[], str] | None` kwarg on `SandboxClient`. Static strings or zero-arg callables (the latter is invoked per RPC, so callers can drop in a refresh loop or token-file watcher without reconstructing the client). Composes with `tls` for OIDC-over-mTLS deployments. - `_BearerAuthInterceptor` implementing all four `grpc.{Unary,Stream}{Unary,Stream}ClientInterceptor` types. Appends `authorization: Bearer <token>` to outgoing metadata. Implemented as an interceptor (not call credentials) so it works on both plaintext (`disableTls=true` dev) and TLS channels without `grpc.composite_channel_credentials`. - `TlsConfig` ergonomics: all three fields (`ca_path`, `cert_path`, `key_path`) are now optional with `cert_path` / `key_path` required-together-or-not-at-all (enforced in `__post_init__`). This unlocks three transport profiles from one dataclass: * full mTLS (all three) * CA-only trust (`ca_path` only) * system roots (`TlsConfig()` — for OIDC gateways behind a public CA) - `from_active_cluster` mirrors `crates/openshell-tui/src/lib.rs` `build_oidc_channel`: * For any `https://` gateway, always build a secure channel. Pick the strongest TLS profile available in `mtls/` (full mTLS → CA-only → system roots). No more `insecure_channel` fallback for HTTPS. * Gate OIDC bearer attachment on `metadata.json["auth_mode"] == "oidc"`. Matches `crates/openshell-cli/src/main.rs:132` and the TUI; a stale `oidc_token.json` next to a non-OIDC gateway no longer causes the SDK to attach a bearer. - `_OidcRefresher` — thread-safe, in-process native OAuth2 refresh modeled on `google.oauth2.credentials.Credentials` and `botocore.tokens.SSOTokenProvider`. Lazily checks expiry on every RPC; when stale, re-reads disk first (the CLI may have rotated the bundle), and only then exchanges the refresh_token against the IdP's token endpoint discovered via OIDC discovery (`/.well-known/openid-configuration`, cached after first call). Concurrent RPCs share a single refresh via `threading.Lock` (no IdP stampede). Honors refresh-token rotation. Surfaces IdP failures as `SandboxError` with the RFC 6749 error body included for diagnostics. Mirrors the Rust CLI's HTTP-policy posture from `crates/openshell-cli/src/oidc_auth.rs`: * `follow_redirects=False` so a 3xx during discovery can't steer us to an attacker-controlled token endpoint. * Discovery `issuer` is validated against the configured issuer; a discovery document claiming a different issuer is rejected, preventing the SDK from POSTing the refresh_token to a malicious endpoint. * `insecure: bool` flag plumbed through to httpx's `verify=` so self-signed-cert deployments work the same way they do in the Rust CLI. Built on `httpx` (chosen over `urllib` specifically for follow_redirects + verify control as kwargs). The OAuth2 refresh-token grant itself (RFC 6749 §6) is one form-encoded POST — handled inline rather than via a dedicated OAuth library; tried `authlib`'s `OAuth2Client` first but it auto-injects an Authorization header on every request, which breaks the unauthenticated discovery GET. - `_make_cluster_bearer_provider(..., auto_refresh=True, write_back=True, insecure=False)` factory. Defaults to the refresher path with write-back enabled; `auto_refresh=False` falls back to the read-only fail-closed behavior for callers that don't want the SDK to make outbound HTTP calls to the IdP. `write_back=True` is the default (changed from the first round of review): IdPs with refresh-token rotation (Keycloak with rotation, Entra in strict mode) invalidate the old refresh_token on each refresh, so an in-memory-only refresh would leave the on-disk bundle pointing at an invalidated value — any second process starting from disk would `invalid_grant`. With write-back enabled by default, the SDK keeps the shared cache consistent with the IdP. - `from_active_cluster` exposes `auto_refresh`, `write_back`, and `insecure` kwargs (defaults: True / True / False). The high-level `Sandbox` context manager surfaces the same three kwargs and forwards them through, so callers using the wrapper have parity with `SandboxClient` for OIDC-protected gateways. - `SandboxClient.close()` chains to a `_bearer_close` hook so the `_OidcRefresher`'s underlying `httpx.Client` is released deterministically instead of leaking sockets/FDs until GC runs `__del__`. Idempotent. - `_OidcRefresher._write_to_disk` uses `tempfile.mkstemp` (PID + random suffix) instead of a fixed `.oidc_token.json.tmp` path, so two writers racing on the same gateway directory don't trample each other's tmp content. Success path atomically replaces; failure path unlinks the orphan. OAuth2 refresh policy and write-back semantics deliberately mirror what the major Python SDKs do — see github.com/googleapis/google-auth-library-python (`Credentials`) and github.com/boto/botocore (`SSOTokenProvider`): | Library | Native refresh | Writes back | |-------------------------------|----------------|-------------| | google-auth Credentials | yes | no | | botocore SSOTokenProvider | yes | yes | | openshell SandboxClient (here)| yes (opt-out) | yes (opt-out)| OpenShell sits between the two; chose write-back-by-default because the rotation invariant matters more for our deployments than the "CLI is the only writer" assumption that fits google-auth. Adds `httpx>=0.27` as a runtime dependency. No new OAuth2 library — the refresh grant is a single POST. Tested: - 42 sandbox_test.py tests pass (5 pre-existing + 37 new across the bearer interceptor, fail-closed provider, refresher behavior, TlsConfig validation, from_active_cluster auth ladder, security-review regressions, Sandbox-wrapper kwarg forwarding, and lifecycle / concurrency probes). `mise run test:python` → 47 passed total across the python suite. - `mise run python:lint` (ruff) clean. - End-to-end against a Keycloak-protected gateway on OpenShift: * unauthenticated `Health` bypass works * admin + `openshell:all` reaches user-callable methods * reader (`sandbox:read`) denied on `CreateSandbox` by scope * admin + `openshell:all` denied on PR #1596 sandbox-only methods at the router (the new gate is honored from the SDK) * full provider CRUD lifecycle via the SDK * callable token provider rotates per RPC as expected - Regression-probed against three pre-review security findings: * **Discovery issuer validation** — a discovery document claiming a different `issuer` than the configured one is rejected with a clear `SandboxError` before any refresh POST can reach the attacker-controlled endpoint. * **Redirect during discovery** — `follow_redirects=False` on the underlying httpx client means a 3xx during discovery surfaces as a SandboxError rather than silently chasing the redirect. * **Cross-process rotation** — a two-process simulation shows process B starting from disk and successfully refreshing with the rotated refresh_token, because process A's write-back updated the shared cache. - Refresher unit tests cover: cached-fresh fast path, disk-rotated re-read before refresh, OAuth2 exchange against the discovered token endpoint, refresh-token rotation, atomic write-back at 0600 mode (default), default-on write_back proven by test, concurrent N-thread coordination (one refresh shared across 8 threads), IdP failure surfaced with the error body, the client_credentials / no-refresh_token error path, issuer- mismatch rejection, redirect-during-discovery rejection, insecure flag plumbing. - Lifecycle / concurrency regression tests added: `close()` invokes the `_bearer_close` hook (idempotent), the refresher's `httpx.Client` is marked closed after `SandboxClient.close()`, and 16 concurrent writers don't leave orphan tmp files behind while producing a valid final bundle. The `Sandbox` wrapper has direct forwarding tests proving `auto_refresh`, `write_back`, and `insecure` reach `from_active_cluster` (both explicit values and defaults). - End-to-end against a real OpenShift + Keycloak cluster from inside a pod: real OIDC discovery against `keycloak.keycloak.svc.cluster.local:8080`, refresh-token grant POST, atomic write-back of the rotated bundle at 0600, and a follow-up RPC reusing the freshly-rotated in-memory token — full round-trip in ~170ms. Signed-off-by: Mrunal Patel <[email protected]> * fix(python-sdk): adopt newer on-disk OIDC bundle before refreshing _OidcRefresher.current_access_token() only adopted the on-disk oidc_token.json when its access token was still fresh; otherwise it refreshed using the in-memory bundle. With refresh-token rotation enabled (Keycloak with rotation, Entra strict mode), this let a process keep using an invalidated refresh_token: 1. Process A holds a stale in-memory bundle with refresh_token=r1. 2. Process B refreshes first and writes a rotated (r2) but now near-expiry bundle to disk. 3. Process A re-reads disk, sees the access token is not fresh, ignores the disk bundle, and POSTs the stale r1 — which the IdP has already invalidated, yielding invalid_grant. Fix: when the cached bundle is stale, adopt the on-disk bundle if it was refreshed more recently than ours, even when its access token is also stale. "More recently" is decided by expires_at — a refresh mints a new access token with a forward expiry alongside the rotated refresh_token, so the later expiry carries the newest refresh_token. Comparing by expiry (rather than unconditionally preferring disk) preserves the write_back=False case, where the in-memory bundle has already rotated past the on-disk copy and must not be clobbered. When the adopted bundle's issuer differs, the cached token endpoint is reset so the refresh re-discovers against the new issuer. Adds regression tests for the cross-process rotation race and the issuer-change re-discovery path. * fix(python-sdk): recover from invalid_grant on lost rotation race The expiry-based disk re-read narrows but does not fully close the cross-process refresh-token rotation race: two processes sharing a gateway directory can both enter their refresh window, both POST their copy of the refresh_token, and with rotation enabled the IdP invalidates the loser's token (invalid_grant). Neither google-auth nor botocore close this window without an OS file lock; a Python-only flock would not coordinate with the Rust CLI/TUI that also write oidc_token.json, so locking is not worth its cost here. Recover instead of prevent: distinguish an OAuth2 invalid_grant (the refresh_token was rejected) from transport/5xx failures via a private _InvalidGrantError, and on invalid_grant re-read oidc_token.json once. If a peer wrote a different refresh_token (it won the race), adopt and retry with it — returning early if it is already fresh — so the loser succeeds transparently instead of forcing a re-authenticate. If disk offers no new token, the rejection is genuine and surfaces the re-authenticate hint as before. The retry is single-shot; a second invalid_grant propagates. Adds tests for the peer-rotation recovery and the genuine-rejection (no-retry) paths. --------- Signed-off-by: Mrunal Patel <[email protected]> * fix(helm): vendor chart dependencies before release packaging (#1627) Signed-off-by: Taylor Mutch <[email protected]> * fix(driver-podman): bind gateway to 0.0.0.0 in rootless mode (#1623) Rootless Podman sandbox containers reach the host through pasta's local connection bypass, which translates L2 frames to L4 host sockets. The dev gateway script binds to 127.0.0.1 by default, which is not routable through pasta. Auto-detect rootless mode and bind to 0.0.0.0 so sandbox containers can connect to the gateway. - Auto-detect rootless Podman in gateway.sh and export OPENSHELL_BIND_ADDRESS=0.0.0.0 when not explicitly set - Add e2e:podman:rootless mise task and CI matrix entry to validate rootless Podman networking end-to-end - CI creates a non-root user inside the privileged container to trigger Podman's rootless code paths (pasta, user namespace isolation) Signed-off-by: Naveen Malik <[email protected]> * docs(providers): note that ANTHROPIC_API_KEY requires an API account, not a subscription (#1542) * docs(providers): note that ANTHROPIC_API_KEY requires an API account, not a subscription Anthropic subscription users authenticate via OAuth, not an API key, causing a silent failure when creating the provider. Adds a Note callout in the provider type table and quickstart guide directing subscription users to generate an API key from console.anthropic.com. Closes #620 * docs(providers): fix Note placement and remove subscription brand names Move the Note callout in manage-providers.mdx to after the complete provider type table so it does not break table rendering. Remove subscription brand names from both Note callouts. * fix(podman): avoid host-gateway on macOS machines (#1637) Closes #1307 Default the Podman host gateway alias override to gvproxy's host-loopback IP on macOS while preserving host-gateway resolution on Linux. Wire the setting through Podman config, gateway TOML inheritance, and the standalone driver, and document the platform behavior. Signed-off-by: Taylor Mutch <[email protected]> * chore(vm): generalize crate for multi-device PCIe passthrough (#1573) * generalize crate for multi-device PCIe passthrough Signed-off-by: Patrick Riel <[email protected]> * add adopt apis which allow for devices already bound to vfio-pci during restart reconciliation, without rebinding or mutating sysfs. Signed-off-by: Patrick Riel <[email protected]> * refactor(vfio): generalize GPU passthrough sysfs handling Signed-off-by: Patrick Riel <[email protected]> * fix(vfio): centralize vfio ID refcounting Signed-off-by: Evan Lezar <[email protected]> --------- Signed-off-by: Patrick Riel <[email protected]> Signed-off-by: Evan Lezar <[email protected]> Co-authored-by: Evan Lezar <[email protected]> * fix(sandbox): trust exact declared private endpoints (#1560) * fix(sandbox): trust exact declared private endpoints * fix(sandbox): preserve advisor endpoint provenance * fix(sandbox): repair advisor provenance lint failures --------- Co-authored-by: John Myers <[email protected]> * feat(policy): add agentic approval loop (#1528) * fix(e2e): clean up temp files in sandbox-runner on exit (#1647) * ci(kubernetes): add HA e2e workflow (#1598) Signed-off-by: Taylor Mutch <[email protected]> * ci(release): use bundled Z3 for macOS gateway build (#1658) * fix(gateway): align package TLS bootstrap path (#1601) * fix(gateway): align package TLS bootstrap path Closes #1593 Default package-managed gateway services to a stable local TLS directory and use that same value for certificate generation and runtime startup. Signed-off-by: Taylor Mutch <[email protected]> * test(packaging): validate package asset paths exist Signed-off-by: Taylor Mutch <[email protected]> * ci(e2e): pin mise in kubernetes job Signed-off-by: Taylor Mutch <[email protected]> --------- Signed-off-by: Taylor Mutch <[email protected]> * feat(tui): add PageUp/PageDown scrolling to all panes (#1656) Add PageUp/PageDown key support to the policy, logs, and draft/rules views. All three panes now scroll by one viewport height per keypress. Also fix scroll_policy() clamping to stop at the last viewport of content instead of the last line, preventing a blank-screen overshoot on G and PageDown. Signed-off-by: Major Hayden <[email protected]> * feat(telemetry): add anonymous opt-out OpenShell usage telemetry (#1433) * feat(telemetry): add anonymous opt-out usage telemetry Signed-off-by: Kirit93 <[email protected]> * Removed enums from schema Signed-off-by: Kirit Thadaka <[email protected]> * Updated telemetry URL Signed-off-by: Kirit93 <[email protected]> * ci(kubernetes): pin mise installer for e2e --------- Signed-off-by: Kirit93 <[email protected]> Signed-off-by: Kirit Thadaka <[email protected]> Co-authored-by: John Myers <[email protected]> * ci(release): gate helm/oci artifact publishing on release (#1662) release-helm and tag-ghcr-release now depend on the release job. This is to prevent a GHCR image or helm chart from being published when some other aspect of the release fails. Signed-off-by: Kris Hicks <[email protected]> * ci(kubernetes): stabilize HA e2e setup (#1659) * ci(kubernetes): pin mise in e2e workflow Signed-off-by: Taylor Mutch <[email protected]> * ci(kubernetes): mirror postgres image for ha e2e Signed-off-by: Taylor Mutch <[email protected]> * ci(kubernetes): reuse e2e workflow for ha Signed-off-by: Taylor Mutch <[email protected]> --------- Signed-off-by: Taylor Mutch <[email protected]> * fix(gateway): place supervisor_image under podman driver TOML table (#1661) The gateway.sh script appended supervisor_image after the [openshell.gateway.gateway_jwt] table header, so TOML parsed it as a gateway_jwt field. The Podman driver never saw the override and fell back to the default ghcr.io/nvidia/openshell/supervisor:latest. Move supervisor_image into [openshell.drivers.podman] where the driver config deserializer expects it. * refactor: deduplicate shared utilities across driver crates (#1660) Move three duplicated definitions into openshell-core so every consumer has a single canonical source: - format_bytes: identical 14-line function existed in docker, kubernetes, and vm drivers. Moved to openshell-core::progress where all three already imported from. - DEFAULT_SANDBOX_PIDS_LIMIT: i64 constant (2048) duplicated in docker driver and podman config. Moved to openshell-core::config alongside other shared defaults. Podman re-exports it for internal call-site compatibility. - current_time_ms: secrets.rs in openshell-sandbox reimplemented the same logic as openshell-core::time::now_ms(). Remove the local copy and call now_ms() directly via the existing dep. * fix(config): reject unknown fields in nested gateway config tables (#1666) * fix(config): reject unknown fields in nested gateway config tables The gateway TOML loader silently ignored keys placed under the wrong table header. PR #1661 fixed one instance of this (supervisor_image under [openshell.gateway.gateway_jwt]) but the root cause remained: the nested gateway config tables did not deny unknown fields, so a misplaced key was accepted and dropped instead of erroring. Concretely, tasks/scripts/gateway.sh emitted `sandbox_namespace` right after the [openshell.gateway.gateway_jwt] heredoc, so it landed inside the gateway_jwt table rather than [openshell.gateway]. The k8s driver already receives the namespace via [openshell.drivers.kubernetes], so the stray line was dead config that parsed without complaint. Changes: - Add #[serde(deny_unknown_fields)] to the nested gateway config tables that are part of the config-file parse tree: TlsConfig, OidcConfig, MtlsAuthConfig, GatewayAuthConfig, GatewayJwtConfig. - Remove the misplaced sandbox_namespace line from gateway.sh. - Drop the unused Serialize/Deserialize derives from Config and ServiceRoutingConfig (see below). - Add a regression test asserting a key under the wrong nested table is rejected. * feat(kubernetes): support sandbox image pull secrets (#1671) * refactor(driver): trim compute capability response (#1402) Signed-off-by: Evan Lezar <[email protected]> * feat(providers): add Google Vertex AI inference provider (#1568) * feat(providers): add Google Vertex AI provider Adds Vertex AI provider profiles, routing, credential refresh plumbing, CLI support, docs, and regression coverage. Keeps the related NETLINK_ROUTE seccomp allowance needed by Vertex client tooling that calls getifaddrs. * docs: add Vertex AI sandbox usage for Claude Code and OpenCode Cover the full end-to-end setup for running Claude Code and OpenCode inside an OpenShell sandbox via inference.local with a Vertex AI backend: - google-vertex-ai.mdx: add 'Use from a Sandbox' section with tabbed examples for Claude Code (--bare flag, no /v1 suffix) and OpenCode (/v1 suffix required). Add providers_v2_enabled prerequisite and --no-verify note for global region. Document policy proposals table covering metadata.google.internal (always blocked), downloads.claude.ai, and storage.googleapis.com. - inference-routing.mdx: expand 'Use the Local Endpoint' section with tabbed examples for Claude Code, OpenCode, Python OpenAI SDK, and Python Anthropic SDK. Add notes explaining the /v1 path suffix difference between clients. - supported-agents.mdx: update Claude Code and OpenCode rows to mention inference.local support and correct base URL requirements. * fix: address vertex review findings * test(sandbox): retry on spurious Ok in fork-exec ambiguity test On arm64 under heavy CI load, the /proc fd scan in find_socket_inode_owners can transiently miss the parent process's socket fd entry, returning only the child as an owner. This causes resolve_process_identity to return Ok (single owner, no ambiguity check fires) instead of the expected ambiguous-ownership Err. Extend the retry loop to also handle unexpected Ok results, mirroring the existing retry for transient Err results. 10 retries at 50ms gives a 500ms settling window, which is sufficient for procfs to stabilize on loaded arm64 runners. * fix: address vertex review regressions * docs(router): clarify stream_response semantics for Vertex rawPredict routing Document the three call sites of prepare_backend_request and their stream_response values in a caller table: - send_backend_request: false → :rawPredict (unary endpoint) - send_backend_request_streaming: true → :streamRawPredict - verify_backend_endpoint: explicitly false to probe the unary endpoint Cross-reference the table from build_provider_url and is_vertex_anthropic_rawpredict_route so the stream_response=true guard in the suffix upgrade branch is understood in full context. Also note that is_vertex_anthropic_rawpredict_route is a structural predicate (model_in_path + anthropic_messages + :rawPredict suffix), not a named-provider check, so any future provider with the same route shape inherits the transforms automatically. * fix: correct example paths in local-inference README (#1676) * fix: correct example paths in local-inference README * fix: correct example paths in local-inference routes.yaml * ci(release): bring Fedora RPM canary to parity (#1688) The RPM canary needs to exercise the install.sh user-service path, but a GitHub Actions job container does not boot with systemd as PID 1. The Fedora RPM canary needs to exercise the install.sh user-service path, but a GitHub Actions job container does not boot with systemd as PID 1. This means the Fedora RPM canary was incomplete as compared to the others. With this change, we run Fedora as a nested privileged systemd container instead, wait for systemd to become reachable, then start the root user manager so systemctl --user works for the RPM gateway unit, achieving parity with the other canary tests. Signed-off-by: Kris Hicks <[email protected]> * fix: update RFC link in agent-driven-policy-management README (#1677) * feat(providers): add profile-backed policy visibility (#1640) * chore: wip providers v2 tui and codex profile * chore: wip effective policy get and codex profile * chore: wip provider profiles and tui detail views * feat(tui): annotate policy proposal review status * ci(release): fix Ubuntu Snap canary install and registration (#1699) Install the Snap built by the triggering Release Dev workflow by setting merge-multiple: true on the artifact download. actions/download-artifact otherwise extracts each artifact into its own subdirectory, leaving the package at release/snap-linux-amd64/*.snap, so the install glob ./release/*.snap matched nothing. Merging flattens the artifact's contents directly into release/ where the dangerous local snap install expects it. Harden the Snap canary setup by enabling snapd.socket, waiting for snap seeding (snap wait system seed.loaded), and running every step with strict shell options (set -euo pipefail) so failures surface immediately. Register the snapped gateway with the CLI as the documented local plaintext snap-docker gateway, and print version and snap services, before running openshell status so the canary verifies a configured and reachable gateway instead of only the install. Signed-off-by: Kris Hicks <[email protected]> * feat(snap): add openshell.term desktop app (#1693) Add a desktop launcher for the OpenShell TUI so users can launch "openshell term" from their desktop environment application menu. The change adds three files: - snap/local/term.desktop: desktop entry file for the application launcher - snap/local/icon.png: application icon (copied from snap store data) - snapcraft.yaml: new "term" app entry that runs "openshell term" with home, network, ssh-keys, and system-observe plugs, plus install rules to stage the desktop file and icon under meta/gui/ The desktop file references the icon via ${SNAP} which is resolved at runtime to the snap installation directory. The term app reuses the same connection plugs as the main openshell app. Signed-off-by: Zygmunt Krynicki <[email protected]> * fix(sandbox): restore GPU procfs baseline (#1522) Signed-off-by: Evan Lezar <[email protected]> * fix(gateway): try harder to detect Podman (#1536) Auto-detection previously treated Podman as available only when the podman CLI was visible on PATH. However, package manager services can run with a restricted PATH, which lets Docker be selected even when a Podman API socket is reachable. Additionally, podman may symlink /var/run/docker.sock to podman's machine unix socket, which would be incorrectly detected as Docker. Worse still: the podman machine may not even be running. This replaces the Podman binary check with a functional HTTP probe against the standard Podman socket paths. The probe requires /_ping to answer with a Libpod-Api-Version header before treating the socket as Podman, which lets the gateway select the embedded Podman driver only when the API is usable. Signed-off-by: Kris Hicks <[email protected]> * chore(mise): refresh tool lockfile (#1712) Signed-off-by: Kris Hicks <[email protected]> * ci(release): authenticate snap canary artifact download (#1711) The Ubuntu Snap canary downloads its artifact from a different workflow run (the triggering Release Dev run) via run-id. Cross-run downloads require authentication, so pass github.token to actions/download-artifact. Signed-off-by: Kris Hicks <[email protected]> * docs(container-gateway): fix Docker driver setup for containerized gateway (#1419) The existing docs omitted or misstated several requirements when running the gateway as a container with the Docker compute driver: - OPENSHELL_GRPC_ENDPOINT is required; the Docker driver uses only the scheme (http/https) — host and port are substituted automatically with host.openshell.internal and the gateway's own bind port - Supervisor binary must be extracted to a host path before starting the gateway; bind-mount sources are resolved by the host Docker daemon so the path must be identical inside and outside the gateway container - Docker socket access requires adding the docker group (UID 1000 default) - Port binding should remain 127.0.0.1; Docker driver adds a bridge listener automatically - add --server-san host.openshell.internal to generate-certs for mTLS - Complete the mTLS docker run with all Docker driver requirements - Add deploy/docker/gateway.toml — TOML config for the Docker driver - Add deploy/docker/docker-compose.yml referencing the TOML - Add docs/get-started/tutorials/docker-compose.mdx tutorial page - Remote gateway registration instructions (--remote flag) Address reviewer feedback: - Move Docker Compose tutorials card to the bottom of the list - Replace inline YAML snippet in Docker Compose section with a reference to deploy/docker/ to avoid drift - Clarify OPENSHELL_DB_URL is safe in compose.yml (plain SQLite path, no credentials); the TOML block targets credential-bearing DSNs - Note that ./ in source: resolves relative to the compose file directory - Clarify that only the scheme from OPENSHELL_GRPC_ENDPOINT matters - Add note that the tilde volume mount resolves to the same absolute path on both host and container * refactor(server): deduplicate test helpers and grpc utilities (#1708) Remove three groups of copy-pasted code in openshell-server: 1. grpc/mod.rs had a private current_time_ms() wrapper identical to the one already exported from persistence/mod.rs. Remove the duplicate and update the three grpc sub-modules (policy, sandbox, service) to import directly from crate::persistence. 2. test_store() was repeated verbatim in seven #[cfg(test)] blocks. Promote a single canonical version to persistence/mod.rs (cfg-gated) and replace all copies with crate::persistence::test_store() calls or a thin Arc wrapper in supervisor_session. 3. grpc_client_mtls() and build_tls_root() were copy-pasted across edge_tunnel_auth.rs and multiplex_tls_integration.rs. Move both into the existing tests/common/mod.rs shared module and import from there. * fix(gateway): allow local sandbox jwt to not expire (#1721) * fix(helm): create sandbox JWT secret when cert-manager is enabled (#1700) * fix(helm): create sandbox JWT secret under cert-manager The cert-manager install path (certManager.enabled=true, pkiInitJob.enabled=false) left the gateway StatefulSet unable to start because nothing created the openshell-jwt-keys Secret: cert-manager owns TLS Secrets but does not mint the sandbox JWT signing key, and the certgen hook only rendered when pkiInitJob.enabled was true. Separate JWT signing-key provisioning from TLS PKI provisioning: - certgen: add a --jwt-only mode that creates only the Opaque JWT signing Secret, for use when another controller owns TLS Secrets. - certgen.yaml: render the hook when pkiInitJob.enabled OR certManager.enabled is true. cert-manager takes precedence and runs the hook with --jwt-only even if pkiInitJob.enabled remains true. Remove the mutual-exclusion failure between the two values. - _helpers.tpl: add openshell.sandboxJwtSecretName, shared by the hook and the StatefulSet mount. - Update values, README, docs, architecture, and the debug-openshell-cluster skill to reflect the new precedence; the documented cert-manager install no longer needs pkiInitJob.enabled=false. Closes #1691 * fix(helm): honor cert-manager precedence for client CA volume The client CA volume logic treated pkiInitJob.enabled as proof that built-in PKI owns the client CA. With cert-manager precedence now allowing certManager.enabled=true alongside the default pkiInitJob.enabled=true, that assumption mounts the server TLS cert secret as the client CA and ignores certManager.clientCaFromServerTlsSecret=false, which can break mTLS or trust the wrong CA. Gate the pkiInitJob.enabled term with (not certManager.enabled) in all three client CA conditions (volume mount, volume definition, and secret selection) so cert-manager owns TLS when enabled. Add a Helm test suite covering built-in PKI, cert-manager shared CA, the regression config (cert-manager + clientCaFromServerTlsSecret=false + default pkiInitJob), and the no-client-CA case. * feat(k8s-driver): add default_runtime_class_name config for sandbox pods (#1729) Allow operators to configure a default Kubernetes runtimeClassName that is applied to sandbox pods when the CreateSandbox request does not specify one. This avoids requiring every API caller to explicitly set the runtime class for clusters that always need a specific RuntimeClass (e.g. kata-containers, nvidia). The fallback is applied in the Kubernetes driver only — per-request values still take priority, and an empty default (the built-in) preserves existing behavior (field omitted, cluster default applies). * docs: add Hermes Agent to supported agents (#1735) * fix(cli): roll back gateway registration when auth fails during gateway add (#1538) * refactor: deduplicate shared driver and TUI helpers (#1741) * feat(cli): support multiple --upload flags on sandbox create (#1635) (#1645) Closes #1635 Signed-off-by: Philippe Martin <[email protected]> * updates for new containers --------- Signed-off-by: Derek Carr <[email protected]> Signed-off-by: Florent Benoit <[email protected]> Signed-off-by: Piotr Mlocek <[email protected]> Signed-off-by: Colin Walters <[email protected]> Signed-off-by: Adam Miller <[email protected]> Signed-off-by: Taylor Mutch <[email protected]> Signed-off-by: John Myers <[email protected]> Signed-off-by: Evan Lezar <[email protected]> Signed-off-by: Adel Zaalouk <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: mesutoezdil <[email protected]> Signed-off-by: Ann Marie Fred <[email protected]> Signed-off-by: Kris Hicks <[email protected]> Signed-off-by: Davanum Srinivas <[email protected]> Signed-off-by: mjamiv <[email protected]> Signed-off-by: Adrien Langou <[email protected]> Signed-off-by: Drew Newberry <[email protected]> Signed-off-by: Mrunal Patel <[email protected]> Signed-off-by: Calum Murray <[email protected]> Signed-off-by: Naveen Malik <[email protected]> Signed-off-by: Patrick Riel <[email protected]> Signed-off-by: Major Hayden <[email protected]> Signed-off-by: Kirit93 <[email protected]> Signed-off-by: Kirit Thadaka <[email protected]> Signed-off-by: Zygmunt Krynicki <[email protected]> Signed-off-by: Philippe Martin <[email protected]> Co-authored-by: Mesut Oezdil <[email protected]> Co-authored-by: Drew Newberry <[email protected]> Co-authored-by: Taylor Mutch <[email protected]> Co-authored-by: Seth Jennings <[email protected]> Co-authored-by: Florent BENOIT <[email protected]> Co-authored-by: Eric Curtin <[email protected]> Co-authored-by: Derek Carr <[email protected]> Co-authored-by: mjamiv <[email protected]> Co-authored-by: John Myers <[email protected]> Co-authored-by: Piotr Mlocek <[email protected]> Co-authored-by: Russell Bryant <[email protected]> Co-authored-by: Colin Walters <[email protected]> Co-authored-by: Adam Miller <[email protected]> Co-authored-by: Taylor Mutch <[email protected]> Co-authored-by: Evan Lezar <[email protected]> Co-authored-by: Adel Zaalouk <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ann Marie Fred <[email protected]> Co-authored-by: krishicks <[email protected]> Co-authored-by: Vegard Stikbakke <[email protected]> Co-authored-by: krishicks <[email protected]> Co-authored-by: Davanum Srinivas <[email protected]> Co-authored-by: alangou <[email protected]> Co-authored-by: Mrunal Patel <[email protected]> Co-authored-by: Andrew Schilling <[email protected]> Co-authored-by: Calum Murray <[email protected]> Co-authored-by: Saurabh Agarwal <[email protected]> Co-authored-by: Simon Scatton <[email protected]> Co-authored-by: Naveen Malik <[email protected]> Co-authored-by: Patrick Riel <[email protected]> Co-authored-by: Alexander Watson <[email protected]> Co-authored-by: Major Hayden <[email protected]> Co-authored-by: Kirit Thadaka <[email protected]> Co-authored-by: Jesse Jaggars <[email protected]> Co-authored-by: Zygmunt Krynicki <[email protected]> Co-authored-by: shannonsands <[email protected]> Co-authored-by: Philippe Martin <[email protected]>
1 parent b01c346 commit aa975cc

363 files changed

Lines changed: 42746 additions & 8184 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/build-from-issue/SKILL.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ In the prompt, instruct the reviewer to:
148148
- **Medium**: Multiple files/components, some design decisions, but well-scoped
149149
- **High**: Cross-cutting changes, architectural decisions needed, significant unknowns
150150
8. Call out risks, unknowns, and decisions that need stakeholder input.
151-
9. Assess **LSM compatibility** — if the change touches process identity, `/proc` filesystem access, binary execution, or inter-process visibility, flag whether it will behave differently on hosts running SELinux (enforcing) or AppArmor. In particular, tests that fork+exec into system binaries will fail on SELinux-enforcing hosts due to cross-label `/proc/<pid>/exe` access restrictions.
151+
9. Assess **gateway config documentation impact** — if the change adds, removes, renames, or changes defaults for gateway TOML keys or driver-specific config options, the plan must include an update to `docs/reference/gateway-config.mdx`. If the change is surfaced through Helm or a compute-driver overview, also include `docs/reference/sandbox-compute-drivers.mdx` or the relevant deployment docs.
152+
10. Assess **LSM compatibility** — if the change touches process identity, `/proc` filesystem access, binary execution, or inter-process visibility, flag whether it will behave differently on hosts running SELinux (enforcing) or AppArmor. In particular, tests that fork+exec into system binaries will fail on SELinux-enforcing hosts due to cross-label `/proc/<pid>/exe` access restrictions.
152153

153154
### A2: Post the Plan Comment
154155

@@ -436,6 +437,13 @@ Review the documentation requirements in `AGENTS.md` and update any affected
436437
docs as part of the implementation. Keep documentation changes scoped to the
437438
behavior or subsystem that changed.
438439

440+
If the implementation changes gateway TOML parsing, `[openshell.gateway]`
441+
fields, `[openshell.drivers.<name>]` fields, driver config defaults, or Helm
442+
rendering of `gateway.toml`, update `docs/reference/gateway-config.mdx` in the
443+
same branch. If the change affects user-facing compute-driver setup, also
444+
update `docs/reference/sandbox-compute-drivers.mdx` or the relevant deployment
445+
page.
446+
439447
### Step 12: Commit and Push
440448

441449
Commit all changes using conventional commit format. The `<type>` comes from the issue type in the plan:

‎.agents/skills/create-github-pr/SKILL.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ Create pull requests on GitHub using the `gh` CLI.
1515

1616
## Before Creating a PR
1717

18+
### Check Config Documentation
19+
20+
If the branch changes gateway TOML parsing, `[openshell.gateway]` fields,
21+
`[openshell.drivers.<name>]` fields, driver config defaults, or Helm rendering
22+
of `gateway.toml`, verify that `docs/reference/gateway-config.mdx` is updated
23+
in the same branch. If the change affects user-facing compute-driver setup,
24+
also update `docs/reference/sandbox-compute-drivers.mdx` or the relevant
25+
deployment docs.
26+
1827
### Run Pre-commit Checks
1928

2029
Run the local pre-commit task before opening a PR:

‎.agents/skills/create-spike/SKILL.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ The prompt to the reviewer **must** instruct it to:
9191

9292
9. **Check architecture docs** in the `architecture/` directory for relevant documentation about the affected subsystems.
9393

94-
10. **Assess Linux Security Module (LSM) impact.** If the change involves process identity, `/proc` filesystem access, file labeling, binary execution, or inter-process visibility, call out whether it will behave differently on hosts running SELinux (enforcing) or AppArmor. For example: reading `/proc/<pid>/exe` across an SELinux domain boundary returns ENOENT, not EACCES. Tests that fork+exec into system binaries (different SELinux label) will fail on enforcing hosts. Flag any LSM-sensitive code paths and recommend mitigations.
94+
10. **Assess gateway config documentation impact.** If the change would add, remove, rename, or change defaults for gateway TOML keys or driver-specific config options, call out that `docs/reference/gateway-config.mdx` must be updated. If the change is surfaced through Helm or compute-driver setup docs, call out the relevant deployment or compute-driver docs too.
9595

96-
11. **Determine the issue type:** `feat`, `fix`, `refactor`, `chore`, `perf`, or `docs`.
96+
11. **Assess Linux Security Module (LSM) impact.** If the change involves process identity, `/proc` filesystem access, file labeling, binary execution, or inter-process visibility, call out whether it will behave differently on hosts running SELinux (enforcing) or AppArmor. For example: reading `/proc/<pid>/exe` across an SELinux domain boundary returns ENOENT, not EACCES. Tests that fork+exec into system binaries (different SELinux label) will fail on enforcing hosts. Flag any LSM-sensitive code paths and recommend mitigations.
97+
98+
12. **Determine the issue type:** `feat`, `fix`, `refactor`, `chore`, `perf`, or `docs`.
9799

98100
### What makes a good investigation prompt
99101

‎.agents/skills/debug-openshell-cluster/SKILL.md‎

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,40 @@ kubectl -n openshell rollout status statefulset/openshell
138138

139139
Look for failed installs, unexpected values, missing namespace, wrong image tag, TLS settings that do not match the registered endpoint, and scheduling failures.
140140

141+
For HA or PostgreSQL-backed installs, also check the service-binding Secret and
142+
bundled PostgreSQL workload:
143+
144+
```bash
145+
kubectl -n openshell get secret -l app.kubernetes.io/instance=openshell
146+
kubectl -n openshell get statefulset,pod,pvc -l app.kubernetes.io/instance=openshell
147+
kubectl -n openshell logs statefulset/openshell-postgres --tail=200
148+
```
149+
141150
Check required Helm deployment secrets:
142151

143152
```bash
144153
kubectl -n openshell get secret \
145154
openshell-server-tls \
146155
openshell-server-client-ca \
147-
openshell-client-tls
156+
openshell-client-tls \
157+
openshell-jwt-keys
148158
```
149159

160+
In cert-manager installs, `certManager.enabled=true` makes cert-manager own TLS
161+
generation. The Helm chart should still render the `openshell-certgen`
162+
pre-install/pre-upgrade hook in JWT-only mode to create `openshell-jwt-keys`,
163+
even if `pkiInitJob.enabled` remains true.
164+
If the gateway pod is pending with `MountVolume.SetUp failed for volume
165+
"sandbox-jwt"` and `openshell-jwt-keys` is absent, inspect the rendered
166+
`templates/certgen.yaml` output and the hook Job logs; cert-manager creates TLS
167+
Secrets but does not create the sandbox JWT signing Secret.
168+
169+
If the gateway exits with `failed to read sandbox JWT signing key from
170+
/etc/openshell-jwt/signing.pem`, verify that `openshell-jwt-keys` contains
171+
`signing.pem`, `public.pem`, and `kid`, and that the StatefulSet mounts the
172+
`sandbox-jwt` secret at `/etc/openshell-jwt`. The sandbox JWT mount is required
173+
even when local Helm values disable TLS.
174+
150175
Check the image references currently used by the gateway deployment:
151176

152177
```bash
@@ -205,6 +230,18 @@ helm -n openshell get values openshell | grep sandboxNamespace
205230

206231
Then inspect sandbox resources in that namespace.
207232

233+
Check the configured sandbox service account when TokenReview bootstrap or
234+
sandbox registration fails. Helm creates a dedicated sandbox service account by
235+
default and writes it to `[openshell.drivers.kubernetes].service_account_name`;
236+
the gateway rejects projected tokens from other service accounts.
237+
238+
```bash
239+
helm -n openshell get values openshell | grep -A3 sandboxServiceAccount
240+
kubectl -n <sandbox-namespace> get serviceaccount openshell-sandbox
241+
kubectl -n openshell get configmap openshell-config -o jsonpath='{.data.gateway\.toml}'
242+
kubectl -n <sandbox-namespace> get sandbox <sandbox-name> -o jsonpath='{.spec.template.spec.serviceAccountName}{"\n"}'
243+
```
244+
208245
### Step 6: Check VM-Backed Gateways
209246

210247
Use the VM driver logs and host diagnostics available in the user's environment. Verify:

‎.agents/skills/helm-dev-environment/SKILL.md‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: helm-dev-environment
3-
description: Start up, tear down, and configure the local Kubernetes development environment for OpenShell. Uses k3d (Docker-backed k3s) + Skaffold + Helm. Covers cluster lifecycle, optional add-ons (Keycloak OIDC, Envoy Gateway), and port mappings. Trigger keywords - local k8s, local cluster, k3d, skaffold, helm dev, start cluster, stop cluster, tear down cluster, delete cluster, create cluster, helm:k3s, helm:skaffold, local dev environment, dev cluster, k8s dev, envoy gateway local, keycloak local.
3+
description: Start up, tear down, and configure the local Kubernetes development environment for OpenShell. Uses k3d (Docker-backed k3s) + Skaffold + Helm. Covers cluster lifecycle, optional add-ons (Keycloak OIDC, Envoy Gateway), HA testing, and port mappings. Trigger keywords - local k8s, local cluster, k3d, skaffold, helm dev, start cluster, stop cluster, tear down cluster, delete cluster, create cluster, helm:k3s, helm:skaffold, local dev environment, dev cluster, k8s dev, envoy gateway local, keycloak local, high availability, HA.
44
---
55

66
# Helm Dev Environment
@@ -26,8 +26,9 @@ mise run helm:k3s:create
2626
```
2727

2828
Creates a k3d cluster and merges its kubeconfig into the worktree-local `kubeconfig` file.
29-
Also applies base manifests (`deploy/kube/manifests/agent-sandbox.yaml`). Traefik is
30-
disabled at cluster creation time.
29+
Also applies base manifests (`deploy/kube/manifests/agent-sandbox.yaml`) and preloads the
30+
default community sandbox image into k3d so the first sandbox create does not wait on a
31+
large registry pull. Traefik is disabled at cluster creation time.
3132

3233
**Multi-worktree support:** the cluster name is derived from the last component of the
3334
current git branch (e.g. branch `kube-support/local-dev/tmutch` → cluster
@@ -43,6 +44,8 @@ Port mappings created at cluster time (cannot be changed without recreating):
4344

4445
Override with env vars before running `helm:k3s:create`:
4546
- `HELM_K3S_LB_HOST_PORT` (default: `8080`)
47+
- `HELM_K3S_PRELOAD_SANDBOX_IMAGE` (default:
48+
`ghcr.io/nvidia/openshell-community/sandboxes/base:latest`; set to an empty value to skip)
4649

4750
### 2. Deploy OpenShell
4851

@@ -62,6 +65,10 @@ generates mTLS secrets on first install. Envoy Gateway opt-in; see the Optional
6265

6366
The gateway Service uses ClusterIP. Access is via Envoy Gateway (port `8080`) or `kubectl port-forward`.
6467

68+
**HA test deploy** (two gateway replicas + bundled PostgreSQL): uncomment
69+
`#- ci/values-high-availability.yaml` in `deploy/helm/openshell/skaffold.yaml`,
70+
then run `mise run helm:skaffold:run` or `mise run helm:skaffold:dev`.
71+
6572
### TLS behaviour
6673

6774
`ci/values-skaffold.yaml` sets `server.disableTls: true`, so Skaffold-based deploys run
@@ -195,6 +202,7 @@ mise run helm:k3s:status
195202
| `deploy/helm/openshell/ci/values-skaffold.yaml` | Dev overrides (image pull policy, TLS disabled for local Skaffold) |
196203
| `deploy/helm/openshell/ci/values-cert-manager.yaml` | cert-manager PKI overlay (opt-in; disables pkiInitJob) |
197204
| `deploy/helm/openshell/ci/values-gateway.yaml` | Envoy Gateway GRPCRoute + Gateway overlay |
205+
| `deploy/helm/openshell/ci/values-high-availability.yaml` | HA test overlay (`replicaCount: 2` with bundled PostgreSQL) |
198206
| `deploy/helm/openshell/ci/values-keycloak.yaml` | Keycloak OIDC overlay |
199207
| `deploy/helm/openshell/ci/values-tls-disabled.yaml` | Lint-only: TLS + auth disabled (reverse-proxy edge termination) |
200208
| `deploy/kube/manifests/envoy-gateway-openshell.yaml` | GatewayClass for Envoy Gateway (`mise run helm:gateway:apply`) |

‎.agents/skills/test-release-canary/SKILL.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ helm install openshell oci://ghcr.io/nvidia/openshell/helm-chart \
8383
--version 0.0.0-dev \
8484
--namespace openshell --create-namespace \
8585
--set server.disableTls=true \
86-
--set pkiInitJob.enabled=false \
8786
--wait --timeout 5m
8887
8988
kubectl wait --namespace openshell \
@@ -96,6 +95,10 @@ openshell gateway add http://127.0.0.1:8080 --local --name kind
9695
openshell status
9796
```
9897

98+
Keep `pkiInitJob.enabled=true` (the chart default), even when
99+
`server.disableTls=true`. The hook also generates the sandbox JWT signing
100+
secret that the gateway pod always mounts.
101+
99102
Swap `0.0.0-dev` for `0.0.0-dev.<sha>` to pin to a specific dev build. Tear down with `kind delete cluster --name release-canary-local`.
100103

101104
Loopback registration auto-derives the gateway name to `openshell` if `--name` is omitted, which collides with the `install.sh`-installed local gateway — always pass `--name kind` (or another distinct name) when registering in addition to a local install.

‎.agents/skills/update-docs/SKILL.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ git log -50 --oneline --no-merges
3434
Filter to commits that are likely to affect docs. Look for these signals:
3535

3636
1. **Commit type**: `feat`, `fix`, `refactor`, `perf` commits often change behavior. `docs` commits are already doc changes. `chore`, `ci`, `test` commits rarely need doc updates.
37-
2. **Files changed**: Changes to `crates/openshell-cli/`, `python/`, `proto/`, `deploy/`, or policy-related code are high-signal.
37+
2. **Files changed**: Changes to `crates/openshell-cli/`, `python/`, `proto/`, `deploy/`, gateway config parsing, driver config structs, or policy-related code are high-signal.
3838
3. **Ignore**: Changes limited to `tests/`, `e2e/`, `.github/`, `tasks/`, or internal-only modules.
3939

4040
```bash
@@ -52,6 +52,10 @@ For each relevant commit, determine which doc page(s) it affects. Use this mappi
5252
| `crates/openshell-cli/` (sandbox commands) | `docs/sandboxes/manage-sandboxes.mdx` |
5353
| `crates/openshell-cli/` (provider commands) | `docs/sandboxes/manage-providers.mdx` |
5454
| `crates/openshell-cli/` (new top-level command) | May need a new page or `docs/reference/` entry |
55+
| `crates/openshell-server/src/config_file.rs` or gateway TOML parsing | `docs/reference/gateway-config.mdx` |
56+
| `crates/openshell-server/src/cli.rs` gateway config merge/default behavior | `docs/reference/gateway-config.mdx` |
57+
| `crates/openshell-driver-*/` config structs or driver defaults | `docs/reference/gateway-config.mdx`, `docs/reference/sandbox-compute-drivers.mdx` |
58+
| `deploy/helm/openshell/templates/gateway-config.yaml` | `docs/reference/gateway-config.mdx`, `docs/reference/sandbox-compute-drivers.mdx`, Helm docs if values change |
5559
| Proxy or policy code | `docs/sandboxes/policies.mdx`, `docs/reference/policy-schema.mdx` |
5660
| Inference code | `docs/inference/configure.mdx` |
5761
| `python/` (SDK changes) | `docs/reference/` or `docs/get-started/quickstart.mdx` |

‎.github/actions/pr-gate/action.yml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ outputs:
1616
should_run:
1717
description: "true if the workflow should proceed, false otherwise"
1818
value: ${{ steps.gate.outputs.should_run }}
19+
labels_json:
20+
description: "JSON array of PR label names for push-triggered mirror runs, or [] otherwise"
21+
value: ${{ steps.gate.outputs.labels_json }}
1922

2023
runs:
2124
using: composite
@@ -35,20 +38,23 @@ runs:
3538
REQUIRED_LABEL: ${{ inputs.required_label }}
3639
run: |
3740
if [ "$EVENT_NAME" != "push" ]; then
41+
echo "labels_json=[]" >> "$GITHUB_OUTPUT"
3842
echo "should_run=true" >> "$GITHUB_OUTPUT"
3943
exit 0
4044
fi
4145
4246
if [ "$GET_PR_INFO_OUTCOME" != "success" ]; then
47+
echo "labels_json=[]" >> "$GITHUB_OUTPUT"
4348
echo "should_run=false" >> "$GITHUB_OUTPUT"
4449
exit 0
4550
fi
4651
4752
head_sha="$(jq -r '.head.sha' <<< "$PR_INFO")"
53+
labels_json="$(jq -c '[.labels[].name]' <<< "$PR_INFO")"
4854
if [ -z "$REQUIRED_LABEL" ]; then
4955
has_label=true
5056
else
51-
has_label="$(jq -r --arg L "$REQUIRED_LABEL" '[.labels[].name] | index($L) != null' <<< "$PR_INFO")"
57+
has_label="$(jq -r --arg L "$REQUIRED_LABEL" 'index($L) != null' <<< "$labels_json")"
5258
fi
5359
5460
# Only trust copied pull-request/* pushes that still match the PR head
@@ -59,4 +65,5 @@ runs:
5965
should_run=false
6066
fi
6167
68+
echo "labels_json=$labels_json" >> "$GITHUB_OUTPUT"
6269
echo "should_run=$should_run" >> "$GITHUB_OUTPUT"

‎.github/actions/release-helm-oci/action.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ runs:
7171
exit 1
7272
fi
7373
74+
- name: Build chart dependencies
75+
env:
76+
CHART_DIR: ${{ steps.prep.outputs.chart_dir }}
77+
shell: bash
78+
run: |
79+
set -euo pipefail
80+
helm dependency build "${CHART_DIR}"
81+
7482
- name: Package Helm chart
7583
env:
7684
CHART_DIR: ${{ steps.prep.outputs.chart_dir }}

‎.github/workflows/branch-checks.yml‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ env:
1010
CARGO_TERM_COLOR: always
1111
CARGO_INCREMENTAL: "0"
1212
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13-
SCCACHE_GHA_ENABLED: "true"
1413

1514
permissions:
1615
contents: read
@@ -88,6 +87,7 @@ jobs:
8887
runner: [linux-amd64-cpu8, linux-arm64-cpu8]
8988
runs-on: ${{ matrix.runner }}
9089
env:
90+
SCCACHE_GHA_ENABLED: "true"
9191
SCCACHE_GHA_VERSION: branch-checks-rust-${{ matrix.runner }}
9292
container:
9393
image: ghcr.io/nvidia/openshell/ci:latest
@@ -97,20 +97,21 @@ jobs:
9797
steps:
9898
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
9999

100-
- name: Install tools
101-
run: mise install --locked
102-
103100
- name: Configure GHA sccache backend
104101
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
105102

103+
- name: Install tools
104+
run: mise install --locked
105+
106106
- name: Cache Rust target and registry
107107
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
108108
with:
109-
# Separate caches for clippy (check-like) vs test (full build)
110-
# so they don't thrash each other's artifacts
109+
# Keep branch-check caches partitioned by runner architecture; lint
110+
# and test intentionally share the same job-local target directory.
111111
shared-key: rust-checks-${{ matrix.runner }}
112-
# Cache the sccache directory too
113-
cache-directories: .cache/sccache
112+
# Preserve compiled artifacts from failed lint/test runs so the next
113+
# push to the same PR branch does not start from a cold cache.
114+
cache-on-failure: "true"
114115

115116
- name: Format
116117
run: mise run rust:format:check

0 commit comments

Comments
 (0)