@@ -83,6 +83,44 @@ impl FromStr for PolicyValidationFailureMode {
8383 }
8484}
8585
86+ /// Where supervisors that enforce sandbox boundaries run.
87+ #[ derive( Debug , Clone , Copy , Default , PartialEq , Eq , Serialize , Deserialize ) ]
88+ #[ serde( rename_all = "snake_case" ) ]
89+ pub enum SupervisorTopology {
90+ /// One supervisor per sandbox, created by the compute driver. Recovery is
91+ /// limited to the same supervisor process.
92+ #[ default]
93+ Dedicated ,
94+ /// One shared, highly available supervisor Deployment for the whole
95+ /// gateway installation. A failed supervisor is replaced by fenced
96+ /// takeover that resumes the running workload.
97+ Gateway ,
98+ }
99+
100+ impl SupervisorTopology {
101+ #[ must_use]
102+ pub const fn as_str ( self ) -> & ' static str {
103+ match self {
104+ Self :: Dedicated => "dedicated" ,
105+ Self :: Gateway => "gateway" ,
106+ }
107+ }
108+ }
109+
110+ impl FromStr for SupervisorTopology {
111+ type Err = String ;
112+
113+ fn from_str ( value : & str ) -> Result < Self , Self :: Err > {
114+ match value {
115+ "dedicated" => Ok ( Self :: Dedicated ) ,
116+ "gateway" => Ok ( Self :: Gateway ) ,
117+ _ => Err ( format ! (
118+ "invalid supervisor topology '{value}'; expected dedicated or gateway"
119+ ) ) ,
120+ }
121+ }
122+ }
123+
86124/// Default OCI repository for the supervisor image (no tag).
87125pub const DEFAULT_SUPERVISOR_IMAGE_REPO : & str = "ghcr.io/nvidia/openshell/supervisor" ;
88126
@@ -209,6 +247,9 @@ pub struct Config {
209247 /// Security posture for rejected sandbox policy generations.
210248 pub policy_validation_failure_mode : PolicyValidationFailureMode ,
211249
250+ /// Supervisor placement for sandboxes of this gateway installation.
251+ pub supervisor_topology : SupervisorTopology ,
252+
212253 /// TLS configuration. When `None`, the server listens on plaintext HTTP.
213254 pub tls : Option < TlsConfig > ,
214255
@@ -883,6 +924,7 @@ impl Config {
883924 metrics_bind_address : None ,
884925 log_level : default_log_level ( ) ,
885926 policy_validation_failure_mode : PolicyValidationFailureMode :: default ( ) ,
927+ supervisor_topology : SupervisorTopology :: default ( ) ,
886928 tls,
887929 oidc : None ,
888930 auth : GatewayAuthConfig :: default ( ) ,
0 commit comments