Skip to content

[4/n] split RSS into its own crate#10340

Merged
sunshowers merged 13 commits into
mainfrom
sunshowers/spr/4n-wip-split-rss-into-its-own-crate
Apr 30, 2026
Merged

[4/n] split RSS into its own crate#10340
sunshowers merged 13 commits into
mainfrom
sunshowers/spr/4n-wip-split-rss-into-its-own-crate

Conversation

@sunshowers
Copy link
Copy Markdown
Contributor

@sunshowers sunshowers commented Apr 29, 2026

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.

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
Created using spr 1.3.6-beta.1
Comment on lines 381 to 383
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" },
]
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.

Realized while doing this that both RSS and the simulated Sled Agent use this API, so updated this message.

Comment thread sled-agent/rack-setup/src/service.rs Outdated
Comment on lines +143 to +147
/// 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 {
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 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
@sunshowers sunshowers changed the base branch from sunshowers/spr/main.4n-wip-split-rss-into-its-own-crate to main April 30, 2026 04:11
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Comment on lines -464 to -468
/// 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,
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.

We get to drop what we just introduced in #10099 lol


#[derive(Clone, Debug)]
pub struct Plan {
pub struct ServicePlan {
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.

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;
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.

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?

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.

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.

Comment on lines 91 to +94
let rss = RackSetupService::new_reset_rack(
log.new(o!("component" => "RSS")),
tx,
Box::new(tx),
our_bootstrap_address,
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.

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;
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 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 {
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.

Same here: turned this into SledPlan for similar reasons.

@sunshowers sunshowers changed the title [4/n] [wip] split RSS into its own crate [4/n] split RSS into its own crate Apr 30, 2026
@sunshowers sunshowers marked this pull request as ready for review April 30, 2026 05:21
Copy link
Copy Markdown
Contributor

@jgallagher jgallagher left a comment

Choose a reason for hiding this comment

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

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;
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.

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.

Comment thread sled-agent/types/src/sled.rs Outdated
Comment thread sled-agent/rack-setup/src/service.rs Outdated
Created using spr 1.3.6-beta.1
@sunshowers sunshowers enabled auto-merge (squash) April 30, 2026 19:07
@sunshowers sunshowers merged commit f960aad into main Apr 30, 2026
18 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/4n-wip-split-rss-into-its-own-crate branch April 30, 2026 19:51
jgallagher added a commit that referenced this pull request May 13, 2026
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.
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.

Split RSS into its own crate separate from omicron-sled-agent

2 participants