Skip to content

Commit 0430d3d

Browse files
committed
Merge branch 'main' into ben/add-external-ip-pool-service-association-table
2 parents 604601d + c0f4725 commit 0430d3d

95 files changed

Lines changed: 3612 additions & 655 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Cargo.lock‎

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎clients/bootstrap-agent-lockstep-client/src/lib.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ progenitor::generate_api!(
4242
RssStep = bootstrap_agent_lockstep_types::RssStep,
4343
ScrimletReconcilersStatus = bootstrap_agent_lockstep_types::scrimlet_reconcilers::ScrimletReconcilersStatus,
4444
ServiceIpPoolConfig = bootstrap_agent_lockstep_types::ServiceIpPoolConfig,
45+
SledAgentInfo = bootstrap_agent_lockstep_types::SledAgentInfo,
46+
StartSledAgentStatus = bootstrap_agent_lockstep_types::StartSledAgentStatus,
4547
SwitchSlot = sled_agent_types::early_networking::SwitchSlot,
4648
TxEqConfig = sled_agent_types::early_networking::TxEqConfig,
4749
UplinkAddressConfig = sled_agent_types::early_networking::UplinkAddressConfig,

‎clients/wicketd-client/src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ progenitor::generate_api!(
3939
ArtifactId = wicket_common::artifact::ArtifactId,
4040
Baseboard = sled_hardware_types::Baseboard,
4141
BaseboardId = sled_hardware_types::BaseboardId,
42-
BgpAuthKey = wicketd_commission_types_versions::latest::rack_setup::BgpAuthKey,
4342
BgpAuthKeyId = wicketd_commission_types_versions::latest::rack_setup::BgpAuthKeyId,
4443
BgpAuthKeyInfo = wicket_common::rack_setup::BgpAuthKeyInfo,
4544
BgpAuthKeyStatus = wicket_common::rack_setup::BgpAuthKeyStatus,

‎dev-tools/omdb/src/bin/omdb/db.rs‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ use nexus_db_errors::OptionalError;
6666
use nexus_db_lookup::DataStoreConnection;
6767
use nexus_db_lookup::LookupPath;
6868
use nexus_db_model::CrucibleDataset;
69+
use nexus_db_model::DbSledBpAvailability;
6970
use nexus_db_model::DnsGroup;
7071
use nexus_db_model::DnsName;
7172
use nexus_db_model::DnsVersion;
@@ -4659,18 +4660,24 @@ struct SledRow {
46594660
role: &'static str,
46604661
policy: SledPolicy,
46614662
state: SledState,
4663+
#[tabled(rename = "BP AVAIL")]
4664+
bp_availability: &'static str,
46624665
id: SledUuid,
46634666
}
46644667

4665-
impl From<Sled> for SledRow {
4666-
fn from(s: Sled) -> Self {
4668+
impl SledRow {
4669+
fn new(s: Sled, bp_availability: Option<DbSledBpAvailability>) -> Self {
46674670
SledRow {
46684671
id: s.id(),
46694672
serial: s.serial_number().to_string(),
46704673
ip: s.address().to_string(),
46714674
role: if s.is_scrimlet() { "scrimlet" } else { "-" },
46724675
policy: s.policy(),
46734676
state: s.state().into(),
4677+
bp_availability: match bp_availability {
4678+
Some(state) => state.label(),
4679+
None => "(missing)",
4680+
},
46744681
}
46754682
}
46764683
}
@@ -4700,7 +4707,19 @@ async fn cmd_db_sleds(
47004707
.context("listing sleds")?;
47014708
check_limit(&sleds, limit, || String::from("listing sleds"));
47024709

4703-
let rows = sleds.into_iter().map(|s| SledRow::from(s));
4710+
// Look up each sled's reconfigurator provisioning availability from the
4711+
// `rendezvous_sled_bp_availability` rendezvous table. A sled might not be
4712+
// present in the table (e.g. it was just added and the reconciliation task
4713+
// has not run yet), in which case it is rendered as `(missing)`.
4714+
let bp_availability = datastore
4715+
.rendezvous_sled_bp_availability_list_all_batched(opctx)
4716+
.await
4717+
.context("listing sled bp-availability rendezvous rows")?;
4718+
4719+
let rows = sleds.into_iter().map(|s| {
4720+
let state = bp_availability.get(&s.id()).map(|r| r.bp_availability());
4721+
SledRow::new(s, state)
4722+
});
47044723
let table = tabled::Table::new(rows)
47054724
.with(tabled::settings::Style::empty())
47064725
.with(tabled::settings::Padding::new(1, 1, 0, 0))

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,7 @@ fn print_task_blueprint_rendezvous(details: &serde_json::Value) {
17071707
crucible_dataset,
17081708
local_storage_dataset,
17091709
local_storage_unencrypted_dataset,
1710+
sled_blueprint_availability,
17101711
} = status.stats;
17111712

17121713
print_datasets_rendezvous_stats(&debug_dataset, "debug_dataset");
@@ -1735,6 +1736,40 @@ fn print_task_blueprint_rendezvous(details: &serde_json::Value) {
17351736
&local_storage_unencrypted_dataset,
17361737
"local_storage_unencrypted_dataset",
17371738
);
1739+
1740+
println!(" sled_blueprint_availability rendezvous counts:");
1741+
println!(
1742+
" num_marked_available: {}",
1743+
sled_blueprint_availability.num_marked_available
1744+
);
1745+
println!(
1746+
" num_marked_unavailable: {}",
1747+
sled_blueprint_availability.num_marked_unavailable
1748+
);
1749+
println!(
1750+
" num_unchanged: {}",
1751+
sled_blueprint_availability.num_unchanged
1752+
);
1753+
println!(
1754+
" num_invariant_violations: {}",
1755+
sled_blueprint_availability.num_invariant_violations
1756+
);
1757+
println!(
1758+
" num_decommissioned: {}",
1759+
sled_blueprint_availability.num_decommissioned
1760+
);
1761+
println!(
1762+
" num_already_decommissioned: {}",
1763+
sled_blueprint_availability.num_already_decommissioned
1764+
);
1765+
println!(
1766+
" num_not_in_blueprint: {}",
1767+
sled_blueprint_availability.num_not_in_blueprint
1768+
);
1769+
println!(
1770+
" num_decommissioned_not_in_blueprint: {}",
1771+
sled_blueprint_availability.num_decommissioned_not_in_blueprint
1772+
);
17381773
}
17391774
}
17401775
}

‎dev-tools/omdb/tests/env.out‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ EXECUTING COMMAND: omdb ["db", "--db-url", "postgresql://root@[::1]:REDACTED_POR
22
termination: Exited(0)
33
---------------------------------------------
44
stdout:
5-
SERIAL IP ROLE POLICY STATE ID
6-
SimGimlet01 [::1]:REDACTED_PORT scrimlet in service active ..........<REDACTED_UUID>...........
7-
SimGimlet00 [::1]:REDACTED_PORT scrimlet in service active ..........<REDACTED_UUID>...........
5+
SERIAL IP ROLE POLICY STATE BP AVAIL ID
6+
SimGimlet01 [::1]:REDACTED_PORT scrimlet in service active available ..........<REDACTED_UUID>...........
7+
SimGimlet00 [::1]:REDACTED_PORT scrimlet in service active available ..........<REDACTED_UUID>...........
88
---------------------------------------------
99
stderr:
1010
note: using database URL postgresql://root@[::1]:REDACTED_PORT/omicron?sslmode=disable
@@ -803,9 +803,9 @@ EXECUTING COMMAND: omdb ["db", "sleds"]
803803
termination: Exited(0)
804804
---------------------------------------------
805805
stdout:
806-
SERIAL IP ROLE POLICY STATE ID
807-
SimGimlet01 [::1]:REDACTED_PORT scrimlet in service active ..........<REDACTED_UUID>...........
808-
SimGimlet00 [::1]:REDACTED_PORT scrimlet in service active ..........<REDACTED_UUID>...........
806+
SERIAL IP ROLE POLICY STATE BP AVAIL ID
807+
SimGimlet01 [::1]:REDACTED_PORT scrimlet in service active available ..........<REDACTED_UUID>...........
808+
SimGimlet00 [::1]:REDACTED_PORT scrimlet in service active available ..........<REDACTED_UUID>...........
809809
---------------------------------------------
810810
stderr:
811811
note: database URL not specified. Will search DNS.
@@ -818,9 +818,9 @@ EXECUTING COMMAND: omdb ["--dns-server", "[::1]:REDACTED_PORT", "db", "sleds"]
818818
termination: Exited(0)
819819
---------------------------------------------
820820
stdout:
821-
SERIAL IP ROLE POLICY STATE ID
822-
SimGimlet01 [::1]:REDACTED_PORT scrimlet in service active ..........<REDACTED_UUID>...........
823-
SimGimlet00 [::1]:REDACTED_PORT scrimlet in service active ..........<REDACTED_UUID>...........
821+
SERIAL IP ROLE POLICY STATE BP AVAIL ID
822+
SimGimlet01 [::1]:REDACTED_PORT scrimlet in service active available ..........<REDACTED_UUID>...........
823+
SimGimlet00 [::1]:REDACTED_PORT scrimlet in service active available ..........<REDACTED_UUID>...........
824824
---------------------------------------------
825825
stderr:
826826
note: database URL not specified. Will search DNS.

‎dev-tools/omdb/tests/successes.out‎

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ EXECUTING COMMAND: omdb ["db", "sleds"]
8989
termination: Exited(0)
9090
---------------------------------------------
9191
stdout:
92-
SERIAL IP ROLE POLICY STATE ID
93-
SimGimlet01 [::1]:REDACTED_PORT scrimlet in service active ..........<REDACTED_UUID>...........
94-
SimGimlet00 [::1]:REDACTED_PORT scrimlet in service active ..........<REDACTED_UUID>...........
92+
SERIAL IP ROLE POLICY STATE BP AVAIL ID
93+
SimGimlet01 [::1]:REDACTED_PORT scrimlet in service active available ..........<REDACTED_UUID>...........
94+
SimGimlet00 [::1]:REDACTED_PORT scrimlet in service active available ..........<REDACTED_UUID>...........
9595
---------------------------------------------
9696
stderr:
9797
note: using database URL postgresql://root@[::1]:REDACTED_PORT/omicron?sslmode=disable
@@ -102,9 +102,9 @@ EXECUTING COMMAND: omdb ["db", "sleds", "-F", "discretionary"]
102102
termination: Exited(0)
103103
---------------------------------------------
104104
stdout:
105-
SERIAL IP ROLE POLICY STATE ID
106-
SimGimlet01 [::1]:REDACTED_PORT scrimlet in service active ..........<REDACTED_UUID>...........
107-
SimGimlet00 [::1]:REDACTED_PORT scrimlet in service active ..........<REDACTED_UUID>...........
105+
SERIAL IP ROLE POLICY STATE BP AVAIL ID
106+
SimGimlet01 [::1]:REDACTED_PORT scrimlet in service active available ..........<REDACTED_UUID>...........
107+
SimGimlet00 [::1]:REDACTED_PORT scrimlet in service active available ..........<REDACTED_UUID>...........
108108
---------------------------------------------
109109
stderr:
110110
note: using database URL postgresql://root@[::1]:REDACTED_PORT/omicron?sslmode=disable
@@ -661,6 +661,15 @@ task: "blueprint_rendezvous"
661661
num_not_in_inventory: 0
662662
num_tombstoned: 0
663663
num_already_tombstoned: 0
664+
sled_blueprint_availability rendezvous counts:
665+
num_marked_available: 0
666+
num_marked_unavailable: 0
667+
num_unchanged: 2
668+
num_invariant_violations: 0
669+
num_decommissioned: 0
670+
num_already_decommissioned: 0
671+
num_not_in_blueprint: 0
672+
num_decommissioned_not_in_blueprint: 0
664673

665674
task: "crdb_node_id_collector"
666675
configured period: every <REDACTED_DURATION>m
@@ -1374,6 +1383,15 @@ task: "blueprint_rendezvous"
13741383
num_not_in_inventory: 0
13751384
num_tombstoned: 0
13761385
num_already_tombstoned: 0
1386+
sled_blueprint_availability rendezvous counts:
1387+
num_marked_available: 0
1388+
num_marked_unavailable: 0
1389+
num_unchanged: 2
1390+
num_invariant_violations: 0
1391+
num_decommissioned: 0
1392+
num_already_decommissioned: 0
1393+
num_not_in_blueprint: 0
1394+
num_decommissioned_not_in_blueprint: 0
13771395

13781396
task: "crdb_node_id_collector"
13791397
configured period: every <REDACTED_DURATION>m

‎dev-tools/omdb/tests/test_all_output.rs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use expectorate::assert_contents;
1212
use gateway_client::ClientInfo as _;
1313
use http::StatusCode;
1414
use nexus_test_utils::background::activate_background_task;
15+
use nexus_test_utils::background::run_blueprint_rendezvous;
1516
use nexus_test_utils::wait_for_producer;
1617
use nexus_test_utils::{OXIMETER_UUID, PRODUCER_UUID};
1718
use nexus_test_utils_macros::nexus_test;
@@ -247,6 +248,14 @@ async fn test_omdb_success_cases() {
247248
activate_background_task(lockstep_client, "fm_rendezvous").await;
248249
activate_background_task(lockstep_client, "fm_sitrep_history_pruner").await;
249250

251+
// Populate the `rendezvous_sled_bp_availability` table deterministically so
252+
// the BP AVAIL column in `omdb db sleds` has data present in it. Run
253+
// this twice: the first pass populates the table (unless a watch-triggered
254+
// activation already did), and the second reaches the steady state
255+
// asserted by the expectorate output.
256+
run_blueprint_rendezvous(&cptestctx.lockstep_client).await;
257+
run_blueprint_rendezvous(&cptestctx.lockstep_client).await;
258+
250259
let mut output = String::new();
251260

252261
let invocations: &[&[&str]] = &[
@@ -707,6 +716,15 @@ async fn test_omdb_env_settings(cptestctx: &ControlPlaneTestContext) {
707716
let dns_sockaddr = cptestctx.internal_dns.dns_server.local_address();
708717
let mut output = String::new();
709718

719+
// The blueprint_rendezvous task needs an inventory collection to run.
720+
cptestctx
721+
.wait_for_at_least_one_inventory_collection(Duration::from_secs(60))
722+
.await;
723+
724+
// Populate the `rendezvous_sled_bp_availability` table deterministically so
725+
// the BP AVAIL column in `omdb db sleds` has data present in it.
726+
run_blueprint_rendezvous(&cptestctx.lockstep_client).await;
727+
710728
// Database URL
711729
// Case 1: specified on the command line
712730
let args = &["db", "--db-url", &postgres_url, "sleds"];

‎dev-tools/rack-init-config/src/lib.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ mod tests {
148148
autoneg: false,
149149
lldp: Some(lldp("uplink-0")),
150150
tx_eq: None,
151+
allow_ddm_traffic: false,
151152
};
152153
RackInitializeRequest {
153154
trust_quorum_peers: Some(trust_quorum_peers()),
@@ -219,6 +220,7 @@ mod tests {
219220
autoneg: false,
220221
lldp: Some(lldp("uplink-0")),
221222
tx_eq: None,
223+
allow_ddm_traffic: false,
222224
};
223225
let mut request = static_bfd_request();
224226
request.rack_network_config = RackNetworkConfig {

‎nexus/db-model/src/lib.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ mod producer_endpoint;
191191
mod project;
192192
mod reconfigurator_config;
193193
mod rendezvous_debug_dataset;
194+
mod rendezvous_sled_bp_availability;
194195
mod scim_client_bearer_token;
195196
mod semver_version;
196197
mod serde_time_delta;
@@ -354,6 +355,7 @@ pub use region_snapshot::*;
354355
pub use region_snapshot_replacement::*;
355356
pub use region_snapshot_replacement_step::*;
356357
pub use rendezvous_debug_dataset::*;
358+
pub use rendezvous_sled_bp_availability::*;
357359
pub use role_assignment::*;
358360
pub use saga_types::*;
359361
pub use schema_versions::*;

0 commit comments

Comments
 (0)