Skip to content

Commit ce2520e

Browse files
committed
example system: start with truly empty blueprint
1 parent 620e8af commit ce2520e

File tree

4 files changed

+30
-25
lines changed

4 files changed

+30
-25
lines changed

dev-tools/reconfigurator-cli/tests/output/cmds-blueprint-history-stdout

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ blueprint df06bb57-ad42-4431-9206-abff322896c7 created from blueprint af934083-5
2626
> # which does not include any of those blueprints.
2727
> blueprint-history
2828
TIME BLUEPRINT
29-
<REDACTED_TIMESTAMP> 184f10b3-61cb-41ef-9b93-3489b2bac559 starting blueprint with 3 empty sleds
29+
<REDACTED_TIMESTAMP> 184f10b3-61cb-41ef-9b93-3489b2bac559 starting blueprint with 0 empty sleds
3030
<REDACTED_TIMESTAMP> dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21
3131

3232

3333

3434
> # You can give it a specific blueprint.
3535
> blueprint-history 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1
3636
TIME BLUEPRINT
37-
<REDACTED_TIMESTAMP> 184f10b3-61cb-41ef-9b93-3489b2bac559 starting blueprint with 3 empty sleds
37+
<REDACTED_TIMESTAMP> 184f10b3-61cb-41ef-9b93-3489b2bac559 starting blueprint with 0 empty sleds
3838
<REDACTED_TIMESTAMP> dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21
3939
<REDACTED_TIMESTAMP> 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1
4040

@@ -43,7 +43,7 @@ TIME BLUEPRINT
4343
> # Running it from the latest blueprint should report all of them.
4444
> blueprint-history latest
4545
TIME BLUEPRINT
46-
<REDACTED_TIMESTAMP> 184f10b3-61cb-41ef-9b93-3489b2bac559 starting blueprint with 3 empty sleds
46+
<REDACTED_TIMESTAMP> 184f10b3-61cb-41ef-9b93-3489b2bac559 starting blueprint with 0 empty sleds
4747
<REDACTED_TIMESTAMP> dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21
4848
<REDACTED_TIMESTAMP> 8da82a8e-bf97-4fbd-8ddd-9f6462732cf1
4949
<REDACTED_TIMESTAMP> 58d5e830-0884-47d8-a7cd-b2b3751adeb4
@@ -64,21 +64,21 @@ TIME BLUEPRINT
6464
> # Show diffs, too.
6565
> blueprint-history --diff latest
6666
TIME BLUEPRINT
67-
<REDACTED_TIMESTAMP> 184f10b3-61cb-41ef-9b93-3489b2bac559 starting blueprint with 3 empty sleds
67+
<REDACTED_TIMESTAMP> 184f10b3-61cb-41ef-9b93-3489b2bac559 starting blueprint with 0 empty sleds
6868
<REDACTED_TIMESTAMP> dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21
6969
from: blueprint 184f10b3-61cb-41ef-9b93-3489b2bac559
7070
to: blueprint dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21
7171

72-
MODIFIED SLEDS:
72+
ADDED SLEDS:
7373

74-
sled 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c (active, config generation 1 -> 2):
74+
sled 2b8f0cb3-0295-4b3c-bc58-4fe88b57112c (active, config generation 2):
7575

7676
host phase 2 contents:
7777
------------------------
7878
slot boot image source
7979
------------------------
80-
A current contents
81-
B current contents
80+
+ A current contents
81+
+ B current contents
8282

8383

8484
physical disks:
@@ -184,14 +184,14 @@ to: blueprint dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21
184184
+ nexus 466a9f29-62bf-4e63-924a-b9efdb86afec install dataset in service fd00:1122:3344:102::22
185185

186186

187-
sled 98e6b7c2-2efa-41ca-b20a-0a4d61102fe6 (active, config generation 1 -> 2):
187+
sled 98e6b7c2-2efa-41ca-b20a-0a4d61102fe6 (active, config generation 2):
188188

