Skip to content
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

buildextend-live: Add support OSBUILD #3861

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ravanelli
Copy link
Member

  • Add support for OSBUILD via COSA_USE_LIVEISO env var for now

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach looks sane overall! Want to fold the commits in #3847 into this one?

src/cmd-buildextend-live Outdated Show resolved Hide resolved
src/cmd-buildextend-live Outdated Show resolved Hide resolved
src/cmd-buildextend-live Show resolved Hide resolved
src/cmd-buildextend-live Outdated Show resolved Hide resolved
src/cmd-buildextend-live Show resolved Hide resolved
src/cmd-buildextend-live Show resolved Hide resolved
src/cmd-buildextend-live Outdated Show resolved Hide resolved
src/cmd-buildextend-live Show resolved Hide resolved
src/cmd-buildextend-live Outdated Show resolved Hide resolved
jlebon and others added 5 commits October 1, 2024 10:21
We run osbuild inside of supermin, so for building the live ISO we'll
need all the tools it needs in there. This includes `genisoimage` and
`syslinux-nonlinux`.

We don't currently name `squashfs-tools` as a toplevel dependency. It's
currently pulled in by libguestfs, but we need it in supermin too, so
explicitly list it there.
This adds a new osbuild pipeline for building the live ISO using the new
`org.osbuild.coreos.live-iso` mega stage.

Still missing is changing `cmd-buildextend-live` to call osbuild
instead. I think we'll need to ratchet this in using e.g. an env var
like we did for the other osbuild artifacts. E.g. `COSA_OSBUILD_LIVE`
would control whether to use the old logic or the new one. And then turn
it on in rawhide, etc...

The new `cmd-buildextend-live` would also take care of extracting the
live artifacts from the live ISO to insert into `meta.json`.
…ze naming

- Rename `ignition_img_size` to `IGNITION_IMG_SIZE`
and `miniso_data_file_size` to `MINISO_DATA_FILE_SIZE`
for consistent naming convention;
- Move these definitions to the top level for better visibility and maintainability

Signed-off-by: Renata Ravanelli <[email protected]>
…creation

- Moved variable declarations and directories creation into generate_iso()
  to enhance clarity and maintainability.

Signed-off-by: Renata Ravanelli <[email protected]>
 -  Moved variable declarations to top to enhance clarity.

Signed-off-by: Renata Ravanelli <[email protected]>
 - Add support for OSBUILD via COSA_OSBUILD_LIVEISO env var for now.
Once we finish the OSBUILD integration we can disable it via var.

Signed-off-by: Renata Ravanelli <[email protected]>
Copy link

openshift-ci bot commented Oct 1, 2024

@ravanelli: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/rhcos 543fdf6 link true /test rhcos

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

@ravanelli ravanelli requested a review from jlebon October 8, 2024 19:34
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a review here but I'm not sure we should really merge this until we get a better idea of what the actual stages will look like (i.e. the manifests and the inputs will change).

initramfs_file = os.path.join(builddir, initramfs_name)
rootfs_file = os.path.join(builddir, rootfs_name)

if COSA_OSBUILD_LIVEISO != "":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just put this if statement down in the logic at the bottom of this file.

Comment on lines +874 to +875
# Extract live artifacts from ISO. OSBUILD does not support an output with multiple files
command = ["coreos-installer", "iso", "extract", "pxe", tmpisofile]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be fine for now, but really we should restructure the way we use osbuild today to be able to support multiple outputs. I think the limitation you mention is just part of how we wired in osbuild here.

tmpisofile
]
subprocess.run(command)
update_buildmeta()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have to call this function for the osbuild case but not for the other case?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think another way to say this is ideally we get rid of the very similar code in the legacy path and have it call update_buildmeta() also.

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two of the commits have a leading space in their titles.

The last commit is missing a blank line between the title and the body, which messes up git log --oneline.

Agree we should wait until we finalize the stage before adding the pipeline here. Though if you'd like, we can at least get the prep commits in for now in a separate PR.

]
subprocess.run(command)
update_buildmeta()
# Extract live artifacts from ISO. OSBUILD does not support an output with multiple files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, as discussed I think it'd be more accurate to say e.g.

Extract live artifacts from ISO until we rework runvm-osbuild to support outputting multiple files

tmpisofile
]
subprocess.run(command)
update_buildmeta()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think another way to say this is ideally we get rid of the very similar code in the legacy path and have it call update_buildmeta() also.

update_buildmeta()
# Extract live artifacts from ISO. OSBUILD does not support an output with multiple files
command = ["coreos-installer", "iso", "extract", "pxe", tmpisofile]
subprocess.run(command)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we missing steps here to move the artifacts into the build dir?

Combining with the previous comment, I think maybe we can make update_buildmeta() take as arguments the paths to the ISO, kernel, initramfs, and rootfs, and it takes care of moving them into the build dir and updating meta.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants