Skip to content

Conversation

@adamlouis
Copy link

In manufacturing contexts, we'd like to like to read Ignition port state to address https://github.com/oxidecomputer/facade/issues/298.

We'd like to do this over the management network with faux-mgs.

For the minibar to to respond to faux-mgs messages, it needs the the control-place-agent task.

This PR is an attempt at the bare minimum needed to add control-plane-agent to minibar. This is primarily copy+paste / compiler error message driven. cc @Aaron-Hartwig for comments on if there's something more / different for what we want here.

I've tested this PR on the argon manufacturing station in Emeryville - a minibar-lite with a rev B board.

This change is required for the ignition test in the additional facade tests: https://github.com/oxidecomputer/facade/pull/339

@hawkw
Copy link
Member

hawkw commented Jan 22, 2026

Your CI build is unhappy because rustfmt needs to be run (sorry!)

Comment on lines 107 to 125
) -> Result<(), RequestError<ControlPlaneAgentError>> {
Err(ControlPlaneAgentError::DataUnavailable.into())
}

pub(crate) fn get_host_phase2_data(
&mut self,
_image_hash: [u8; 32],
_offset: u64,
_data: Leased<idol_runtime::W, [u8]>,
) -> Result<usize, RequestError<ControlPlaneAgentError>> {
Err(ControlPlaneAgentError::DataUnavailable.into())
}

pub(crate) fn startup_options_impl(
&self,
) -> Result<HostStartupOptions, RequestError<ControlPlaneAgentError>> {
// We don't have a host to give startup options; no one should be
// calling this method.
Err(ControlPlaneAgentError::InvalidStartupOptions.into())
Copy link
Member

Choose a reason for hiding this comment

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

perhaps these errors all ought to be ControlPlaneAgentError::OperationUnsupported? I think that more accurately communicates "I am not a board that knows how to do that"

Copy link
Member

Choose a reason for hiding this comment

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

...oh, i guess this is what the PSC and Sidecar implementations return for these methods. That feels a little weird to me, but I guess it's better to do what we do elsewhere, maybe? It could be worth checking if that error variant even existed when it was decided that PSC/Sidecar should return these...

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't spend much time in this code, but I agree that OperationUnsupported feels like a much better error here (and probably those other places too!). This would also apply to set_startup_options_impl below.

Copy link
Member

Choose a reason for hiding this comment

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

I'm a little inclined to leave this the way it is on PSC and Sidecar in this PR, and then change all of them separately.

Comment on lines 107 to 125
) -> Result<(), RequestError<ControlPlaneAgentError>> {
Err(ControlPlaneAgentError::DataUnavailable.into())
}

pub(crate) fn get_host_phase2_data(
&mut self,
_image_hash: [u8; 32],
_offset: u64,
_data: Leased<idol_runtime::W, [u8]>,
) -> Result<usize, RequestError<ControlPlaneAgentError>> {
Err(ControlPlaneAgentError::DataUnavailable.into())
}

pub(crate) fn startup_options_impl(
&self,
) -> Result<HostStartupOptions, RequestError<ControlPlaneAgentError>> {
// We don't have a host to give startup options; no one should be
// calling this method.
Err(ControlPlaneAgentError::InvalidStartupOptions.into())
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't spend much time in this code, but I agree that OperationUnsupported feels like a much better error here (and probably those other places too!). This would also apply to set_startup_options_impl below.

@@ -0,0 +1,207 @@
// This Source Code Form is subject to the terms of the Mozilla Public
Copy link
Collaborator

Choose a reason for hiding this comment

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

This entire file seems like a lot of copy/paste from task/control-plane-agent/src/mgs_sidecar/ignition.rs can we see if there's anything we can keep in common?

Copy link
Member

Choose a reason for hiding this comment

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

aa83c69 factors this out so that the majority of the ignition controller code is defined once and shared by Sidecar and Minibar.

I note that minibar lacks code for actually sending ignition commands, which is present on sidecar. Perhaps we ought to put that in both systems as well? It seems like it could be useful to be able to actually send ignition commands to the attached sled...

Copy link
Member

Choose a reason for hiding this comment

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

okay, I just went ahead and enabled all Ignition functionality on both Minibar and Sidecar, because why not? 73df690

@labbott
Copy link
Collaborator

labbott commented Jan 23, 2026

LGTM but I think we should give this a quick test on a Real Sidecar too to make sure none of the refactoring broke anything (unlikely! but you never know!)

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.

5 participants