[4/n] split RSS into its own crate#10340
Conversation
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
| restricted_to_consumers = [ | ||
| { name = "omicron-sled-agent", reason = "Only RSS uses this API and it is not part of upgrade" }, | ||
| { name = "omicron-sled-agent", reason = "Only RSS and sled-agent-sim use this API, neither of which is part of upgrade" }, | ||
| ] |
There was a problem hiding this comment.
Realized while doing this that both RSS and the simulated Sled Agent use this API, so updated this message.
| /// Operations RSS performs on the local bootstrap-agent during rack setup. | ||
| /// | ||
| /// This trait is implemented by sled-agent. | ||
| #[async_trait] | ||
| pub trait LocalBootstrapAgent: Send + Sync { |
There was a problem hiding this comment.
This is the callback interface.
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
| /// This dependency is only used during RSS, not during normal operation or | ||
| /// upgrade. Like `NonDag`, this means the dependency should not be part of | ||
| /// the update DAG. Unlike `NonDag`, this does not require that the target | ||
| /// API uses client-side versioning. | ||
| RssOnly, |
There was a problem hiding this comment.
We get to drop what we just introduced in #10099 lol
|
|
||
| #[derive(Clone, Debug)] | ||
| pub struct Plan { | ||
| pub struct ServicePlan { |
There was a problem hiding this comment.
There were a few spots where we were doing Plan as ServicePlan which is a bit awkward, so I took the opportunity to change this to just be ServicePlan.
| BfdMode, BgpConfig, BgpPeerConfig, ImportExportPolicy, PortConfig, PortFec, | ||
| PortSpeed, RouterPeerType, SwitchSlot, UplinkAddress, | ||
| }; | ||
| use sled_agent_types::sled::ThisSledSwitchZoneUnderlayIpAddr; |
There was a problem hiding this comment.
I chose to put early networking in the new sled-agent-rack-setup crate. But another option is to put it in a new sled-agent-early-networking crate. What do y'all think?
There was a problem hiding this comment.
All of this is going away over the next couple of releases as a part of #10167 as the functionality moves into sled-agent-scrimlet-reconcilers. I'm on board with just moving it here for simplicity.
| let rss = RackSetupService::new_reset_rack( | ||
| log.new(o!("component" => "RSS")), | ||
| tx, | ||
| Box::new(tx), | ||
| our_bootstrap_address, |
There was a problem hiding this comment.
I felt that moving the bootstrap address to the LocalBootstrapAgent trait (which is more of a one-shot interface) was a little weird, so I turned it into an argument over here. I can revert this change if you prefer.
|
|
||
| pub const SWITCH_ZONE_BASEBOARD_FILE: &str = "/opt/oxide/baseboard.json"; | ||
|
|
||
| pub use self::local_switch_zone_ip::ThisSledSwitchZoneUnderlayIpAddr; |
There was a problem hiding this comment.
This moves into sled-agent-types. (I believe this will conflict with one of John's PRs, but I also think the resolution of the conflict is to move it here anyway.
| } | ||
|
|
||
| impl Plan { | ||
| impl SledPlan { |
There was a problem hiding this comment.
Same here: turned this into SledPlan for similar reasons.
jgallagher
left a comment
There was a problem hiding this comment.
Thanks, this is way simpler than I would have expected 😅
| BfdMode, BgpConfig, BgpPeerConfig, ImportExportPolicy, PortConfig, PortFec, | ||
| PortSpeed, RouterPeerType, SwitchSlot, UplinkAddress, | ||
| }; | ||
| use sled_agent_types::sled::ThisSledSwitchZoneUnderlayIpAddr; |
There was a problem hiding this comment.
All of this is going away over the next couple of releases as a part of #10167 as the functionality moves into sled-agent-scrimlet-reconcilers. I'm on board with just moving it here for simplicity.
Created using spr 1.3.6-beta.1
This is groundwork for #10167, and introduces the skeleton of network config reconcilers for use within sled-agent. None of this is wired up yet and all the service-specific reconcilers are placeholders, but it does have the real setup for how these tasks get started and how they report status. The PR is pretty big but hopefully not too bad to review; more than half the code falls into either "tests", "status type definitions", or "placeholder/dummy reconcilers". A tentative suggestion for review order is: 1. The crate-level docs in `lib.rs`; these are written assuming #10167 is complete, not based on the current state of the crate. 2. `handle.rs`, particularly `ScrimletReconcilers` - this is the entry point for sled-agent. It will hold a `ScrimletReconcilers` in its set of long-running tasks. 3. `reconciler_task.rs` - this implements the common control flow for all of the service-specific reconcilers in the crate; handling periodic reactivation, activation when the config changes, transitioning to inert if we stop being a scrimlet because the sidecar goes away at runtime, and transitioning out of inert if it comes back. ~~The only production-affecting change here is that the `ThisSledSwitchZoneUnderlayIpAddr` type moved out of sled-agent and into this crate, so sled-agent depends on this crate just for that type.~~ Edit: As of #10340, `ThisSledSwitchZoneUnderlayIpAddr` has moved to `sled-agent-types`, so now this PR uses it from there and makes no changes to sled-agent proper.
With this change, the RSS code now lives in a separate crate from Sled Agent so that it is harder for cockroach-admin-client and dns-service-client (and any future RSS-only deps) to become dependencies of the real Sled Agent.
Also update api-manifest.toml.
Closes #10339.