MCO-2133: Select bootimages based on OSImageStream#10321
MCO-2133: Select bootimages based on OSImageStream#10321openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
Conversation
|
@pablintino: This pull request references MCO-2133 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Skipping CI for Draft Pull Request. |
8f70a1a to
15030dd
Compare
| type CoreOSBuildFetcher func(ctx context.Context) (*stream.Stream, error) | ||
|
|
||
| func DefaultCoreOSStreamGetter(ctx context.Context) (*stream.Stream, error) { | ||
| return rhcos.FetchCoreOSBuild(ctx, rhcos.DefaultOSImageStream) |
There was a problem hiding this comment.
Not sure if I'm missing something, but my expectations for this asset weres to modify setStreamGetter method to take into account the OSImageStream (by reading it from the agent.OptionalInstallConfig{}, already listed as a dependency). Otherwise the live ISO will remain pinned to rhcos9.
There was a problem hiding this comment.
I haven't covered the agent cause I saw that I'd need to cover the case where the install-config is not provided but the AgentConfig is given, that means I need to add a field to it and so on. To avoid making the change bigger and bigger I thought about leaving the agent side consistent and ready for a follow up.
Anyways, if you think that for now supporting the intall-config.yaml only is enought, cool, I can incorporate this simple change to this PR and do the rest as a follow up.
There was a problem hiding this comment.
I see that as an incremental step. The first step usually is to support a new install-config field in the connected environment (ABI may be used also for that). With a simple change that part could be covered - otherwise with the current code a user may be confused by the fact that a config field was specified but "ignored".
The alternative (still valid) would be to put an explicit validation rule in agent.OptionalInstallConfig{} to fail if a value different from the default is specified as "unsupported". At least there will not be any confusing behavior for the end user
There was a problem hiding this comment.
@pablintino please disregard my previous comment. I understood (also from @djoshy comment) that for the 4.22 scope the current approach is correct (just default to rhcos.DefaultOSImageStream)
8cac45c to
1812d64
Compare
There was a problem hiding this comment.
Simplest ever approach, should this be ok for now? I'm not too familiar with the concept of marketplace, so not really sure.
There was a problem hiding this comment.
Reviewers: Please take a look at this change. It's the safest approach I could come up with. Basically, the structure of the ConfigMap is preserved and the stream field will continue to be reported, but from now on, it will use the default stream. A new streams field with a JSON map<streamName, streamJson> is now present. The format for SCOS remains unchanged, and the marketplace file is merged only if the file exists, which is only true for rhcos-9 for now.
cc:@djoshy
|
At a high-level this looks good, but I'm trying to find as much time as I can to go through the details. One thing that's missing is that the installer has a command to output the rhcos stream, https://github.com/openshift/installer/blob/main/pkg/coreoscli/cmd.go#L23 The underlying code is here: Line 27 in 435db5e I will continue to review this. |
I saw it, and I tried to address it alongside the agent references cause I thought it was used by the agent installer, but the amound of changes grew to the point the PR was bigger than I would like, so I decided to limit this PR to the bare minimum and acknoledge we need to continue working on this to cover the agent and that command. |
|
@patrickdillon I've thought twice about the command and true that may feel weird to keep it unaware of the streams. I've pushed an update to address it. What's missing? Basically everything related to the agent. |
|
/retest |
|
/test e2e-aws-ovn-rhcos10-devpreview I might have chosen a bad name for the presubmit, should probably be rhel10... |
|
/approve Approach looks good to me. I'm doing some final reviewing before tagging. Machine AMIs are being set correctly. Not sure why the previous run of /test e2e-aws-ovn-rhcos10-devpreview failed. The SSH gathering has been broken but we have a workaround in place now, so perhaps another run will provide more information. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: patrickdillon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
There are some linter errors that need to be addressed: Sorry about hat last one, as that is existing code. Doesn't look too painful though... |
|
Before we merge this - do we want to add any labels/annotations on the rhel10 machinesets/machines that the MCO's boot image controller can then use for exclusion? In 4.22, boot image updates are enabled by default in gcp, aws, azure and vsphere and I think they would get automatically updated to the rhel9 stream(perhaps not for AWS, since the RHEL10 images won't be in the whitelist) Update: I opened openshift/machine-config-operator#5752 to a stab at the boot image side of this, reviews welcome! For now, I've kept old behavior of using |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughParameterizes OS image stream selection across the codebase, adds an RHCOS RHEL‑10 manifest, and implements discovery plus marketplace-overlay merging of multiple boot image streams for ConfigMap population and per‑stream image/region lookups. Changes
Sequence Diagram(s)sequenceDiagram
participant Builder as "hack/build-coreos-manifest"
participant FS as "data/data/coreos/*"
participant Marketplace as "data/data/coreos/marketplace/*"
participant ConfigMap as "generated ConfigMap"
Builder->>FS: discover coreos-<stream>.json files
Builder->>Marketplace: locate marketplace overlay for each stream
Builder->>FS: read stream bytes for each discovered stream
Builder->>Marketplace: read overlay bytes (if present)
Builder->>Builder: merge marketplace overlay into stream bytes
Builder->>ConfigMap: embed default "stream" bytes and aggregated "streams" JSON
ConfigMap-->>Builder: persisted ConfigMap
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
| type CoreOSBuildFetcher func(ctx context.Context) (*stream.Stream, error) | ||
|
|
||
| func defaultCoreOSStreamGetter(ctx context.Context) (*stream.Stream, error) { | ||
| return rhcos.FetchCoreOSBuild(ctx, rhcos.DefaultOSImageStream) |
There was a problem hiding this comment.
@pablintino I think this was also added to pkg/asset/agent/image/baseiso.go but for some reason I'm not able to find that change anymore
There was a problem hiding this comment.
Ok, clarified by @pablintino that's not required anymore, since the ABI workflow will anyhow receive the defaultCoreOSStreamGetter (currently hard-coded to rhel-9)
There was a problem hiding this comment.
Yeah, that part is not yet covered. It's part of the work we need to plan.
There was a problem hiding this comment.
pkg/asset/agent/image/baseiso.go moved to pkg/asset/rhcos/iso.go because it is now shared with the baremetal bootstrap.
This change ensures the node-image-pull service pulls the proper OS image based on the configured (or the default) OS Image Stream used for installation. The approach temporarily hard-codes a map of OS Image Streams to ImageStream tags. Signed-off-by: Pablo Rodriguez Nava <git@amail.pablintino.eu>
|
@pablintino: This pull request references MCO-2133 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/retest-required |
|
/retest |
|
/unhold |
|
/test e2e-aws-ovn-rhel10-devpreview |
|
/lgtm |
|
/verified by @pablintino |
|
@pablintino: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
Do we need to add a data/data/coreos/marketplace/coreos-rhel-10.json here for Azure marketplace metadata file of RHEL-10?
For now, Azure deployments with osImageStream: rhel-10 would fail to populate marketplace image information in CPMS and worker MachineSets, the image field in CPMS and MachineSet generated like:
image:
offer: ""
publisher: ""
resourceID: /resourceGroups/gpei-0319azure-g7gbb-rg/providers/Microsoft.Compute/galleries/gallery_gpei_0319azure_g7gbb/images/gpei-0319azure-g7gbb-gen2
sku: ""
version: ""
There was a problem hiding this comment.
I think this is a question that @dustymabe or @ravanelli may answer better than me.
There was a problem hiding this comment.
I think actually more a question for me: the installer team owns the marketplace image stream, which we handle in collaboration with ARO.
We will need ARO to get RHEL10 marketplace images, at which point we can incorporate them into the stream.
There was a problem hiding this comment.
@patrickdillon Thanks, so do you think we need to file a bug or create a JIRA story for this issue to make sure we don't forget about it? It looks like a blocker for a complete RHEL 10 testing on Azure.
|
BTW @pablintino Based on the e2e-aws-ovn-rhel10-devpreview job results, all nodes in the cluster are using RHEL-9 OS content in the end, the MCD log also indicates that the machines boot from RHEL-10 AMI but are then replaced with RHEL-9 OS content. So will there be follow-up PRs to enable a complete RHEL-10 cluster installation when we set |
|
/retest-required |
Yes, we still need openshift/machine-config-operator#5714 and #10357. The MCO PR should land first, but we are having a hard-time getting it merged because of CI. Without those 2 PRs expect the machines to boot with whatever stream the user selected but with a pivot to rhel 9 at each node startup. |
|
/test e2e-aws-ovn |
|
/retest-required |
|
@pablintino: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/retest-required |
bb827bf
into
openshift:main
Consume the osImageStream install-config field through all code paths that consume embedded bootimage metadata, allowing the installer to load per-stream files (rhel-9.json, rhel-10.json) instead of a single rhcos.json. Defaults to RHEL 9 when the field is not set.