Skip to content

ci: generate outputs for pinning helios on release branches #8092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 9, 2025

Conversation

iliana
Copy link
Contributor

@iliana iliana commented May 5, 2025

This generates some new files that can be used to pin Helios more completely on release branches. We do not pin Helios on the main branch of Omicron by design, but we want to prevent unexpected changes in release branches.

The first file is helios.json, which contains the commit hash for Helios as well as the (currently) eight repositories helios-setup fetches. Since v13 we've started branching the Helios repository as well and pinning the commits of the repos it pulls down. I've been downloading the repos and pulling the recorded commits out of the OS tarballs, but this new CI artefact will make writing a tool to do this more tractable.

The other files are for the release incorporation package. Since v10 we've published a package to the Helios repository named omicron-release-incorporation, which creates an incorporation dependency on the latest version of each package in the repository except for itself and driver/network/opte (this version is controlled by tools/opte_version). From pkg(7) § Constraints and Freezing:

an incorporated package need not be present on the system, but if it is, then it specifies both an inclusive minimum version and an exclusive maximum version. For example, if the dependent FMRI has a version of 1.4.3, then no version less than 1.4.3 would satisfy the dependency, and neither would any version greater than or equal to 1.4.4. However, versions that merely extended the dotted sequence, such as 1.4.3.7, would be allowed.

Previously this was generated via Makefile and scripts found at /staff/rel/* when the branch was to be made. Generation and use of a proposed omicron-release-incorporation at CI time means that a branched release can pin to precisely the same packages that were present in the base commit on the main branch (as well as ensuring that the host OS and recovery/trampoline OS contain packages with the same versions). This depends on oxidecomputer/helios#200, which allows for multiple origins to be set for a publisher.

At branch time, the incorporation.p5p can be pkgrecv'd into the Helios repository, and tools/pins.toml will reflect that version; when this is set the releng tool will stop generating the incorporation and use the one present in the repository. If any package updates are required on the release branch, incorporation.p5m can be used as a starting point.

@iliana iliana requested review from sunshowers and jclulow May 8, 2025 23:58
Copy link
Contributor

@sunshowers sunshowers left a comment

Choose a reason for hiding this comment

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

The bits I know about make sense to me, will let @jclulow accept after looking at the incorporation code.

"origin",
"master",
])
.args(["fetch", "--no-write-fetch-head", "origin", "HEAD"])
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this change do?

Copy link
Contributor Author

@iliana iliana May 9, 2025

Choose a reason for hiding this comment

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

The remote's HEAD always refers to the default branch, if we ever end up renaming the branch. This is just a bit of unrelated futureproofing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel like it fetches whatever HEAD points to on the origin remote, without updating the local FETCH_HEAD ref? I think HEAD, at least on GitHub, points at the tip of the default branch in the repository?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah gotcha -- could you add a comment?

jobs.push("helios-record", async move {
let projects_dir = helios_dir.join("projects");
let mut projects = BTreeMap::new();
let mut read_dir = fs::read_dir(&projects_dir).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could use projects_dir.read_dir_utf8 here -- it isn't async but ehh, I don't think it matters.

Copy link
Collaborator

@jclulow jclulow left a comment

Choose a reason for hiding this comment

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

I left a comment, but I don't have strong feelings. Thanks for doing all this!

"origin",
"master",
])
.args(["fetch", "--no-write-fetch-head", "origin", "HEAD"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel like it fetches whatever HEAD points to on the origin remote, without updating the local FETCH_HEAD ref? I think HEAD, at least on GitHub, points at the tip of the default branch in the repository?

@@ -477,6 +513,19 @@ async fn main() -> Result<()> {
}};
}

let incorp_version = version.major;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wondering if we should make this MAJOR.0.0.0 just for symmetry with the rolls we've been doing for respins?

Comment on lines +12 to +13
#: "=/work/incorporation.p5m",
#: "=/work/incorporation.p5p",
Copy link
Contributor Author

@iliana iliana May 9, 2025

Choose a reason for hiding this comment

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

@jclulow this won't throw an error if these files aren't present on release branches, right? Or do I need a different sigil here to make these "optional"?

edit: = means mandatory, so I should correct this either by removing the = or writing out a file anyway if we're pinned to one in the repo.

@iliana
Copy link
Contributor Author

iliana commented May 9, 2025

In addition to some changes suggested in review I've added an --extra-origin option, which adds another -p helios-dev= to the helios-build command. I added this after writing up the branching process docs and realized there needed to be a good way to test that backported changes to an incorporation work correctly.

I still need to write up the code to pass through the incorporation from the repo so that Buildomat doesn't fail on release branches, and then I will automerge.

@iliana iliana enabled auto-merge (squash) May 9, 2025 22:42
@iliana iliana merged commit c5329d7 into main May 9, 2025
17 checks passed
@iliana iliana deleted the iliana/pinning branch May 9, 2025 23:39
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