Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5b26fc4
builder: add method to add boundary NTP directly instead of always pr…
jgallagher Nov 12, 2025
5cef8ac
use builder in rack_set_initialized_with_services()
jgallagher Nov 12, 2025
6baa021
rack_set_initialized_missing_service_pool_ip_throws_error()
jgallagher Nov 12, 2025
d00b536
rack_set_initialized_with_many_nexus_services()
jgallagher Nov 12, 2025
8302b01
rack_set_initialized_with_ipv6_public_addresses()
jgallagher Nov 12, 2025
ce1c5dc
rack_set_initialized_overlapping_ips_throws_error()
jgallagher Nov 12, 2025
fc4658d
revert now-unneccesary visibility change
jgallagher Nov 12, 2025
3373282
add BlueprintBuilder::build_empty()
jgallagher Nov 12, 2025
efd74fa
example system: start with truly empty blueprint
jgallagher Nov 12, 2025
4b9eeaf
use build_empty() where we can
jgallagher Nov 12, 2025
ff1b86a
use example system in test_ensure_external_networking_works_with_good…
jgallagher Nov 12, 2025
8d968c5
test_external_dns_external_ips_specified_by_rack_setup()
jgallagher Nov 12, 2025
3efe2c0
test_default_cockroach_admin_addrs_from_blueprint()
jgallagher Nov 12, 2025
9c30cd7
remove build_empty_with_sleds()
jgallagher Nov 12, 2025
de048ec
expectorate
jgallagher Nov 12, 2025
263cd1f
clippy
jgallagher Nov 12, 2025
c2e6bed
add sled subnet to blueprint (planner tests pass)
jgallagher Nov 17, 2025
f33e983
expectorate: reconfigurator-cli tests
jgallagher Nov 17, 2025
831d728
update RSS to include sled subnet in blueprint
jgallagher Nov 17, 2025
e43a038
add subnet column to bp_sled_metadata table
jgallagher Nov 17, 2025
9d71e86
db migration
jgallagher Nov 17, 2025
ef51fa2
minor test fixes
jgallagher Nov 17, 2025
660056e
update lockstep openapi
jgallagher Nov 18, 2025
aa85885
cargo fmt
jgallagher Nov 18, 2025
604a52d
BlueprintBuilder::new_based_on(): remove PlanningInput argument
jgallagher Nov 18, 2025
0fb915d
test fix
jgallagher Nov 20, 2025
6d64c88
test fix
jgallagher Nov 21, 2025
58ac29d
Merge remote-tracking branch 'origin/main' into john/blueprint-builde…
jgallagher Nov 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions dev-tools/reconfigurator-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2245,14 +2245,13 @@ fn cmd_blueprint_edit(
.map(|c| c.clone())
.unwrap_or_else(|| CollectionBuilder::new("sim").build());

let mut builder = BlueprintBuilder::new_based_on(
&sim.log,
blueprint,
&planning_input,
creator,
rng,
)
.context("creating blueprint builder")?;
let mut builder =
BlueprintBuilder::new_based_on(&sim.log, blueprint, creator, rng)
.context("creating blueprint builder")?;

// We're acting as the planner here, so we need to update the builder for
// any static changes in the input (e.g., new sleds, new DNS versions, ...).
Planner::update_builder_from_planning_input(&mut builder, &planning_input);

if let Some(comment) = args.comment {
builder.comment(comment);
Expand Down
4 changes: 1 addition & 3 deletions live-tests/tests/common/reconfigurator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use nexus_lockstep_client::types::{
};
use nexus_reconfigurator_planning::blueprint_builder::BlueprintBuilder;
use nexus_reconfigurator_planning::planner::PlannerRng;
use nexus_types::deployment::{Blueprint, BlueprintSource, PlanningInput};
use nexus_types::deployment::{Blueprint, BlueprintSource};
use nexus_types::external_api::views::SledState;
use nexus_types::inventory::Collection;
use omicron_test_utils::dev::poll::{CondCheckError, wait_for_condition};
Expand Down Expand Up @@ -80,7 +80,6 @@ pub async fn blueprint_load_target_enabled(
/// their test environment.
pub async fn blueprint_edit_current_target(
log: &slog::Logger,
planning_input: &PlanningInput,
nexus: &nexus_lockstep_client::Client,
edit_fn: &dyn Fn(&mut BlueprintBuilder) -> Result<(), anyhow::Error>,
) -> Result<(Blueprint, Blueprint), anyhow::Error> {
Expand All @@ -92,7 +91,6 @@ pub async fn blueprint_edit_current_target(
let mut builder = BlueprintBuilder::new_based_on(
log,
&blueprint1,
&planning_input,
"test-suite",
PlannerRng::from_entropy(),
)
Expand Down
2 changes: 0 additions & 2 deletions live-tests/tests/test_nexus_add_remove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ async fn test_nexus_add_remove(lc: &LiveTestContext) {
let sled_id = *commissioned_sled_ids.first().expect("any sled id");
let (blueprint1, blueprint2) = blueprint_edit_current_target(
log,
&planning_input,
&nexus,
&|builder: &mut BlueprintBuilder| {
// We have to tell the builder what image source to use for the new
Expand Down Expand Up @@ -188,7 +187,6 @@ async fn test_nexus_add_remove(lc: &LiveTestContext) {
// Now expunge the zone we just created.
let (_blueprint2, blueprint3) = blueprint_edit_current_target(
log,
&planning_input,
&nexus,
&|builder: &mut BlueprintBuilder| {
builder
Expand Down
11 changes: 0 additions & 11 deletions live-tests/tests/test_nexus_handoff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ async fn test_nexus_handoff(lc: &LiveTestContext) {
let (_blueprint_initial, blueprint_new_nexus) =
blueprint_edit_current_target(
log,
&planning_input,
&nexus,
&|builder: &mut BlueprintBuilder| {
let mut external_networking_alloc =
Expand Down Expand Up @@ -264,14 +263,9 @@ async fn test_nexus_handoff(lc: &LiveTestContext) {
info!(log, "created demo saga"; "demo_saga" => ?demo_saga);

// Now update the target blueprint to trigger a handoff.
let planning_input =
PlanningInputFromDb::assemble(opctx, datastore, planner_config)
.await
.expect("planning input");
let (_blueprint_new_nexus, blueprint_handoff) =
blueprint_edit_current_target(
log,
&planning_input,
&nexus,
&|builder: &mut BlueprintBuilder| {
builder.set_nexus_generation(next_generation);
Expand Down Expand Up @@ -427,16 +421,11 @@ async fn test_nexus_handoff(lc: &LiveTestContext) {
info!(log, "all new Nexus instances report running!");

// Clean up: expunge the old Nexus instances.
let planning_input =
PlanningInputFromDb::assemble(opctx, datastore, planner_config)
.await
.expect("planning input");
let new_nexus =
new_nexus_clients.values().next().expect("one new Nexus client");
let (_blueprint_handoff, blueprint_cleanup) =
blueprint_edit_current_target(
log,
&planning_input,
new_nexus,
&|builder: &mut BlueprintBuilder| {
for (id, current_zone) in &current_nexus_zones {
Expand Down
24 changes: 9 additions & 15 deletions nexus/db-queries/src/db/datastore/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3149,6 +3149,7 @@ mod tests {
use nexus_reconfigurator_planning::blueprint_builder::EnsureMultiple;
use nexus_reconfigurator_planning::example::ExampleSystemBuilder;
use nexus_reconfigurator_planning::example::example;
use nexus_reconfigurator_planning::planner::Planner;
use nexus_reconfigurator_planning::planner::PlannerRng;
use nexus_types::deployment::BlueprintArtifactVersion;
use nexus_types::deployment::BlueprintHostPhase2DesiredContents;
Expand All @@ -3159,7 +3160,6 @@ mod tests {
use nexus_types::deployment::ExpectedActiveRotSlot;
use nexus_types::deployment::PendingMgsUpdate;
use nexus_types::deployment::PlanningInput;
use nexus_types::deployment::PlanningInputBuilder;
use nexus_types::deployment::SledDetails;
use nexus_types::deployment::SledDisk;
use nexus_types::deployment::SledFilter;
Expand Down Expand Up @@ -3191,16 +3191,12 @@ mod tests {
use std::mem;
use std::net::Ipv6Addr;
use std::sync::Arc;
use std::sync::LazyLock;
use std::sync::atomic::AtomicBool;
use std::sync::atomic::Ordering;
use std::time::Duration;
use tufaceous_artifact::ArtifactHash;
use tufaceous_artifact::ArtifactVersion;

static EMPTY_PLANNING_INPUT: LazyLock<PlanningInput> =
LazyLock::new(|| PlanningInputBuilder::empty_input());

#[derive(Default)]
pub struct NetworkResourceControlFlow {
pub target_check_done: Option<Arc<AtomicBool>>,
Expand Down Expand Up @@ -3448,12 +3444,19 @@ mod tests {
let mut builder = BlueprintBuilder::new_based_on(
&logctx.log,
&blueprint1,
&planning_input,
"test",
PlannerRng::from_entropy(),
)
.expect("failed to create builder");

// We made changes to the planning input we want to be reflected in the
// new blueprint; reuse the `Planner`'s method for replicating those
// changes.
Planner::update_builder_from_planning_input(
&mut builder,
&planning_input,
);

// Ensure disks on our sled
assert_eq!(
EnsureMultiple::from(
Expand Down Expand Up @@ -3795,7 +3798,6 @@ mod tests {
let mut builder = BlueprintBuilder::new_based_on(
&logctx.log,
&blueprint2,
&planning_input,
"dummy",
PlannerRng::from_entropy(),
)
Expand Down Expand Up @@ -3851,7 +3853,6 @@ mod tests {
let mut builder = BlueprintBuilder::new_based_on(
&logctx.log,
&blueprint3,
&planning_input,
"dummy",
PlannerRng::from_entropy(),
)
Expand Down Expand Up @@ -3904,7 +3905,6 @@ mod tests {
let mut builder = BlueprintBuilder::new_based_on(
&logctx.log,
&blueprint4,
&planning_input,
"dummy",
PlannerRng::from_entropy(),
)
Expand Down Expand Up @@ -3961,7 +3961,6 @@ mod tests {
let blueprint6 = BlueprintBuilder::new_based_on(
&logctx.log,
&blueprint5,
&planning_input,
"dummy",
PlannerRng::from_entropy(),
)
Expand Down Expand Up @@ -4032,7 +4031,6 @@ mod tests {
let blueprint2 = BlueprintBuilder::new_based_on(
&logctx.log,
&blueprint1,
&EMPTY_PLANNING_INPUT,
"test2",
PlannerRng::from_entropy(),
)
Expand All @@ -4041,7 +4039,6 @@ mod tests {
let blueprint3 = BlueprintBuilder::new_based_on(
&logctx.log,
&blueprint1,
&EMPTY_PLANNING_INPUT,
"test3",
PlannerRng::from_entropy(),
)
Expand Down Expand Up @@ -4141,7 +4138,6 @@ mod tests {
let blueprint4 = BlueprintBuilder::new_based_on(
&logctx.log,
&blueprint3,
&EMPTY_PLANNING_INPUT,
"test3",
PlannerRng::from_entropy(),
)
Expand Down Expand Up @@ -4180,7 +4176,6 @@ mod tests {
let blueprint2 = BlueprintBuilder::new_based_on(
&logctx.log,
&blueprint1,
&EMPTY_PLANNING_INPUT,
"test2",
PlannerRng::from_entropy(),
)
Expand Down Expand Up @@ -4365,7 +4360,6 @@ mod tests {
let blueprint2 = BlueprintBuilder::new_based_on(
&logctx.log,
&blueprint1,
&example_system.input,
&format!("{test_name}-2"),
PlannerRng::from_entropy(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,6 @@ mod tests {
let mut builder = BlueprintBuilder::new_based_on(
&opctx.log,
&bp1,
&input,
TEST_NAME,
PlannerRng::from_entropy(),
)
Expand Down Expand Up @@ -1496,7 +1495,6 @@ mod tests {
let mut builder = BlueprintBuilder::new_based_on(
&opctx.log,
&bp2,
&input,
TEST_NAME,
PlannerRng::from_entropy(),
)
Expand Down
2 changes: 1 addition & 1 deletion nexus/db-queries/src/db/datastore/rack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,6 @@ mod test {
let mut builder = BlueprintBuilder::new_based_on(
log,
&EMPTY_BLUEPRINT,
&planning_input,
test_name,
PlannerRng::from_entropy(),
)
Expand All @@ -1224,6 +1223,7 @@ mod test {
for (sled_id, sled_resources) in
planning_input.all_sled_resources(SledFilter::InService)
{
builder.ensure_sled_exists(sled_id, sled_resources.subnet);
builder
.sled_add_disks(sled_id, &sled_resources)
.expect("added disks");
Expand Down
12 changes: 10 additions & 2 deletions nexus/db-queries/src/db/datastore/vpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2980,6 +2980,7 @@ mod tests {
use nexus_db_model::IpConfig;
use nexus_reconfigurator_planning::blueprint_builder::BlueprintBuilder;
use nexus_reconfigurator_planning::blueprint_editor::ExternalNetworkingAllocator;
use nexus_reconfigurator_planning::planner::Planner;
use nexus_reconfigurator_planning::planner::PlannerRng;
use nexus_reconfigurator_planning::system::SledBuilder;
use nexus_reconfigurator_planning::system::SystemDescription;
Expand Down Expand Up @@ -3325,11 +3326,19 @@ mod tests {
let mut builder = BlueprintBuilder::new_based_on(
&logctx.log,
&bp0,
&planning_input,
"test",
PlannerRng::from_entropy(),
)
.expect("created blueprint builder");

// We made changes to the planning input we want to be reflected in
// the new blueprint; reuse the `Planner`'s method for replicating
// those changes.
Planner::update_builder_from_planning_input(
&mut builder,
&planning_input,
);

for &sled_id in &sled_ids {
builder
.sled_add_disks(
Expand Down Expand Up @@ -3418,7 +3427,6 @@ mod tests {
let mut builder = BlueprintBuilder::new_based_on(
&logctx.log,
&bp2,
&planning_input,
"test",
PlannerRng::from_entropy(),
)
Expand Down
Loading
Loading