-
Notifications
You must be signed in to change notification settings - Fork 183
osbuild: more refactor to prep for calling osbuild to generate multiple artifacts #3925
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
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
This means we now generate the parameters for runvm-osbuild once and then use them for all subsequent calls. It removes some of the logic from cmd-buildextend-metal so that other buildextend* commands can start to call runvm-osbuild (or some variant) too.
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.
jlebon
left a comment
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.
One concern, but overall LGTM to me. Nice work!
| # not the last partition on the disk so we need to explicitly size it | ||
| rootfs-size: "${rootfs_size_mb}" | ||
| EOF | ||
| /usr/lib/coreos-assembler/finalize-artifact "tmp/${runvm_osbuild_config_json}" "${runvm_osbuild_config_json}" |
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.
Hmm, though should it be in the build dir? E.g. this will end up in S3. I guess there might be value in archiving it, though I would just leave it in tmp/ to start.
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.
ok reworking this to acommodate I just went to the next step (i was heading towards anyway) and opened #3930
|
closing in favor of #3930 |
Mostly draining of cmd-buildextend-metal. Also some cleanup here and there. See individual commit messages.