Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/branch-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,25 @@ jobs:
- name: Test
run: mise run test:python

go:
name: Go SDK
needs: pr_metadata
if: needs.pr_metadata.outputs.should_run == 'true'
runs-on: linux-amd64-cpu8
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Install tools
run: mise install --locked

- name: Lint, build, test, proto-check
run: mise run go:ci

markdown:
name: Markdown
needs: pr_metadata
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
coverage.out
htmlcov/
.tox/
.nox/
Expand Down
9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,15 @@ ocsf_emit!(event);
- `mise run e2e` — End-to-end tests against a running gateway. Run for infrastructure, sandbox, or policy changes.
- `mise run ci` — Full local CI (lint + compile/type checks + tests). Run before opening a PR.

## Go SDK (`sdk/go/`)

- The Go SDK lives in `sdk/go/` with module path `github.com/NVIDIA/OpenShell/sdk/go`.
- Run `mise run go:ci` for the full SDK CI pipeline (lint, build, test, proto-check, docs-check).
- Proto bindings are generated with `mise run go:proto:gen` from the `.proto` files in `proto/`.
- Domain types in `sdk/go/openshell/v1/types/` must not import proto packages.
- Converters in `sdk/go/openshell/v1/internal/converter/` deep-copy slices and maps at boundaries.
- Tests use bufconn for in-process gRPC and testify for assertions.

## Python

- Always use `uv` for Python commands (e.g., `uv pip install`, `uv run`, `uv venv`)
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ Bazel does not yet cover `mise run gateway`, `mise run sandbox`, `mise run e2e`,
| --------------- | --------------------------------------------- |
| `crates/` | Rust crates |
| `python/` | Python SDK and bindings |
| `sdk/go/` | Go SDK (types, gRPC clients, converters) |
| `proto/` | Protocol buffer definitions |
| `tasks/` | `mise` task definitions and build scripts |
| `deploy/` | Dockerfiles, Helm chart, Kubernetes manifests |
Expand Down
31 changes: 31 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Repo-level buf module. Declares proto/ as the single module so buf generate,
# buf lint, buf breaking, and the editor LSP all resolve imports the same way.
# Code generation lives with each consumer (see sdk/go/buf.gen.yaml,
# sdk/typescript/buf.gen.yaml); this file owns the module boundary and proto
# validation policy.
version: v2
modules:
- path: proto
lint:
use:
- STANDARD
except:
# Flat proto/ layout: all files live in one directory with nested
# packages (openshell.v1, openshell.sandbox.v1, ...). Adopting these
# would require restructuring the tree into openshell/<svc>/v1/ and
# updating every Rust/Python/TS codegen path and import.
- DIRECTORY_SAME_PACKAGE
- PACKAGE_DIRECTORY_MATCH
# Established API shape: services are unsuffixed (OpenShell, not
# OpenShellService) and RPCs reuse shared request/response messages with
# short names. Renaming these is a breaking change across the codebase.
- RPC_REQUEST_RESPONSE_UNIQUE
- RPC_REQUEST_STANDARD_NAME
- RPC_RESPONSE_STANDARD_NAME
- SERVICE_SUFFIX
breaking:
use:
- FILE
11 changes: 10 additions & 1 deletion crates/openshell-supervisor-middleware/src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ use tonic::{Request, Response, Status};
use crate::MIDDLEWARE_GRPC_MESSAGE_BYTES;

const CONNECT_TIMEOUT: Duration = Duration::from_secs(5);
const HTTP2_KEEP_ALIVE_INTERVAL: Duration = Duration::from_secs(10);
const HTTP2_KEEP_ALIVE_TIMEOUT: Duration = Duration::from_secs(20);

#[derive(Clone)]
pub struct RemoteMiddlewareService {
Expand All @@ -30,7 +32,12 @@ impl RemoteMiddlewareService {
format!(
"middleware registration '{registration_name}' has an invalid grpc_endpoint"
)
})?;
})?
.http2_keep_alive_interval(HTTP2_KEEP_ALIVE_INTERVAL)
.keep_alive_while_idle(true)
.keep_alive_timeout(HTTP2_KEEP_ALIVE_TIMEOUT)
.http2_adaptive_window(true);

if grpc_endpoint.starts_with("https://") {
endpoint = endpoint
.tls_config(ClientTlsConfig::new().with_enabled_roots())
Expand All @@ -39,6 +46,7 @@ impl RemoteMiddlewareService {
format!("middleware registration '{registration_name}' could not configure TLS")
})?;
}

let channel = endpoint
.connect_timeout(CONNECT_TIMEOUT)
.connect()
Expand All @@ -49,6 +57,7 @@ impl RemoteMiddlewareService {
"middleware registration '{registration_name}' could not connect to {grpc_endpoint}"
)
})?;

Ok(Self {
client: SupervisorMiddlewareClient::new(channel)
.max_decoding_message_size(MIDDLEWARE_GRPC_MESSAGE_BYTES)
Expand Down
66 changes: 66 additions & 0 deletions mise.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ node = "24.15.0"
kubectl = "1.36.1"
uv = "0.10.12"
protoc = "29.6"
go = "1.26"
"go:github.com/golangci/golangci-lint/v2/cmd/golangci-lint" = "2.12"
"go:google.golang.org/protobuf/cmd/protoc-gen-go" = "1.36.11"
"go:google.golang.org/grpc/cmd/protoc-gen-go-grpc" = "1.6.2"
"go:golang.org/x/tools/cmd/goimports" = "0.48.0"
buf = "1.72.0"
helm = "4.2.0"
helm-docs = "1.14.2"
skaffold = "2.20.0"
Expand Down
Loading
Loading