Skip to content

[wicket] Allow CLI-style RSS configuration#3326

Merged
jgallagher merged 13 commits into
mainfrom
wicketd-rss-config
Jun 16, 2023
Merged

[wicket] Allow CLI-style RSS configuration#3326
jgallagher merged 13 commits into
mainfrom
wicketd-rss-config

Conversation

@jgallagher

Copy link
Copy Markdown
Contributor

This is the first of 4 (ish?) PRs building toward configuring and running RSS via wicket. It adds a handful of endpoints to wicketd for various RSS configuration settings, and a preliminary CLI interface with which a user can supply those settings.

This isn't 100% correct or complete and will be tweaked in some of the followup PRs, but the majority of it is close enough to right that I think it's ready for review on its own.

@sunshowers sunshowers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good overall, the basic logic seems sound.

Comment thread wicket/src/dispatch.rs Outdated
Comment thread wicket/src/rack_setup.rs Outdated
Comment thread wicket/src/rack_setup.rs Outdated
Comment thread wicket/src/rack_setup.rs Outdated
Comment thread wicket/src/rack_setup.rs Outdated
for sled in sleds {
// We should never get a non-sled from wicketd; if we do, filter it out.
if sled.id.type_ != SpType::Sled {
continue;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth warning on this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning as in printing something to the wicket user, or warn!ing to the wicket log that's only available to support personnel?

Comment on lines +121 to +122
// We have to attach the comment for each sled on the _next_ item in the
// array, so here we set our prefix to be the previous item's details.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof yeah

}

let Some(config) = config else {
return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is this going to happen?

If config is None then we're going to just have those default values in the template returned. That doesn't seem right.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will happen if someone asks for the config before wicket has been able to get the current config from wicketd, which is unlikely (but not impossible) in practice. Returning the default values in the template was intentional, but assumed we fixed the default values to be reasonable (possibly just empty strings with comments explaining them).

#[cfg(test)]
mod tests {
use super::*;
use omicron_common::api::internal::shared::RackNetworkConfig as InternalRackNetworkConfig;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this and PortSpeed/InternalPortSpeed share a type via progenitor's replace? Seems like a lot of extra ceremony converting between the types that isn't always necessary.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe! I'm still uneasy about when replace is dangerous or not, so didn't reach for it here...

Comment thread wicket/src/rack_setup.rs Outdated
@jgallagher jgallagher force-pushed the wicketd-rss-config branch from 7582ccc to b2fee2f Compare June 15, 2023 16:15

@sunshowers sunshowers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jgallagher jgallagher merged commit 10baa3a into main Jun 16, 2023
@jgallagher jgallagher deleted the wicketd-rss-config branch June 16, 2023 17:47
jgallagher added a commit that referenced this pull request Jun 20, 2023
RSS wants to know the bootstrap addresses of the sleds to include; this
PR teaches wicketd how to find them. It also updates the wicket TOML
config introduced in #3326 to include the sled's bootstrap address (if
known) in a comment in the sled list; I'm unsure if this is something
we'll want to keep once customers are running RSS, but it seems handy
for debugging for now.

Builds on #3326.
jgallagher added a commit that referenced this pull request Jun 22, 2023
The bulk of code in this PR is the new `rack_setup` wicket pane, which
includes a bunch of popup-related things (which are all fairly verbose
for now; I followed what the update pane does structurally, and am very
thankful it exists!). On a fresh (uninitialized and unconfigured)
system, the pane should look roughly like this, although hopefully not
with `UNKNOWN` bootstrap addresses (those are because these screenshots
are from a simulated dev environment that doesn't have a bootstrap
network):


![pr0](https://github.com/oxidecomputer/omicron/assets/1435635/6ce9d4b0-4290-48d8-8794-63552902e184)

If we attempt to start an update, we'll get a confirm popup; pressing
"Yes" will fail with the error from wicketd (in this case, "you need to
configure things!"):


![pr1](https://github.com/oxidecomputer/omicron/assets/1435635/46152156-3313-4eec-b0d8-221e43f4cf81)

After filling in all the configuration options via the CLI added in
#3326, we see the options reflected in the UI:


![pr2](https://github.com/oxidecomputer/omicron/assets/1435635/2296874f-f219-445d-9178-d0cf27d143fb)

at which point starting RSS should succeed, and the `Current rack
status: ` line will change to `Initializing`. This will eventually
progress to a new state once RSS completes (whether successful or not).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants