Skip to content

Conversation

sunshowers
Copy link
Contributor

@sunshowers sunshowers commented Jul 31, 2025

Prepare for future work where we're going to transmit other kinds of artifacts over the wire to installinator -- not just host phase 2 and control plane.

For compatibility, installinator supports repos both with and without this document. In the future we can clean this up.

TODO:

  • Give this a spin on a racklette.

Depends on:

Created using spr 1.3.6-beta.1
@sunshowers sunshowers requested review from labbott and iliana July 31, 2025 03:07
Created using spr 1.3.6-beta.1
Comment on lines +121 to +132
impl ArtifactsToDownload {
pub(crate) fn host_phase_2_id(&self) -> ArtifactHashId {
ArtifactHashId {
kind: ArtifactKind::HOST_PHASE_2,
hash: self.host_phase_2,
}
}

Ok(InstallinatorImageId { update_id, host_phase_2, control_plane })
pub(crate) fn control_plane_id(&self) -> ArtifactHashId {
ArtifactHashId {
kind: KnownArtifactKind::ControlPlane.into(),
hash: self.control_plane,
Copy link
Contributor

Choose a reason for hiding this comment

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

The use of ArtifactKind vs KnownArtifactKind looks weirdly asymmetric

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it definitely is, though this just moves existing code.

Comment on lines +297 to +303
if !missing.is_empty() {
bail!(
"installinator document missing \
required artifacts: {:?}",
missing
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any advantage to trying to return an error over bail!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, not quite sure what you mean here -- bail! does return an error.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wasn't sure if there was a nicer way to handle the error than system exit but I've done a little more looking at installinator now and just exiting makes sense to me.

Copy link
Contributor Author

@sunshowers sunshowers Jul 31, 2025

Choose a reason for hiding this comment

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

Ah this is within the context of a single update-engine step, so it's not an immediate system exit -- installinator will report this up to wicketd before exiting.

@iliana
Copy link
Contributor

iliana commented Jul 31, 2025

I have not yet read through the changes but I want to make sure that the installinator doc is still being treated as an artifact by Nexus (even if it doesn't have any specific instructions for what to do with it) and is being replicated into the repo depot. I don't remember where we landed on the sled recovery workflow but if it's Nexus-driven it will need to have the artifact around.

Created using spr 1.3.6-beta.1
@sunshowers
Copy link
Contributor Author

Testing notes

Tested on berlin.

Did an update from main (which doesn't know about installinator documents) to this PR (note that installinator didn't fetch the document):

image

Then did an update to the other scrimlet, which does download the installinator document:

image

@sunshowers
Copy link
Contributor Author

Also uploaded the repo to Nexus and verified that the update dataset has the corresponding hash.

All right, this is ready to review now.

Copy link
Contributor

@labbott labbott left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for doing this!

@@ -503,7 +509,7 @@ mod tests {
.await?;

// `by_id` should contain one entry for every `KnownArtifactKind`
// (except `ControlPlane`).
// (except `Zone`), as well as `installinator_document`.
Copy link
Contributor

Choose a reason for hiding this comment

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

this changed from ControlPlane to Zone, guessing outdated comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, thanks!

Created using spr 1.3.6-beta.1
@sunshowers sunshowers enabled auto-merge (squash) August 1, 2025 20:22
@sunshowers sunshowers merged commit 19b92d1 into main Aug 1, 2025
19 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/installinator-add-support-for-fetching-an-installinator-document branch August 1, 2025 22:22
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.

3 participants