Skip to content

Commit 75af6cc

Browse files
committed
fix(build): update gateway package references
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent c892dba commit 75af6cc

15 files changed

Lines changed: 118 additions & 73 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ The following Bazel commands are available alongside the mise tasks above. Cargo
445445
| Build everything | `bazel build //...` | All crates and protos |
446446
| Run all tests | `bazel test //...` | Unit tests only, no E2E |
447447
| Build the CLI | `bazel build //crates/openshell-cli:openshell` | |
448-
| Build the gateway | `bazel build //crates/openshell-server:openshell-gateway` | |
448+
| Build the gateway | `bazel build //crates/openshell-gateway:openshell-gateway-bin` | |
449449
| Build the supervisor | `bazel build //crates/openshell-sandbox:openshell-sandbox-bin` | |
450450
| Clean | `bazel clean` | |
451451

MODULE.bazel.lock

Lines changed: 30 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ OpenShell collects anonymous telemetry to help improve the project for developer
260260

261261
Disable telemetry at runtime by setting `OPENSHELL_TELEMETRY_ENABLED=false` on the gateway deployment. For Helm installs, set `server.telemetryEnabled=false`. OpenShell propagates this deployment setting into sandbox supervisor environments so sandbox-side telemetry collection is disabled as well.
262262

263-
You can also compile telemetry out entirely. Telemetry support is a default-on `telemetry` Cargo feature; building with `--no-default-features` produces binaries that contain no telemetry endpoint, no telemetry HTTP client, and no emission code. Build telemetry-free artifacts with, for example, `cargo build --release -p openshell-server --no-default-features` (gateway) and the equivalent for `openshell-sandbox` and `openshell-driver-vm`. With telemetry compiled out, the gateway emits nothing and reports telemetry disabled to the sandboxes it launches.
263+
You can also compile telemetry out entirely. Telemetry support is a default-on `telemetry` Cargo feature; building with `--no-default-features` produces binaries that contain no telemetry endpoint, no telemetry HTTP client, and no emission code. Build a telemetry-free gateway with `cargo build --release -p openshell-gateway --no-default-features --features in-tree-compute-drivers`, and use the equivalent feature selection for `openshell-sandbox` and `openshell-driver-vm`. With telemetry compiled out, the gateway emits nothing and reports telemetry disabled to the sandboxes it launches.
264264

265265
Telemetry events are limited to anonymous operational categories and counts, such as sandbox lifecycle outcomes, provider profile buckets, policy decision counts, and aggregate network activity denial categories. OpenShell telemetry does not collect sandbox names or IDs, hostnames, file paths, binary paths, prompts, credentials, provider names, model names, or user content.
266266

architecture/build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Sandbox community images are built outside this repository.
2626
Anonymous telemetry emission is gated behind a default-on `telemetry` Cargo
2727
feature. It is defined in `openshell-core` (where the emission code, HTTP
2828
client, and endpoint live) and forwarded by the binary crates that emit or
29-
collect telemetry: `openshell-server` (gateway), `openshell-sandbox`
29+
collect telemetry: `openshell-gateway`, `openshell-sandbox`
3030
(supervisor), and `openshell-driver-vm`. Every crate depends on
3131
`openshell-core` with `default-features = false`, so the binary crate's feature
3232
is the single switch that enables `openshell-core/telemetry` for its build