189189
host phase 2 contents:
190190
------------------------
191191
slot boot image source
192192
------------------------
193-
A current contents
194-
B current contents
193+
+ A current contents
194+
+ B current contents
195195

196196

197197
physical disks:
@@ -294,14 +294,14 @@ to: blueprint dbcbd3d6-41ff-48ae-ac0b-1becc9b2fd21
294294
+ nexus 0c71b3b2-6ceb-4e8f-b020-b08675e83038 install dataset in service fd00:1122:3344:101::22
295295

296296

297-
sled d81c6a84-79b8-4958-ae41-ea46c9b19763 (active, config generation 1 -> 2):
297+
sled d81c6a84-79b8-4958-ae41-ea46c9b19763 (active, config generation 2):
298298

299299
host phase 2 contents:
300300
------------------------
301301
slot boot image source
302302
------------------------
303-
A current contents
304-
B current contents
303+
+ A current contents
304+
+ B current contents
305305

306306

307307
physical disks:

dev-tools/reconfigurator-cli/tests/output/cmds-example-stdout

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -694,16 +694,16 @@ external DNS:
694694
from: blueprint 02697f74-b14a-4418-90f0-c28b2a3a6aa9
695695
to: blueprint 86db3308-f817-4626-8838-4085949a6a41
696696

697-
MODIFIED SLEDS:
697+
ADDED SLEDS:
698698

699-
sled 89d02b1b-478c-401a-8e28-7a26f74fa41b (active, config generation 1 -> 2):
699+
sled 89d02b1b-478c-401a-8e28-7a26f74fa41b (active, config generation 2):
700700

701701
host phase 2 contents:
702702
------------------------
703703
slot boot image source
704704
------------------------
705-
A current contents
706-
B current contents
705+
+ A current contents
706+
+ B current contents
707707

708708

709709
physical disks:
@@ -914,16 +914,16 @@ external DNS:
914914
from: blueprint 86db3308-f817-4626-8838-4085949a6a41
915915
to: blueprint 02697f74-b14a-4418-90f0-c28b2a3a6aa9
916916

917-
MODIFIED SLEDS:
917+
REMOVED SLEDS:
918918

919-
sled 89d02b1b-478c-401a-8e28-7a26f74fa41b (active, config generation 2 -> 1):
919+
sled 89d02b1b-478c-401a-8e28-7a26f74fa41b (was active, config generation 2):
920920

921921
host phase 2 contents:
922922
------------------------
923923
slot boot image source
924924
------------------------
925-
A current contents
926-
B current contents
925+
- A current contents
926+
- B current contents
927927

928928

929929
physical disks:

nexus/reconfigurator/planning/src/blueprint_builder/builder.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,12 @@ impl<'a> BlueprintBuilder<'a> {
536536
Self::build_empty_with_sleds(iter::empty(), creator)
537537
}
538538

539+
/// A version of [`Self::build_empty`] that allows the
540+
/// blueprint ID to be generated from a deterministic RNG.
541+
pub fn build_empty_seeded(creator: &str, rng: PlannerRng) -> Blueprint {
542+
Self::build_empty_with_sleds_seeded(iter::empty(), creator, rng)
543+
}
544+
539545
/// Directly construct a `Blueprint` that contains an empty zone config for
540546
/// the given sleds.
541547
pub fn build_empty_with_sleds(

nexus/reconfigurator/planning/src/example.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,8 @@ impl ExampleSystemBuilder {
535535

536536
let base_input = input_builder.clone().build();
537537

538-
// Start with an empty blueprint containing only our sleds, no zones.
539-
let initial_blueprint = BlueprintBuilder::build_empty_with_sleds_seeded(
540-
base_input.all_sled_ids(SledFilter::Commissioned),
538+
// Start with an empty blueprint.
539+
let initial_blueprint = BlueprintBuilder::build_empty_seeded(
541540
"test suite",
542541
rng.blueprint1_rng,
543542
);

0 commit comments

Comments
 (0)