Skip to content

Commit

Permalink
a bit of cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rcgoodfellow committed Oct 10, 2023
1 parent 737adcf commit 518247b
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 50 deletions.
2 changes: 0 additions & 2 deletions nexus/db-queries/src/db/datastore/bgp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@ impl DataStore {
}
type TxnError = TransactionError<BgpAnnounceListError>;

//TODO this is probably best done as a query with a join instaed of a
//transaction.
let pool = self.pool_connection_authorized(opctx).await?;
pool.transaction_async(|conn| async move {
let name_or_id = sel.name_or_id.clone();
Expand Down
7 changes: 4 additions & 3 deletions nexus/db-queries/src/db/datastore/switch_port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1157,9 +1157,10 @@ impl DataStore {
.eq(route_config_dsl::port_settings_id.nullable())),
)
.select(SwitchPort::as_select())
// TODO: #3592 Correctness In single rack deployments there are only
// 64 ports. We'll need pagination in the future, or maybe a way to
// constrain the query to a rack?
// TODO: #3592 Correctness
// In single rack deployments there are only 64 ports. We'll need
// pagination in the future, or maybe a way to constrain the query to
// a rack?
.limit(64)
.load_async::<SwitchPort>(
&*self.pool_connection_authorized(opctx).await?,
Expand Down
14 changes: 10 additions & 4 deletions nexus/src/app/bgp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ impl super::Nexus {
for (switch, client) in &self.mg_clients {
let router_info = match client.inner.get_routers().await {
Ok(result) => result.into_inner(),
Err(_e) => {
//TODO log
Err(e) => {
error!(
self.log,
"failed to get routers from {switch}: {e}"
);
continue;
}
};
Expand Down Expand Up @@ -143,8 +146,11 @@ impl super::Nexus {
id: x.id,
})
.collect(),
Err(_e) => {
//TODO log
Err(e) => {
error!(
self.log,
"failed to get BGP imported from {switch}: {e}"
);
continue;
}
};
Expand Down
11 changes: 0 additions & 11 deletions nexus/src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ pub struct Nexus {
/// Map switch location to maghemite admin clients.
mg_clients: HashMap<SwitchLocation, Arc<mg_admin_client::Client>>,

// /// Map switch location to scrimlet sled agent clients.
// XXX? scrimlet_clients: HashMap<SwitchLocation, Arc<sled_agent_client::Client>>,
/// Background tasks
background_tasks: background::BackgroundTasks,

Expand Down Expand Up @@ -218,14 +216,6 @@ impl Nexus {
Arc<mg_admin_client::Client>,
> = HashMap::new();

//XXX?
/*
let scrimlet_clients: HashMap<
SwitchLocation,
Arc<sled_agent_client::Client>,
> = HashMap::new();
*/

// Currently static dpd configuration mappings are still required for
// testing
for (location, config) in &config.pkg.dendrite {
Expand Down Expand Up @@ -387,7 +377,6 @@ impl Nexus {
external_resolver,
dpd_clients,
mg_clients,
//XXX? scrimlet_clients,
background_tasks,
default_region_allocation_strategy: config
.pkg
Expand Down
7 changes: 6 additions & 1 deletion nexus/src/app/switch_port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ impl super::Nexus {
) -> CreateResult<SwitchPortSettingsCombinedResult> {
opctx.authorize(authz::Action::Modify, &authz::FLEET).await?;

//TODO race conditions on exists check versus update/create.
//TODO(ry) race conditions on exists check versus update/create.
// Normally I would use a DB lock here, but not sure what
// the Omicron way of doing things here is.

match self
.db_datastore
Expand Down Expand Up @@ -95,6 +97,9 @@ impl super::Nexus {
.await?;
}

// TODO update bootstore goes here
// Need a sled-agent API to update early network config

Ok(result)
}

Expand Down
19 changes: 0 additions & 19 deletions nexus/types/src/external_api/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1406,25 +1406,6 @@ pub struct Route {
pub vid: Option<u16>,
}

/*
/// A BGP configuration.
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)]
pub struct BgpConfig {
/// Name of the BGP config.
pub name: Name,
/// BGP config description.
pub description: String,
/// The autonomous system number of this BGP configuration.
pub asn: u32,
/// Optional virtual routing and forwarding identifier for this BGP
/// configuration. For future use. Currently ignored.
pub vrf: Option<String>,
}
*/

/// Select a BGP config by a name or id.
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
pub struct BgpConfigSelector {
Expand Down
12 changes: 6 additions & 6 deletions package-manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ only_for_targets.image = "standard"
# 2. Copy dendrite.tar.gz from dendrite/out to omicron/out
source.type = "prebuilt"
source.repo = "dendrite"
source.commit = "5e344ff540f8b067596eb63c730215e7360fa913"
source.sha256 = "3115e756ebe11b1a10355d819c1e160f2e0242c4adcbe44bb76a0dd030a67c87"
source.commit = "c0cbc39b55fac54b95468304c497e00f3d3cf686"
source.sha256 = "3706e0e8230b7f76407ec0acea9020b9efc7d6c78b74c304102fd8e62cac6760"
output.type = "zone"
output.intermediate_only = true

Expand All @@ -498,8 +498,8 @@ only_for_targets.image = "standard"
# 2. Copy the output zone image from dendrite/out to omicron/out
source.type = "prebuilt"
source.repo = "dendrite"
source.commit = "5e344ff540f8b067596eb63c730215e7360fa913"
source.sha256 = "62885443d70abecf29aad1aba33046449661fd5dc7ee149e2328164b95e98545"
source.commit = "c0cbc39b55fac54b95468304c497e00f3d3cf686"
source.sha256 = "f0847927f7d7197d9a5c4267a0bd0af609d18fd8d6d9b80755c370872c5297fa"
output.type = "zone"
output.intermediate_only = true

Expand All @@ -516,8 +516,8 @@ only_for_targets.image = "standard"
# 2. Copy dendrite.tar.gz from dendrite/out to omicron/out/dendrite-softnpu.tar.gz
source.type = "prebuilt"
source.repo = "dendrite"
source.commit = "5e344ff540f8b067596eb63c730215e7360fa913"
source.sha256 = "2af60c4760d77ef43f80b633cc73f7c0684aa0f1cab6ff2e26b4a6bd1fcc7b8f"
source.commit = "c0cbc39b55fac54b95468304c497e00f3d3cf686"
source.sha256 = "33b5897db1fe7b57d282531724ecd7bf74f5156f9aa23f10c6f0d9b54c38a987"
output.type = "zone"
output.intermediate_only = true

Expand Down
2 changes: 2 additions & 0 deletions sled-agent/src/rack_setup/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,8 @@ impl ServiceInner {
rack_network_config: config.rack_network_config.clone(),
};
info!(self.log, "Writing Rack Network Configuration to bootstore");
//NOTE(ry) this is where the early network config gets saved.
//NOTE(ry) generation number must be bumped. Nexus owns generation number.
bootstore.update_network_config(early_network_config.into()).await?;

// Forward the sled initialization requests to our sled-agent.
Expand Down
2 changes: 1 addition & 1 deletion tools/dendrite_openapi_version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
COMMIT="5e344ff540f8b067596eb63c730215e7360fa913"
COMMIT="c0cbc39b55fac54b95468304c497e00f3d3cf686"
SHA2="cb3f0cfbe6216d2441d34e0470252e0fb142332e47b33b65c24ef7368a694b6d"
6 changes: 3 additions & 3 deletions tools/dendrite_stub_checksums
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CIDL_SHA256_ILLUMOS="3115e756ebe11b1a10355d819c1e160f2e0242c4adcbe44bb76a0dd030a67c87"
CIDL_SHA256_LINUX_DPD="a999b953bb92cfdab681699661b0510d9702e6cf6d3517bc81a3fea731208bb7"
CIDL_SHA256_LINUX_SWADM="cf1d4e91992133a51223dcb9bb17b07edea40fcd32690a44a8b36b1ba0a4636e"
CIDL_SHA256_ILLUMOS="3706e0e8230b7f76407ec0acea9020b9efc7d6c78b74c304102fd8e62cac6760"
CIDL_SHA256_LINUX_DPD="b275a1c688eae1024b9ce1cbb766a66e37072e84b4a6cbc18746c903739ccf51"
CIDL_SHA256_LINUX_SWADM="7e604cc4b67c1a711a63ece2a8d0e2e7c8ef2b9ac6bb433b3c2e02f5f66018ba"
3 changes: 3 additions & 0 deletions wicket/src/rack_setup/config_template.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# TODO Explanatory block comment

# NOTE(ry) this file needs to be updated with BGP config. Put it in here and
# add a comment that it's optional.

# Delegated external DNS zone name
#
# The rack provides separate external API and console endpoints for each Silo.
Expand Down

0 comments on commit 518247b

Please sign in to comment.