-
Notifications
You must be signed in to change notification settings - Fork 174
create-legacy-oscontainer: use runvm to build legacy oscontainer #3111
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
Conversation
Skipping CI for Draft Pull Request. |
Trying to get this running locally first, right now hitting python module issues:
maybe it's time to just farm out the buildah/podman call to the vm. |
Short term I'm OK with just taking the hit of dragging python into supermin. (Hmm...i wonder if we could actually just mount the host container's |
I see, I'll try that next I was trying to modify oscontainer.py instead of calling buildah, to call something like
But keep getting
|
8dc6683
to
0d8ab26
Compare
I think I am hitting some kind of argument limit when doing this via string because I get:
when I add the {arguments} to the call which look like:
Without the arguments that have spaces, it starts the build in the VM. Still debugging what is going on. |
b8785f3
to
3f14ee4
Compare
quite close, just need to handle the actual upload. The image is now being built on the vm.
Just working on moving the upload outside the vm as discussed with Colin. |
If the image is in the local builds dir and also in the meta.json then you should be able to use |
6faf985
to
d453535
Compare
tested this on a pod and locally, it created a oci-archive with the name I pass to the command under --name.
Now generates:
The meta.json shows the entry too:
|
e538b77
to
bf241cd
Compare
@dustymabe you mean to use it in the pipeline right? If so then this PR now creates the oci-archive. So in the pipeline I need to call |
Yes
We might want to rename We also should consider how we want the containers in the registry to look. For example the resulting container from our FCOS pipeline is manifest listed with all architectures referenced. We run this in the release job (after all arches have finished building) rather than in each build job for each architecture. Just something to think about. |
Renamed, I think we can influence how it looks with the |
7b17c9c
to
860acbc
Compare
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.
This LGTM!
So the hard rename i.e. requiring the pipeline change seems to run straight into https://issues.redhat.com/browse/MCO-392 IOW, if we merge this change as is, won't it break the current (legacy) RHCOS pipeline for 4.12? Or I guess the answer is: we can just hold this until we do a hard cutover to the new pipeline? |
#3119 failed in the same way. So I am now confident this PR is not the culprit. With the memory updates it passes more tests after the flake retry but still fails 2. |
OK so now we're down to a few ext tests failing: |
Re. CI issues, coreos/coreos-ci-lib#118 and #3121 should help. |
@dustymabe question on this PR, I think I'm just reiterating things here but my understanding is basically we can't merge this until the new pipeline is ready. Alternatively, perhaps we could try merging it, and adjust the old pipeline to invoke it? I think in theory the old pipeline should be able to run through this flow too. Or yet another alternative, create a coreos-assembler build from this PR, and test out using it in the new pipeline? (And I guess still merge it only when the new pipeline is ready?) |
One thing that came out of deeper review of this PR yesterday is #3122 |
I think it's not a question of if the new pipeline is ready (i.e. we have the new pipeline running today in the dev namespace), but rather a question of if the old consumers (that expect the old behavior here) still exist (i.e. have we fully switched to the new pipeline yet). So we could adapt the old pipeline code if we wanted.. or just somehow gate the piece in the new pipeline that performs this action on some feature in COSA existing (i.e. a custom build of COSA would trigger the build/upload, but by default main COSA wouldn't until this got merged). |
I'm working on sorting out the container bits for the new pipeline and would like to get this in. I can take care of the pipeline modifications for it. I don't want to be touching the old pipeline code though. So my strawman is to do something similar to what we did with the
Thoughts? |
I've no objections. |
Yes, SGTM. Every single time we've tried to do an "API break" like renaming a command in a one shot with coordinated commits to cosa and the pipeline I think it's been more pain than gain. Better to take the short term tech debt and use reminders to ourselves to remove the deprecated bits safely later. |
fcaa877
to
e22b568
Compare
e22b568
to
b2b5fda
Compare
/retest-required |
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.
Some minor comments, but overall LGTM.
Now that it follows the classic "build an archive and put in images
" pattern, it might be nice to rename the command to cosa buildextend-legacy-oscontainer
instead. But anyway, we've had a lot of naming discussions already 🖌️ in this thread, so let's leave that for a separate PR!
arch = "x86_64" | ||
} | ||
return arch | ||
return coreosarch.CurrentRpmArch() |
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.
Minor: this could be a separate commit with its own rationale.
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.
This was done by running go vendor
after the schema update. I can split that to it's own commit if it helps. But this was not something I manually changed.
src/build-legacy-oscontainer.sh
Outdated
@@ -0,0 +1,7 @@ | |||
#!/usr/bin/env bash |
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.
For consistency, can we name this script src/create-legacy-oscontainer.sh
?
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.
sure thing
docs/cosa.md
Outdated
@@ -72,3 +72,4 @@ Those less commonly used commands are listed here: | |||
| [tag](https://github.com/coreos/coreos-assembler/blob/main/src/cmd-tag) | Operate on the tags in `builds.json` | |||
| [test-coreos-installer](https://github.com/coreos/coreos-assembler/blob/main/src/cmd-test-coreos-installer) | Automate an end-to-end run of coreos-installer with the metal image | |||
| [upload-oscontainer](https://github.com/coreos/coreos-assembler/blob/main/src/cmd-upload-oscontainer) | Upload an oscontainer (historical wrapper for `cosa oscontainer`) | |||
| [create-legacy-oscontainer](https://github.com/coreos/coreos-assembler/blob/main/src/cmd-create-legacy-oscontainer) | Create an oscontainer oci-archive (historical wrapper for `cosa oscontainer`) |
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.
Maybe
| [create-legacy-oscontainer](https://github.com/coreos/coreos-assembler/blob/main/src/cmd-create-legacy-oscontainer) | Create an oscontainer oci-archive (historical wrapper for `cosa oscontainer`) | |
| [create-legacy-oscontainer](https://github.com/coreos/coreos-assembler/blob/main/src/cmd-create-legacy-oscontainer) | Create an oscontainer in legacy format (i.e. not OSTree-native) |
?
Were you able to test this locally in a flow using |
This introduces a new command to create a oci-archive of the legacy oscontainer that will be pushed with `cosa push-container-manifest` by the pipeline.
These changes come from calling: `make schema && cd mantle && go vendor`
I have tested it on a pod in our cluster and locally without setting that flag. In the pod I built rhcos and then ran the command in it successfully. |
did a quick test and it works locally with |
b2b5fda
to
005cd81
Compare
Note this command is renamed in #3133 to |
Initial effort to fix: openshift/os#1009