-
Notifications
You must be signed in to change notification settings - Fork 184
osbuild: support building multiple platforms at once #3930
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
c71b1d2 to
7c4be32
Compare
With coreos/coreos-assembler#3930 we can now build multiple artifacts/platforms in a single OSBuild call. Let's add support here for: 1. Detecting if an artifact supports building via OSBuild by looking to see if the buildextend-{artifact} API points to cmd-osbuild. i.e. is OSBuild the default for this artifact? 2. Allowing the pipecfg to specify additional artifacts to build using OSBuild. This is useful if OSBuild is not yet the default way to build this particular artifact.
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.
Very nice! Overall LGTM.
7c4be32 to
af630d1
Compare
|
Pushed an update to address code review comments and also update a few missing things from the gcp/applehv/hyperv platforms. |
|
ideas on this shellcheck error? The code it's complaining about is embedded python. |
It's not actually shellcheck that is complaining. It's hitting this check that we added in #3155 coreos-assembler/tests/check_one.sh Lines 30 to 33 in 48fba72
|
The results of running this were never used and we stopped running it in coreos/fedora-coreos-pipeline@81304c0
We never officially supported this and when we switched to OSBuild in d37958a and dropped create_disk.sh this became dead code.
No longer used since we dropped create_disk.sh in d37958a.
This will enable us to generate the input config for runvm-osbuild once and re-use it for all platforms. In other words, the input JSON to runvm-osbuild shouldn't change between invocations.
- Add getconfig() helper functions to reduce boilerplate
- Rename variable for config passed to runvm-osbuild to make it more clear
- Create less files
- Use variables and pipes instead of creating multiple files
- Limit the config for runvm-osbuild
- Only pass in the variables that are used there and not the entire image.json
…results Let's refactor the generation of the runvm-osbuild config into a function and cache the results since we don't need to compute these values every time we run OSBuild.
…nfig() This only needs to happen when we're generating the config.
This will help my mental model a bit.
In this case we'll just copy out the entire exported tree for a given pipeline (which we specify as --export=platform). For individual artifacts we'll just name the file the same name as the platform and then copy them into the right place in the calling script. The benefits of this can be seen immediately because now we don't have to know about or copy around qemu-secex bootfs_hash and rootfs_hash inside the supermin VM.
Allows for a little more reasoning on what is happening when.
From what I can tell this is only used in the case where we are delaying meta.json merging until later. For example, when parallel building and we want meta.json snippets (i.e. meta.aws.json) to be what gets merged at the end. Let's remove it from here to simplify.
This separates them. It adds a call to `cosa meta` but now the code stands on its own and the ordering doesn't matter.
Reduces duplicate code by making a function to handle the meta.json update and finalization of the artifact.
Improves code readability.
This script isn't set -x to begin with so this doesn't really do anything right now.
It's unlikely to change. This is prep to make a future change easier.
And also refactor to drop the rc variable.
This is a direct copy of cmd-buildextend-metal for now. Will update it to be functional in the next commit.
OK. I was able to figure out a workaround.. rebased the PR and added a commit with the workaround. |
af630d1 to
b45d0fe
Compare
Now you can run `cosa osbuild qemu metal gcp...` it will build them all. The following files are now symlinks to `cmd-osbuild` and all backwards compatibility should be preserved. - cmd-buildextend-metal - cmd-buildextend-metal4k - cmd-buildextend-qemu - cmd-buildextend-qemu-secex - cmd-buildextend-secex
Turns out we can stencil in the name of the artifacts we want to create and just have OSBuild go ahead and write files to the right name. Also dropped an extra copy that's not really necessary.
This leverages the featurework in upstream OSBuild [1] and matches the compression level we use today for gzip compression. [1] osbuild/osbuild@cfaabe6
In qemuvariants.py applehv is gzip compressed so let's do the same here and tell postprocess_artifact to skip compression in meta.json. While we are here also have gcp set to skip compression in meta.json.
This reverts commit 4155975. The upstream fix [1] was released in OSBuild v132 that is in Fedora 40 now. [1] osbuild/osbuild#1908
The artifact we create in the pipeline today is .vhdx.zip. Let's build on the work upstream in [1] and use the new OSBuild zip stage to encapsulate the artifact. [1] osbuild/osbuild@ac8a2a4
The check is invalid for this code because it's embedded python. Let's just workaround it for now by putting it in a elif so it won't match the string being looked for in https://github.com/coreos/coreos-assembler/blob/48fba72a62c739f6eaf4d7991052516fd574acc7/tests/check_one.sh#L30-L33
b45d0fe to
bb17179
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.
LGTM!
| # backwards conditional here because of a invalid (for this code) CI check | ||
| # https://github.com/coreos/coreos-assembler/pull/3930#issuecomment-2473714222 | ||
| if False: | ||
| pass | ||
| elif ${skip_compress}: | ||
| j['images']['${artifact_name}']['skip-compression'] = True |
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.
Heh, that's actually kinda funny.
I think another way around this is:
if True == ${skip_compression}:
...
Not worth the respin
With coreos/coreos-assembler#3930 we can now build multiple artifacts/platforms in a single OSBuild call. Let's add support here for: 1. Detecting if an artifact supports building via OSBuild by looking to see if the buildextend-{artifact} API points to cmd-osbuild. i.e. is OSBuild the default for this artifact? 2. Allowing the pipecfg to specify additional artifacts to build using OSBuild. This is useful if OSBuild is not yet the default way to build this particular artifact.
With coreos/coreos-assembler#3930 we can now build multiple artifacts/platforms in a single OSBuild call. Let's add support here for: 1. Detecting if an artifact supports building via OSBuild by looking to see if the buildextend-{artifact} API points to cmd-osbuild. i.e. is OSBuild the default for this artifact? 2. Allowing the pipecfg to specify additional artifacts to build using OSBuild. This is useful if OSBuild is not yet the default way to build this particular artifact.
With coreos/coreos-assembler#3930 we can now build multiple artifacts/platforms in a single OSBuild call. Let's add support here for: 1. Detecting if an artifact supports building via OSBuild by looking to see if the buildextend-{artifact} API points to cmd-osbuild. i.e. is OSBuild the default for this artifact? 2. Allowing the pipecfg to specify additional artifacts to build using OSBuild. This is useful if OSBuild is not yet the default way to build this particular artifact.
With coreos/coreos-assembler#3930 we can now build multiple artifacts/platforms in a single OSBuild call. Let's add support here for detecting what artifacts are supported to be built by OSBuild and build them using OSBuild. We segregate here "experimental" versus "stable" OSbuild built artifacts and add a pipecfg knob for opting into the "experimental" ones being built by OSBuild.
foo With coreos/coreos-assembler#3930 we can now build multiple artifacts/platforms in a single OSBuild call. Let's add support here for detecting what artifacts are supported to be built by OSBuild and build them using OSBuild. We segregate here "experimental" versus "stable" OSbuild built artifacts and add a pipecfg knob for opting into the "experimental" ones being built by OSBuild.
With coreos/coreos-assembler#3930 we can now build multiple artifacts/platforms in a single OSBuild call. Let's add support here for detecting what artifacts are supported to be built by OSBuild and build them using OSBuild. We segregate here "experimental" versus "stable" OSbuild built artifacts and add a pipecfg knob for opting into the "experimental" ones being built by OSBuild.
With coreos/coreos-assembler#3930 we can now build multiple artifacts/platforms in a single OSBuild call. Let's add support here for detecting what artifacts are supported to be built by OSBuild and build them using OSBuild. We segregate here "experimental" versus "stable" OSbuild built artifacts and add a pipecfg knob for opting into the "experimental" ones being built by OSBuild.
This is done by adding
cosa osbuild qemu metal....There is a lot of refactor/cleanup in this PR. Please review commits individually.