-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
WIP: add --coreos-url to oc adm release new
#21998
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: cgwalters If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
As an alternative point - can we include the AMI info as content in the machine-os-content container when we build it? If we put that data in /manifests and that's a build side thing, we don't need to change it here. I.e. have machine-os-content build lay down:
? That's slightly increase in complexity in build time of os container. Or alternatively, embedded as label metadata. I really don't like the external calls here and in the installer in general because it means we have two types of content, not one. As a clarifying question, when would we change metadata.json but not the content we are shipping? |
The current RHCOS build system has some really funky dependencies between building the oscontainer and the bootimage. Because: the bootimage needs to know the oscontainer it came from - if you boot and run e.g.:
That's how the MCD knows whether or not it needs to update. Another further wrinkle here is that we want to actually test the OS before we upload an oscontainer - which requires a bootimage (VM image). So the build system today goes:
Now...I am not sure offhand how we could easily inject the AMIs into our oscontainer. It might be easiest to have this be a separate container? |
Yep agreed - really the goal of this PR is to enable the magic to move from the installer to the release payload. If this lands and the installer implemented openshift/installer#987 then it could drop the code talking to the API - the source of truth for "what the installer will install" becomes just the release payload. But bigger picture I don't think we're going to get away from the two fundamental types of content (bootimages/VM images, containers). A lot of work was put into the RHCOS build system to have a unified build scheme that encapsulates both - which is required if we want to have the "don't pivot on initial install" model. In the end certainly from the user point of view we're streamlining this - they shouldn't have to care about how it's implemented. The coreos-assembler build scheme/metadata is fairly hidden here and we could definitely change how it works later. Well...and we almost certainly will change it. It does seem likely at this point that we'll end up encapsulating a bootimage inside a container too. That isn't designed today though.
I assume here |
It's not ideal, but if breaking the oscontainer <-> bootimage coupling makes things much easier, we could pretty easily teach pivot/MCD to also consider the OSTree checksum rather than just the pullspec. Then we can add whatever metadata we want to the oscontainer about the built images. |
Yeah...or another idea here is to derive a layer from the oscontainer with the build metadata. Both would end up in the release payload but the "buildmeta" layer would be tiny. EDIT: But the thing is, doing that will require nontrivial changes in the installer and I don't want to block on that. At least, not unless the installer folks think it will be easy to switch to extracting the AMI data from the release payload. |
Actually, a possible scenario for this is "add EC2 region to existing release". But...we can probably ignore that for now. Anyways we have a few choices. We could skip trying to get the bootimage data into the release payload (i.e. installer code stays unchanged), and simply add a cron job that pulls the latest rhcos oscontainer and pushes it into the When the installer folks go to do a release they'd need to manually backreference from the However, this would mean that in CI both would continue to float independently - leading to a situation where sometimes in CI one would boot a slightly older release and we'd upgrade during a run. The reason I was going for this model is it makes crystal clear that the source of truth is the release payload (which just happens to gather bootimage data using an external API at the moment at build time). |
3059a34
to
166036e
Compare
OK fixed various bugs; main thing is we now piggy back on
And notably |
For RHCOS we have two things: - The "bootimage" (AMI, qcow2, PXE env) - The "oscontainer", now represented as `machine-os-content` in the payload For initial OpenShift releases (e.g. of the installer) ideally these are the same (i.e. we don't upgrade OS on boot). This PR aims to support injecting both data into the release payload. More information on the "bootimage" and its consumption by the installer as well as the Machine API Operator: openshift/installer#987 More information on `machine-os-content`: openshift/machine-config-operator#183
166036e
to
38fc2fe
Compare
Let me summarize. This PR is attempting to move the "RHCOS API consumption" from the installer to the release payload. It also helps ensure that the bootimage is the same as the oscontainer in the release payload which is something we want to support long term. I am not aware of a different approach to solve that. If we want to wait on this we could just do manual updates of |
return builds.Builds[0], nil | ||
} | ||
|
||
// GetLatest returns the CoreOS build with target version. If version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetCoreOSBuild
Name string `json:"name"` | ||
} `json:"amis"` | ||
BuildID string `json:"buildid"` | ||
Images struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just drop this and include only the keys we need for now. Not that we're planning to break the schema, though there's no point in deserializing it if we're not using it.
Speaking of, I think we discussed adding schema versioning to the JSON output. Probably would be good to do this before teaching the origin about it?
fmt.Fprintf(o.Out, "Using CoreOS build %s\n", coreosBuild.BuildID) | ||
digestedImage := fmt.Sprintf("%s@%s", coreosBuild.OSContainer.Image, coreosBuild.OSContainer.Digest) | ||
if digestedImage == "@" { | ||
return fmt.Errorf("No oscontainer in CoreOS build") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not do an explicit e.g. if coreosBuild.OSContainer.Image == "" || coreosBuild.OSContainer.Digest == "" { ... }
? (This also catches the case where just one of the two is somehow missing.)
return err | ||
} | ||
// This is written as a label in the final image | ||
is.Annotations[coreOSBootImageLabel] = string(serializedBuild) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh OK, I see now why you wanted to also deserialize the qcow2s. Though... isn't there a way to have this data be a proper configmap instead of JSON-in-a-label? We were discussing this in openshift/machine-config-operator#183 right? (And including the pkglist, etc...).
Anyway, totally fine doing it this way for now too!
Clayton and I had a quick call on this. We agreed to for now just push a |
/retest |
Looks like the new switches must be added to completions for |
/hold We are deferring this for now. |
@cgwalters: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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 kubernetes/test-infra repository. I understand the commands that are listed here. |
@cgwalters: PR needs rebase. 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 kubernetes/test-infra repository. |
what if we use machine-os-content as easy way for MC* to deal with ostree image. so the RHCOS build pipeline pushed 2 images and the release image creation process remains fairly same. keeping the |
Yep, I think that should be fairly straightforward. An interesting wrinkle here though is that I think while we want to support drift, we'd also like the ability to "atomically" tag both of them together into the release payload. But eh, we can just deal with that in the release controller? |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
@openshift-bot: Closed this PR. In 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 kubernetes/test-infra repository. |
Been thinking about this again since bootimage updates would greatly help MCO kernel args. We really have total flexibility in how we implement this. So here's a totally different proposal: (And from there, either the MCO could update the machinesets, or the cluster API could read it directly, whichever) Opinions? |
Or perhaps to start, we don't poll the RHCOS build endpoint, we just inject the installer-pinned bootimage. Yeah...that way we avoid having to think about two separate bootimage versions per version. |
For RHCOS we have two things:
machine-os-content
in the payloadFor initial OpenShift releases (e.g. of the installer) ideally
these are the same (i.e. we don't upgrade OS on boot).
This PR aims to support injecting both data into the release payload.
More information on the "bootimage" and its consumption by the
installer as well as the Machine API Operator:
openshift/installer#987
More information on
machine-os-content
:openshift/machine-config-operator#183