deploy the closure the swarm declares, read no forge head, drop the update badge
This commit is contained in:
parent
279428a66f
commit
47c2acb640
3 changed files with 647 additions and 2001 deletions
|
|
@ -1,6 +1,6 @@
|
|||
//! Container lifecycle endpoints for the dashboard.
|
||||
//!
|
||||
//! Rebuild / restart / start / stop (hard + graceful) / update-all all
|
||||
//! Rebuild / restart / start / stop (hard + graceful) all
|
||||
//! insert DAGs into the job queue — the power ops via
|
||||
//! [`crate::job_queue::power`], the static shapes straight through
|
||||
//! `JobQueue::insert` — so each shows a visible queued→running transient on
|
||||
|
|
@ -311,34 +311,6 @@ fn set_paused_error_response(
|
|||
}
|
||||
}
|
||||
|
||||
/// Queue a rebuild DAG for every live agent
|
||||
/// container.
|
||||
#[utoipa::path(
|
||||
post,
|
||||
path = "/api/update-all",
|
||||
responses(
|
||||
(status = 200, description = "rebuilds queued", body = String),
|
||||
(status = 500, description = "container list unreadable, nothing queued"),
|
||||
),
|
||||
tag = "lifecycle_ops"
|
||||
)]
|
||||
pub(super) async fn post_update_all(State(state): State<AppState>) -> Response {
|
||||
let agents = match lifecycle::agent_names(lifecycle::list().await) {
|
||||
Ok(agents) => agents,
|
||||
Err(e) => return error_response(&format!("update-all: listing containers: {e:#}")),
|
||||
};
|
||||
for logical in agents {
|
||||
if let Err(e) = state.coord.job_queue.insert_job(|b| {
|
||||
crate::job_queue::templates::rebuild(b, &logical);
|
||||
Vec::new()
|
||||
}) {
|
||||
tracing::error!(agent = %logical, error = ?e, "update-all: insert failed");
|
||||
}
|
||||
}
|
||||
state.coord.emit_rebuild_queue_snapshot();
|
||||
(StatusCode::OK, "ok").into_response()
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Default, ToSchema)]
|
||||
pub(super) struct DestroyForm {
|
||||
#[serde(default)]
|
||||
|
|
|
|||
|
|
@ -119,7 +119,6 @@ fn app(coord: Arc<Coordinator>) -> axum::Router {
|
|||
.routes(routes!(lifecycle_ops::post_rebuild))
|
||||
.routes(routes!(lifecycle_ops::post_pause))
|
||||
.routes(routes!(lifecycle_ops::post_resume))
|
||||
.routes(routes!(lifecycle_ops::post_update_all))
|
||||
.routes(routes!(tombstones::post_purge_tombstone))
|
||||
.routes(routes!(build_logs::get_build_log_stream))
|
||||
.routes(routes!(state_snapshot::dashboard_stream))
|
||||
|
|
@ -369,7 +368,6 @@ mod router_build_probe {
|
|||
.routes(routes!(lifecycle_ops::post_rebuild))
|
||||
.routes(routes!(lifecycle_ops::post_pause))
|
||||
.routes(routes!(lifecycle_ops::post_resume))
|
||||
.routes(routes!(lifecycle_ops::post_update_all))
|
||||
.routes(routes!(tombstones::post_purge_tombstone))
|
||||
.routes(routes!(build_logs::get_build_log_stream))
|
||||
.routes(routes!(state_snapshot::dashboard_stream))
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ pub(super) struct StateSnapshot {
|
|||
/// can't be resolved. Feeds the dashboard start page so an operator
|
||||
/// can tell what build a hive is running without shelling in.
|
||||
hyperhive_rev: Option<String>,
|
||||
any_stale: bool,
|
||||
containers: Vec<ContainerView>,
|
||||
transients: Vec<TransientView>,
|
||||
/// State dirs (config history + claude creds + /state/ notes) that
|
||||
|
|
@ -176,7 +175,6 @@ pub(super) async fn api_state(
|
|||
);
|
||||
}
|
||||
let containers = state.coord.containers_snapshot().await;
|
||||
let any_stale = containers.iter().any(|c| c.needs_update);
|
||||
let transient_snapshot = state.coord.transient_snapshot();
|
||||
let transients = build_transient_views(&containers, &transient_snapshot);
|
||||
let tombstones = build_tombstone_views(&containers);
|
||||
|
|
@ -186,7 +184,6 @@ pub(super) async fn api_state(
|
|||
seq,
|
||||
hostname,
|
||||
hyperhive_rev: crate::auto_update::current_flake_rev(&state.coord.hyperhive_flake),
|
||||
any_stale,
|
||||
containers,
|
||||
transients,
|
||||
|
||||
|
|
@ -493,9 +490,7 @@ mod tests {
|
|||
port,
|
||||
running,
|
||||
failed: false,
|
||||
needs_update: false,
|
||||
needs_login: false,
|
||||
deployed_sha: None,
|
||||
active_model: None,
|
||||
status_text: None,
|
||||
status_set_at: None,
|
||||
|
|
|
|||
Loading…
Reference in a new issue