bazel/releases/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ platform_transition_binary(
5959
platform_transition_binary(
6060
name = "openshell_gateway_linux_x86_64",
6161
basename = "openshell-gateway",
62-
binary = "//crates/openshell-server:openshell-gateway",
62+
binary = "//crates/openshell-gateway:openshell-gateway-bin",
6363
tags = ["manual"],
6464
target_platform = ":linux_x86_64_gnu_2_28",
6565
)
6666

6767
platform_transition_binary(
6868
name = "openshell_gateway_linux_aarch64",
6969
basename = "openshell-gateway",
70-
binary = "//crates/openshell-server:openshell-gateway",
70+
binary = "//crates/openshell-gateway:openshell-gateway-bin",
7171
tags = ["manual"],
7272
target_platform = ":linux_aarch64_gnu_2_28",
7373
)
@@ -91,7 +91,7 @@ platform_transition_binary(
9191
platform_transition_binary(
9292
name = "openshell_gateway_macos_aarch64",
9393
basename = "openshell-gateway",
94-
binary = "//crates/openshell-server:openshell-gateway",
94+
binary = "//crates/openshell-gateway:openshell-gateway-bin",
9595
tags = ["manual"],
9696
target_platform = "@rules_rs//rs/platforms:aarch64-apple-darwin",
9797
)

crates/openshell-core/BUILD.bazel

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ rust_library(
1212
"//proto:openshell_proto_descriptor_set",
1313
"//proto:openshell_rust_proto_src",
1414
],
15-
crate_features = ["telemetry"],
15+
crate_features = [
16+
"driver-extraction",
17+
"telemetry",
18+
],
1619
rustc_env = {
1720
"OPENSHELL_DESCRIPTOR_PATH": "$(execpath //proto:openshell_proto_descriptor_set)",
1821
"OPENSHELL_PROTO_PATH": "$(execpath //proto:openshell_rust_proto_src)",
@@ -30,7 +33,10 @@ rust_library(
3033
rust_test(
3134
name = "openshell-core_test",
3235
crate = ":openshell-core",
33-
crate_features = ["telemetry"],
36+
crate_features = [
37+
"driver-extraction",
38+
"telemetry",
39+
],
3440
rustc_flags = ["--cfg=bazel"],
3541
deps = all_crate_deps(normal_dev = True),
3642
)

crates/openshell-core/src/settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl RegisteredSetting {
6565
///
6666
/// 1. Add a [`RegisteredSetting`] entry to this array with the key name and
6767
/// [`SettingValueKind`].
68-
/// 2. Recompile `openshell-server` (gateway) and `openshell-sandbox`
68+
/// 2. Recompile `openshell-gateway` and `openshell-sandbox`
6969
/// (supervisor). No database migration is needed -- new keys are stored in
7070
/// the existing settings JSON blob.
7171
/// 3. Add sandbox-side consumption in `openshell-sandbox` to read and act on

crates/openshell-driver-vm/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Standalone libkrun-backed [`ComputeDriver`](../../proto/compute_driver.proto) fo
99
```mermaid
1010
flowchart LR
1111
subgraph host["Host process"]
12-
gateway["openshell-server<br/>(compute::vm::spawn)"]
12+
gateway["openshell-gateway<br/>(vm::spawn)"]
1313
driver["openshell-driver-vm<br/>├── libkrun (VM)<br/>├── gvproxy (net)<br/>└── openshell-sandbox.zst"]
1414
gateway <-->|"gRPC over UDS<br/>compute-driver.sock"| driver
1515
end
@@ -98,7 +98,7 @@ mise run vm:supervisor # if openshell-sandbox.zst is not already presen
9898

9999
# 2. Build both binaries with the staged artifacts embedded
100100
OPENSHELL_VM_RUNTIME_COMPRESSED_DIR=$PWD/target/vm-runtime-compressed \
101-
cargo build -p openshell-server -p openshell-driver-vm
101+
cargo build -p openshell-gateway -p openshell-driver-vm
102102

103103
# 3. macOS only: codesign the driver for Hypervisor.framework
104104
codesign \
@@ -283,5 +283,5 @@ the user explicitly overrides it.
283283
284284
## TODOs
285285
286-
- The gateway still configures the driver via CLI args; this will move to a gRPC bootstrap call so the driver interface is uniform across backends. See the `TODO(driver-abstraction)` notes in `crates/openshell-server/src/lib.rs` and `crates/openshell-server/src/compute/vm.rs`.
286+
- The gateway still configures the driver via CLI args; this will move to a gRPC bootstrap call so the driver interface is uniform across backends. See the `TODO(driver-abstraction)` note in `crates/openshell-gateway/src/vm.rs`.
287287
- macOS local builds are codesigned by `tasks/scripts/gateway-vm.sh`; the generated Homebrew formula signs the release tarball driver for local installs.

crates/openshell-driver-vm/runtime/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ mise run vm:supervisor
4141

4242
# Build the gateway and VM driver with embedded runtime artifacts
4343
OPENSHELL_VM_RUNTIME_COMPRESSED_DIR=$PWD/target/vm-runtime-compressed \
44-
cargo build -p openshell-server -p openshell-driver-vm
44+
cargo build -p openshell-gateway -p openshell-driver-vm
4545
```
4646

4747
Use `FROM_SOURCE=1 mise run vm:setup` to build the runtime from source instead
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
load("@crates//:defs.bzl", "aliases", "all_crate_deps")
2+
load("@rules_rs//rs:rust_binary.bzl", "rust_binary")
3+
load("@rules_rs//rs:rust_library.bzl", "rust_library")
4+
load("@rules_rs//rs:rust_test.bzl", "rust_test")
5+
load("@rules_rust//rust:defs.bzl", "rustfmt_test")
6+
load("@workspace_version//:version.bzl", "WORKSPACE_VERSION")
7+
8+
rust_library(
9+
name = "openshell-gateway",
10+
srcs = glob(
11+
["src/**/*.rs"],
12+
exclude = ["src/main.rs"],
13+
),
14+
aliases = aliases(),
15+
crate_features = [
16+
"in-tree-compute-drivers",
17+
"telemetry",
18+
],
19+
version = WORKSPACE_VERSION,
20+
visibility = ["//visibility:public"],
21+
deps = all_crate_deps(normal = True),
22+
)
23+
24+
rust_binary(
25+
name = "openshell-gateway-bin",
26+
srcs = ["src/main.rs"],
27+
aliases = aliases(),
28+
binary_name = "openshell-gateway",
29+
version = WORKSPACE_VERSION,
30+
visibility = ["//visibility:public"],
31+
deps = all_crate_deps(normal = True) + [":openshell-gateway"],
32+
)
33+
34+
rust_test(
35+
name = "openshell-gateway_lib_test",
36+
crate = ":openshell-gateway",
37+
crate_features = [
38+
"in-tree-compute-drivers",
39+
"telemetry",
40+
],
41+
deps = all_crate_deps(normal_dev = True),
42+
)
43+
44+
rust_test(
45+
name = "openshell-gateway_bin_test",
46+
srcs = ["src/main.rs"],
47+
aliases = aliases(),
48+
version = WORKSPACE_VERSION,
49+
deps = all_crate_deps(
50+
normal = True,
51+
normal_dev = True,
52+
) + [":openshell-gateway"],
53+
)
54+
55+
rustfmt_test(
56+
name = "rustfmt_test",
57+
targets = [
58+
":openshell-gateway",
59+
":openshell-gateway-bin",
60+
":openshell-gateway_bin_test",
61+
":openshell-gateway_lib_test",
62+
],
63+
visibility = ["//crates:__pkg__"],
64+
)

0 commit comments

Comments
 (0)