Skip to content

Commit 4778fc5

Browse files
committed
feat(config): configure the sandbox runtime image
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent c8fb399 commit 4778fc5

4 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎crates/openshell-gateway/src/lib.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ fn install_in_tree_compute_drivers(registry: &mut ComputeDriverRegistry) {
120120
.with_inherited_config_keys(&[
121121
"namespace",
122122
"default_image",
123+
"sandbox_runtime_image",
123124
"supervisor_image",
124125
"client_tls_secret_name",
125126
"service_account_name",
@@ -141,6 +142,7 @@ fn install_in_tree_compute_drivers(registry: &mut ComputeDriverRegistry) {
141142
.with_in_process_tracing(openshell_driver_podman::otel_tracing::TRACING)
142143
.with_inherited_config_keys(&[
143144
"default_image",
145+
"sandbox_runtime_image",
144146
"supervisor_image",
145147
"host_gateway_ip",
146148
"guest_tls_ca",
@@ -162,6 +164,7 @@ fn install_in_tree_compute_drivers(registry: &mut ComputeDriverRegistry) {
162164
.with_inherited_config_keys(&[
163165
"sandbox_namespace",
164166
"default_image",
167+
"sandbox_runtime_image",
165168
"supervisor_image",
166169
"host_gateway_ip",
167170
"guest_tls_ca",

‎crates/openshell-server/src/config_file.rs‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ pub struct GatewayFileSection {
139139
#[serde(default)]
140140
pub default_image: Option<String>,
141141
#[serde(default)]
142+
pub sandbox_runtime_image: Option<String>,
143+
#[serde(default)]
142144
pub supervisor_image: Option<String>,
143145
#[serde(default)]
144146
pub client_tls_secret_name: Option<String>,
@@ -462,6 +464,7 @@ fn gateway_inherited_value(g: &GatewayFileSection, key: &str) -> Option<toml::Va
462464
match key {
463465
"namespace" | "sandbox_namespace" => g.sandbox_namespace.as_deref().map(string_value),
464466
"default_image" => g.default_image.as_deref().map(string_value),
467+
"sandbox_runtime_image" => g.sandbox_runtime_image.as_deref().map(string_value),
465468
"supervisor_image" => g.supervisor_image.as_deref().map(string_value),
466469
"client_tls_secret_name" => g.client_tls_secret_name.as_deref().map(string_value),
467470
"service_account_name" => g.service_account_name.as_deref().map(string_value),
@@ -523,6 +526,7 @@ grpc_rate_limit_requests = 120
523526
grpc_rate_limit_window_seconds = 60
524527
policy_validation_failure_mode = "retain_last_valid"
525528
default_image = "ghcr.io/nvidia/openshell-community/sandboxes/base:latest"
529+
sandbox_runtime_image = "ghcr.io/nvidia/openshell/sandbox:latest"
526530
supervisor_image = "ghcr.io/nvidia/openshell/supervisor:latest"
527531
client_tls_secret_name = "openshell-sandbox-tls"
528532
service_account_name = "openshell-sandbox"
@@ -946,6 +950,7 @@ version = 2
946950
default_image: Some(
947951
"ghcr.io/nvidia/openshell-community/sandboxes/base:latest".to_string(),
948952
),
953+
sandbox_runtime_image: Some("ghcr.io/nvidia/openshell/sandbox:0.9".to_string()),
949954
supervisor_image: Some("ghcr.io/nvidia/openshell/supervisor:0.9".to_string()),
950955
..Default::default()
951956
};
@@ -956,7 +961,7 @@ version = 2
956961
"alpha",
957962
&gateway,
958963
Some(&toml::Value::Table(raw)),
959-
&["default_image", "supervisor_image"],
964+
&["default_image", "sandbox_runtime_image", "supervisor_image"],
960965
);
961966
let table = merged.as_table().expect("table");
962967
assert_eq!(
@@ -967,6 +972,10 @@ version = 2
967972
table.get("default_image").and_then(|v| v.as_str()),
968973
Some("ghcr.io/nvidia/openshell-community/sandboxes/base:latest")
969974
);
975+
assert_eq!(
976+
table.get("sandbox_runtime_image").and_then(|v| v.as_str()),
977+
Some("ghcr.io/nvidia/openshell/sandbox:0.9")
978+
);
970979
assert_eq!(
971980
table.get("supervisor_image").and_then(|v| v.as_str()),
972981
Some("ghcr.io/nvidia/openshell/supervisor:0.9")

‎deploy/docker/gateway.toml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ disable_tls = true
3636
[openshell.drivers.docker]
3737
# Default image pulled for `openshell sandbox create` without --from.
3838
default_image = "ghcr.io/nvidia/openshell-community/sandboxes/base:latest"
39-
# Supervisor image from which the openshell-sandbox binary is extracted on
40-
# first start. The binary is cached to XDG_DATA_HOME and reused on restart.
39+
# Sandbox runtime image from which the openshell-sandbox binary is extracted.
40+
sandbox_runtime_image = "ghcr.io/nvidia/openshell/sandbox:latest"
41+
# Image containing the external supervisor process.
4142
supervisor_image = "ghcr.io/nvidia/openshell/supervisor:latest"
4243
# Only pull images that are not already cached locally.
4344
image_pull_policy = "IfNotPresent"

‎docs/reference/gateway-config.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ disable_tls = false
107107
# when the driver-specific table does not override them.
108108
default_image = "ghcr.io/nvidia/openshell-community/sandboxes/base:latest"
109109
# Defaults to the gateway version; override to pin a specific build.
110+
sandbox_runtime_image = "ghcr.io/nvidia/openshell/sandbox:<version>"
111+
# Defaults to the gateway version; override to pin a specific build.
110112
# supervisor_image = "ghcr.io/nvidia/openshell/supervisor:<version>"
111113
client_tls_secret_name = "openshell-client-tls"
112114
service_account_name = "openshell-sandbox"

0 commit comments

Comments
 (0)