Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ crucible-common = { git = "https://github.com/oxidecomputer/crucible", rev = "71
# NOTE: See above!
csv = "1.3.1"
curve25519-dalek = "4"
daft = { version = "0.1.4", features = ["derive", "newtype-uuid1", "oxnet01", "uuid1"] }
daft = { version = "0.1.7", features = ["derive", "newtype-uuid1", "oxnet01", "uuid1"] }
display-error-chain = "0.2.2"
omicron-ddm-admin-client = { path = "clients/ddm-admin-client" }
datatest-stable = "0.3.2"
Expand Down
11 changes: 1 addition & 10 deletions dev-tools/omdb/src/bin/omdb/nexus/reconfigurator_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ pub struct ReconfiguratorConfigOpts {
#[clap(long, action = ArgAction::Set)]
planner_enabled: Option<bool>,

#[clap(long, action = ArgAction::Set)]
add_zones_with_mupdate_override: Option<bool>,

#[clap(long, action = ArgAction::Set)]
tuf_repo_pruner_enabled: Option<bool>,
}
Expand All @@ -65,13 +62,7 @@ impl ReconfiguratorConfigOpts {
planner_enabled: self
.planner_enabled
.unwrap_or(current.planner_enabled),
planner_config: PlannerConfig {
add_zones_with_mupdate_override: self
.add_zones_with_mupdate_override
.unwrap_or(
current.planner_config.add_zones_with_mupdate_override,
),
},
planner_config: PlannerConfig::default(),
tuf_repo_pruner_enabled: self
.tuf_repo_pruner_enabled
.unwrap_or(current.tuf_repo_pruner_enabled),
Expand Down
6 changes: 1 addition & 5 deletions dev-tools/omdb/src/bin/omdb/reconfigurator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ async fn cmd_reconfigurator_config_history(
struct SwitchesRow {
version: String,
planner_enabled: String,
add_zones_with_mupdate_override: String,
tuf_repo_pruner_enabled: String,
time_modified: String,
}
Expand All @@ -433,17 +432,14 @@ async fn cmd_reconfigurator_config_history(
config:
ReconfiguratorConfig {
planner_enabled,
planner_config:
PlannerConfig { add_zones_with_mupdate_override },
planner_config: PlannerConfig {},
tuf_repo_pruner_enabled,
},
time_modified,
} = s;
SwitchesRow {
version: version.to_string(),
planner_enabled: planner_enabled.to_string(),
add_zones_with_mupdate_override:
add_zones_with_mupdate_override.to_string(),
tuf_repo_pruner_enabled: tuf_repo_pruner_enabled.to_string(),
time_modified: time_modified.to_string(),
}
Expand Down
21 changes: 1 addition & 20 deletions dev-tools/omdb/tests/successes.out
Original file line number Diff line number Diff line change
Expand Up @@ -2164,8 +2164,6 @@ Reconfigurator config:
modified time: <REDACTED_TIMESTAMP>
tuf repo pruner enabled: true
planner enabled: false
planner config:
add zones with mupdate override: false
---------------------------------------------
stderr:
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
Expand Down Expand Up @@ -2245,21 +2243,6 @@ stdout:
reconfigurator config updated to version 2:
tuf repo pruner enabled: true (unchanged)
* planner enabled::::::::: false -> true
planner config:
add zones with mupdate override: false (unchanged)
---------------------------------------------
stderr:
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
=============================================
EXECUTING COMMAND: omdb ["-w", "nexus", "reconfigurator-config", "set", "--add-zones-with-mupdate-override", "true"]
termination: Exited(0)
---------------------------------------------
stdout:
reconfigurator config updated to version 3:
tuf repo pruner enabled: true (unchanged)
planner enabled::::::::: true (unchanged)
planner config:
* add zones with mupdate override: false -> true
---------------------------------------------
stderr:
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
Expand All @@ -2269,12 +2252,10 @@ termination: Exited(0)
---------------------------------------------
stdout:
Reconfigurator config:
version: 3
version: 2
modified time: <REDACTED_TIMESTAMP>
tuf repo pruner enabled: true
planner enabled: true
planner config:
add zones with mupdate override: true
---------------------------------------------
stderr:
note: using Nexus URL http://127.0.0.1:REDACTED_PORT/
Expand Down
8 changes: 0 additions & 8 deletions dev-tools/omdb/tests/test_all_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,6 @@ async fn test_omdb_success_cases() {
"--planner-enabled",
"true",
],
&[
"-w",
"nexus",
"reconfigurator-config",
"set",
"--add-zones-with-mupdate-override",
"true",
],
&["nexus", "reconfigurator-config", "show", "current"],
&["reconfigurator", "export", tmppath.as_str()],
// We can't easily test the sled agent output because that's only
Expand Down
48 changes: 2 additions & 46 deletions dev-tools/reconfigurator-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use anyhow::{Context, anyhow, bail, ensure};
use camino::Utf8PathBuf;
use chrono::{DateTime, Utc};
use clap::{ArgAction, ValueEnum};
use clap::ValueEnum;
use clap::{Args, Parser, Subcommand};
use daft::Diffable;
use gateway_types::rot::RotSlot;
Expand All @@ -34,6 +34,7 @@ use nexus_reconfigurator_simulation::{
};
use nexus_reconfigurator_simulation::{SimStateBuilder, SimTufRepoSource};
use nexus_reconfigurator_simulation::{SimTufRepoDescription, Simulator};
use nexus_types::deployment::BlueprintHostPhase2DesiredContents;
use nexus_types::deployment::BlueprintMeasurements;
use nexus_types::deployment::CockroachDbSettings;
use nexus_types::deployment::ExpectedVersion;
Expand All @@ -42,9 +43,6 @@ use nexus_types::deployment::execution::blueprint_internal_dns_config;
use nexus_types::deployment::{Blueprint, UnstableReconfiguratorState};
use nexus_types::deployment::{BlueprintArtifactVersion, PendingMgsUpdate};
use nexus_types::deployment::{BlueprintExpungedZoneAccessReason, execution};
use nexus_types::deployment::{
BlueprintHostPhase2DesiredContents, PlannerConfig,
};
use nexus_types::deployment::{BlueprintSource, SledFilter};
use nexus_types::deployment::{
BlueprintZoneImageSource, PendingMgsUpdateDetails,
Expand Down Expand Up @@ -1554,8 +1552,6 @@ enum SetArgs {
/// TUF repo containing release artifacts
filename: Utf8PathBuf,
},
/// planner config
PlannerConfig(SetPlannerConfigArgs),
/// timestamp for ignoring impossible MGS updates
IgnoreImpossibleMgsUpdatesSince {
since: SetIgnoreImpossibleMgsUpdatesSinceArgs,
Expand All @@ -1581,35 +1577,6 @@ impl FromStr for SetIgnoreImpossibleMgsUpdatesSinceArgs {
}
}

#[derive(Debug, Args)]
struct SetPlannerConfigArgs {
#[clap(flatten)]
planner_config: PlannerConfigOpts,
}

// Define the config fields separately so we can use `group(required = true,
// multiple = true).`
#[derive(Debug, Clone, Args)]
#[group(required = true, multiple = true)]
pub struct PlannerConfigOpts {
#[clap(long, action = ArgAction::Set)]
add_zones_with_mupdate_override: Option<bool>,
}

impl PlannerConfigOpts {
fn update_if_modified(
&self,
current: &PlannerConfig,
) -> Option<PlannerConfig> {
let new = PlannerConfig {
add_zones_with_mupdate_override: self
.add_zones_with_mupdate_override
.unwrap_or(current.add_zones_with_mupdate_override),
};
(new != *current).then_some(new)
}
}

#[derive(Debug, Args)]
struct SetCockroachdbSettingsArgs {
#[clap(flatten)]
Expand Down Expand Up @@ -3542,17 +3509,6 @@ fn cmd_set(
);
format!("set target release based on {}", filename)
}
SetArgs::PlannerConfig(args) => {
let current = state.system_mut().description().get_planner_config();
if let Some(new) = args.planner_config.update_if_modified(&current)
{
state.system_mut().description_mut().set_planner_config(new);
let diff = current.diff(&new);
format!("planner config updated:\n{}", diff.display())
} else {
format!("no changes to planner config:\n{}", current.display())
}
}
SetArgs::IgnoreImpossibleMgsUpdatesSince { since } => {
state
.system_mut()
Expand Down

This file was deleted.

15 changes: 5 additions & 10 deletions dev-tools/reconfigurator-cli/tests/input/cmds-example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ inventory-show latest all
blueprint-plan latest
blueprint-diff ade5749d-bdf3-4fab-a8ae-00bea01b3a5a latest

# Set planner config.
set planner-config --add-zones-with-mupdate-override false
set planner-config --add-zones-with-mupdate-override true
set planner-config --add-zones-with-mupdate-override true

# Sled index out of bounds, will error out.
wipe all
load-example --seed test-basic --nsleds 3 --sled-policy 3:non-provisionable
Expand All @@ -72,15 +67,15 @@ log
log --verbose

# Switch states with a full UUID.
switch 4d8d6725-1ae3-4f88-b9cb-a34db82d7439
switch 4a3b153b-fc8a-485a-baee-badaad53d2fc
log

# Switch states with a unique prefix.
switch 860f
switch 0a3
log

# Switch states with an ambiguous prefix (should fail).
switch 4
switch 2

# Switch states with a non-existent prefix (should fail).
switch zzzz
Expand All @@ -90,11 +85,11 @@ sled-add
sled-add

# Make an additional branch based on the previous branch.
switch 4d8d6725
switch 860f
sled-add

# Go back to the previous branch.
switch 5c53cf4b
switch 4d8d6725

log
log --verbose
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ blueprint-diff 3f00b694-1b16-4aaa-8f78-e6b3a527b434 366b0b68-d80e-4bc1-abd3-dc69

blueprint-show 366b0b68-d80e-4bc1-abd3-dc69837847e0

# Set the add_zones_with_mupdate_override planner config to ensure that zone
# adds happen despite zone image sources not being Artifact.
set planner-config --add-zones-with-mupdate-override true

# blueprint-plan will place a new external DNS zone, diff DNS to see the new zone has `ns<N>` and NS records.
blueprint-plan 366b0b68-d80e-4bc1-abd3-dc69837847e0
blueprint-diff 366b0b68-d80e-4bc1-abd3-dc69837847e0 9c998c1d-1a7b-440a-ae0c-40f781dea6e2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,13 @@ inventory-generate
blueprint-plan latest latest
blueprint-diff latest

# Test that the add-zones-with-mupdate-override planner config works as
# expected. We do this by:
# Test that adding a new sled while a mupdate override is active does not
# cause the planner to add new zones to it. We do this by:
# * setting the mupdate override on a sled
# * adding a new sled
#
# With the option disabled (the current state), the planner will
# not proceed with adding new zones. But with the option enabled,
# new zones will be added.
# The planner will not proceed with adding new zones while any sled has an
# active mupdate override.

# Apply the blueprint edits to sled 0. This also lets the planner see
# that the internal_dns zone is expunged, setting up a replacement
Expand All @@ -238,20 +237,10 @@ sled-add c3bc4c6d-fdde-4fc4-8493-89d2a1e5ee6b
inventory-generate

# This will *not* generate the datasets and internal NTP zone on the new
# sled.
# sled, because zone adds are blocked while a mupdate override is present.
blueprint-plan latest latest
blueprint-diff latest

# This *will* generate the datasets and internal NTP zone on the new sled.
set planner-config --add-zones-with-mupdate-override true
blueprint-plan latest latest
# TODO: This blippy run produces two FATAL notes, due to, respectively:
#
# * https://github.com/oxidecomputer/omicron/issues/10420
# * https://github.com/oxidecomputer/omicron/pull/10363
blueprint-blippy latest
blueprint-diff latest

# Set the target release minimum generation to a large value -- we're going to
# test that the planner bails if it attempts a rollback of the target release
# minimum generation.
Expand Down
Loading
Loading