Skip to content

Commit 5a0d82e

Browse files
committed
Add omdb support for blueprint planner status
1 parent 304a1b5 commit 5a0d82e

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

dev-tools/omdb/src/bin/omdb/nexus.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ use nexus_types::deployment::ClickhousePolicy;
4747
use nexus_types::deployment::OximeterReadMode;
4848
use nexus_types::deployment::OximeterReadPolicy;
4949
use nexus_types::internal_api::background::AbandonedVmmReaperStatus;
50+
use nexus_types::internal_api::background::BlueprintPlannerStatus;
5051
use nexus_types::internal_api::background::BlueprintRendezvousStatus;
5152
use nexus_types::internal_api::background::InstanceReincarnationStatus;
5253
use nexus_types::internal_api::background::InstanceUpdaterStatus;
@@ -1062,6 +1063,9 @@ fn print_task_details(bgtask: &BackgroundTask, details: &serde_json::Value) {
10621063
"abandoned_vmm_reaper" => {
10631064
print_task_abandoned_vmm_reaper(details);
10641065
}
1066+
"blueprint_planner" => {
1067+
print_task_blueprint_planner(details);
1068+
}
10651069
"blueprint_executor" => {
10661070
print_task_blueprint_executor(details);
10671071
}
@@ -1210,6 +1214,44 @@ fn print_task_abandoned_vmm_reaper(details: &serde_json::Value) {
12101214
};
12111215
}
12121216

1217+
fn print_task_blueprint_planner(details: &serde_json::Value) {
1218+
let status =
1219+
match serde_json::from_value::<BlueprintPlannerStatus>(details.clone())
1220+
{
1221+
Ok(status) => status,
1222+
Err(error) => {
1223+
eprintln!(
1224+
"warning: failed to interpret task details: {:?}: {:?}",
1225+
error, details
1226+
);
1227+
return;
1228+
}
1229+
};
1230+
match status {
1231+
BlueprintPlannerStatus::Disabled => {
1232+
println!(" blueprint planning explicitly disabled by config!");
1233+
}
1234+
BlueprintPlannerStatus::Error(error) => {
1235+
println!(" task did not complete successfully: {error}");
1236+
}
1237+
BlueprintPlannerStatus::Unchanged { parent_blueprint_id } => {
1238+
println!(" plan unchanged from parent {parent_blueprint_id}");
1239+
}
1240+
BlueprintPlannerStatus::Planned { parent_blueprint_id, error } => {
1241+
println!(
1242+
" planned new blueprint from parent {parent_blueprint_id}, \
1243+
but could not make it the target: {error}"
1244+
);
1245+
}
1246+
BlueprintPlannerStatus::Targeted { blueprint_id, .. } => {
1247+
println!(
1248+
" planned new blueprint {blueprint_id}, \
1249+
and made it the current target"
1250+
);
1251+
}
1252+
}
1253+
}
1254+
12131255
fn print_task_blueprint_executor(details: &serde_json::Value) {
12141256
let mut value = details.clone();
12151257
// Extract and remove the event report. (If we don't do this, the

0 commit comments

Comments
 (0)