Skip to content

Commit 0768489

Browse files
committed
feat(config): deliver gateway configuration over the supervisor session
Add an opt-in push path for gateway-owned supervisor configuration, selected by the gateway setting config_delivery_mode = "poll" | "push". Poll stays the default, and polling keeps working for older supervisors and gateways. Delivery: - Add bootstrap, snapshot, update, result and admission contracts on ConnectSupervisor. Supervisors advertise supports_config_snapshots and supports_config_apply; the gateway answers with config_apply_enabled. - Configuration delivery is a coalescing DeliveryQueue drained by one on-demand delivery worker. Admission never drops updates, fanouts walk connected sandboxes as cursors, and sandbox-scoped work keeps reserved build slots. - Provider changes rebuild only the sandboxes that attach the provider. - Across replicas, other gateways send the session owner a secret-free PeerNotifyConfigUpdate and the owner rebuilds from shared state. An owner reconciler repairs missed notifications. Streamed apply: - Supervisors that enable apply prepare the startup policy against the image, apply the bootstrap before starting the workload, apply and acknowledge live updates, and stop polling. - A failed live registry reload keeps the last-known-good registry. Durable completion: - Sandbox policy and settings updates commit desired state and a durable ConfigUpdateOperation atomically. Callers choose wait_mode COMMIT_ONLY or WAIT_FOR_COMPLETION, with idempotency keys and GetConfigUpdateOperation. - Operations resolve as applied, degraded, failed, superseded, inactive or cancelled, and survive client timeouts and gateway restarts. This combines the previously stacked changes from #3244, #3265 and #3273. Refs #1731 Signed-off-by: Piotr Mlocek <[email protected]>
1 parent 8aa5846 commit 0768489

73 files changed

Lines changed: 21945 additions & 3764 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.

‎crates/openshell-cli/src/main.rs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3060,7 +3060,7 @@ async fn run_async() -> Result<()> {
30603060
.await?;
30613061
} else {
30623062
let name = resolve_sandbox_name(name, &ctx.name, &cli.workspace)?;
3063-
run::sandbox_policy_set(
3063+
let exit_code = run::sandbox_policy_set(
30643064
&ctx.endpoint,
30653065
&name,
30663066
&policy,
@@ -3070,6 +3070,9 @@ async fn run_async() -> Result<()> {
30703070
&tls,
30713071
)
30723072
.await?;
3073+
if exit_code != 0 {
3074+
std::process::exit(exit_code);
3075+
}
30733076
}
30743077
}
30753078
PolicyCommands::Update {
@@ -3088,7 +3091,7 @@ async fn run_async() -> Result<()> {
30883091
timeout,
30893092
} => {
30903093
let name = resolve_sandbox_name(name, &ctx.name, &cli.workspace)?;
3091-
run::sandbox_policy_update(
3094+
let exit_code = run::sandbox_policy_update(
30923095
&ctx.endpoint,
30933096
&name,
30943097
&add_endpoints,
@@ -3107,6 +3110,9 @@ async fn run_async() -> Result<()> {
31073110
&tls,
31083111
)
31093112
.await?;
3113+
if exit_code != 0 {
3114+
std::process::exit(exit_code);
3115+
}
31103116
}
31113117
PolicyCommands::Get {
31123118
name,

0 commit comments

Comments
 (0)