Skip to content

Commit 48dce2a

Browse files
committed
Kill InterimPlanningReport
Compute the new blueprint ID up front instead. Requires passing a PlannerRng to the initializers.
1 parent 2feacef commit 48dce2a

File tree

13 files changed

+128
-147
lines changed

13 files changed

+128
-147
lines changed

dev-tools/reconfigurator-cli/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,9 +1565,9 @@ fn cmd_blueprint_plan(
15651565
&planning_input,
15661566
creator,
15671567
collection,
1568+
rng,
15681569
)
1569-
.context("creating planner")?
1570-
.with_rng(rng);
1570+
.context("creating planner")?;
15711571

15721572
let blueprint = planner.plan().context("generating blueprint")?;
15731573
let rv = format!(
@@ -1610,9 +1610,9 @@ fn cmd_blueprint_edit(
16101610
&planning_input,
16111611
&latest_collection,
16121612
creator,
1613+
rng,
16131614
)
16141615
.context("creating blueprint builder")?;
1615-
builder.set_rng(rng);
16161616

16171617
if let Some(comment) = args.comment {
16181618
builder.comment(comment);

live-tests/tests/common/reconfigurator.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use anyhow::{Context, ensure};
88
use nexus_client::types::BlueprintTargetSet;
99
use nexus_reconfigurator_planning::blueprint_builder::BlueprintBuilder;
10+
use nexus_reconfigurator_planning::planner::PlannerRng;
1011
use nexus_types::deployment::{Blueprint, PlanningInput};
1112
use nexus_types::inventory::Collection;
1213
use omicron_uuid_kinds::GenericUuid;
@@ -73,6 +74,7 @@ pub async fn blueprint_edit_current_target(
7374
&planning_input,
7475
&collection,
7576
"test-suite",
77+
PlannerRng::from_entropy(),
7678
)
7779
.context("creating BlueprintBuilder")?;
7880

live-tests/tests/test_nexus_add_remove.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use nexus_client::types::SagaState;
1616
use nexus_inventory::CollectionBuilder;
1717
use nexus_reconfigurator_planning::blueprint_builder::BlueprintBuilder;
1818
use nexus_reconfigurator_planning::planner::Planner;
19+
use nexus_reconfigurator_planning::planner::PlannerRng;
1920
use nexus_reconfigurator_preparation::PlanningInputFromDb;
2021
use nexus_sled_agent_shared::inventory::ZoneKind;
2122
use nexus_types::deployment::BlueprintZoneDisposition;
@@ -256,6 +257,7 @@ async fn test_nexus_add_remove(lc: &LiveTestContext) {
256257
&planning_input,
257258
"live test suite",
258259
&latest_collection,
260+
PlannerRng::from_entropy(),
259261
)
260262
.expect("constructing planner");
261263
let new_blueprint = planner.plan().expect("creating blueprint");

nexus/db-queries/src/db/datastore/deployment.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2354,6 +2354,7 @@ mod tests {
23542354
use nexus_reconfigurator_planning::blueprint_builder::EnsureMultiple;
23552355
use nexus_reconfigurator_planning::example::ExampleSystemBuilder;
23562356
use nexus_reconfigurator_planning::example::example;
2357+
use nexus_reconfigurator_planning::planner::PlannerRng;
23572358
use nexus_types::deployment::BlueprintArtifactVersion;
23582359
use nexus_types::deployment::BlueprintHostPhase2DesiredContents;
23592360
use nexus_types::deployment::BlueprintHostPhase2DesiredSlots;
@@ -2742,6 +2743,7 @@ mod tests {
27422743
&planning_input,
27432744
&collection,
27442745
"test",
2746+
PlannerRng::from_entropy(),
27452747
)
27462748
.expect("failed to create builder");
27472749

@@ -3083,6 +3085,7 @@ mod tests {
30833085
&planning_input,
30843086
&collection,
30853087
"dummy",
3088+
PlannerRng::from_entropy(),
30863089
)
30873090
.expect("failed to create builder")
30883091
.build();
@@ -3160,6 +3163,7 @@ mod tests {
31603163
&EMPTY_PLANNING_INPUT,
31613164
&collection,
31623165
"test2",
3166+
PlannerRng::from_entropy(),
31633167
)
31643168
.expect("failed to create builder")
31653169
.build();
@@ -3169,6 +3173,7 @@ mod tests {
31693173
&EMPTY_PLANNING_INPUT,
31703174
&collection,
31713175
"test3",
3176+
PlannerRng::from_entropy(),
31723177
)
31733178
.expect("failed to create builder")
31743179
.build();
@@ -3269,6 +3274,7 @@ mod tests {
32693274
&EMPTY_PLANNING_INPUT,
32703275
&collection,
32713276
"test3",
3277+
PlannerRng::from_entropy(),
32723278
)
32733279
.expect("failed to create builder")
32743280
.build();
@@ -3314,6 +3320,7 @@ mod tests {
33143320
&EMPTY_PLANNING_INPUT,
33153321
&collection,
33163322
"test2",
3323+
PlannerRng::from_entropy(),
33173324
)
33183325
.expect("failed to create builder")
33193326
.build();
@@ -3546,6 +3553,7 @@ mod tests {
35463553
&example_system.input,
35473554
&example_system.collection,
35483555
&format!("{test_name}-2"),
3556+
PlannerRng::from_entropy(),
35493557
)
35503558
.expect("failed to create builder")
35513559
.build();

nexus/db-queries/src/db/datastore/vpc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2967,6 +2967,7 @@ mod tests {
29672967
use nexus_db_fixed_data::vpc_subnet::NEXUS_VPC_SUBNET;
29682968
use nexus_db_model::IncompleteNetworkInterface;
29692969
use nexus_reconfigurator_planning::blueprint_builder::BlueprintBuilder;
2970+
use nexus_reconfigurator_planning::planner::PlannerRng;
29702971
use nexus_reconfigurator_planning::system::SledBuilder;
29712972
use nexus_reconfigurator_planning::system::SystemDescription;
29722973
use nexus_types::deployment::Blueprint;
@@ -3315,6 +3316,7 @@ mod tests {
33153316
&planning_input,
33163317
&collection,
33173318
"test",
3319+
PlannerRng::from_entropy(),
33183320
)
33193321
.expect("created blueprint builder");
33203322
for &sled_id in &sled_ids {
@@ -3399,6 +3401,7 @@ mod tests {
33993401
&planning_input,
34003402
&collection,
34013403
"test",
3404+
PlannerRng::from_entropy(),
34023405
)
34033406
.expect("created blueprint builder");
34043407
for &sled_id in &sled_ids {

nexus/reconfigurator/execution/src/dns.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ mod test {
323323
use nexus_inventory::now_db_precision;
324324
use nexus_reconfigurator_planning::blueprint_builder::BlueprintBuilder;
325325
use nexus_reconfigurator_planning::example::ExampleSystemBuilder;
326+
use nexus_reconfigurator_planning::planner::PlannerRng;
326327
use nexus_reconfigurator_preparation::PlanningInputFromDb;
327328
use nexus_sled_agent_shared::inventory::OmicronZoneConfig;
328329
use nexus_sled_agent_shared::inventory::OmicronZoneImageSource;
@@ -1522,6 +1523,7 @@ mod test {
15221523
&planning_input,
15231524
&collection,
15241525
"test suite",
1526+
PlannerRng::from_entropy(),
15251527
)
15261528
.unwrap();
15271529
let sled_id =

0 commit comments

Comments
 (0)