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

Switch to using OSBuild for most CoreOS boot image building #1653

Open
dustymabe opened this issue Jan 23, 2024 · 13 comments
Open

Switch to using OSBuild for most CoreOS boot image building #1653

dustymabe opened this issue Jan 23, 2024 · 13 comments
Assignees
Labels
area/usability F40 kind/enhancement status/pending-stable-release Fixed upstream and in testing. Waiting on stable release.

Comments

@dustymabe
Copy link
Member

dustymabe commented Jan 23, 2024

Since the beginning in CoreOS we have inherited or developed tooling inside COSA (CoreOS Assembler) to take the created OSTree commit and stick that into all of our different disk images that we ship (qemu, aws, openstack, ISO, etc).

Since we are the only consumers of COSA we have the desire to not maintain the bespoke image building code over the long term. The consensus is to use Image Builder/OSBuild for disk image building in the future. A good amount of work has gone into enabling OSBuild to be able to do this already.

This will also allow anyone who has created a container layer (see https://github.com/coreos/layering-examples/) to build a boot image from a derived container layer using OSBuild and not requiring COSA.

For the first round of this we will focus on building the qemu, metal and metal4k images. Most other images that we build are actually based off of the qemu image so they will also be indirectly affected (in the future we'll use OSBuild to build them directly).

Out of scope for this first round is the ISO/PXE artifacts as those are a bit more complicated.

@cgwalters
Copy link
Member

I edited your text to s/image/disk image/ for osbuild.

@dustymabe
Copy link
Member Author

We discussed this in the Community Meeting Today:

* AGREED: We will roll out disk image building using OSBuild to our `rawhide`
          mechanical stream first (this is a non-user facing stream). Then we
          will roll out OSBuild to the `next` stream and let it soak there for
          some time. We may choose to switch over `testing` before the rebase
          to F40, but we won't do it until F40 has at least reached `next` at
          F40 beta time. (@dustymabe:matrix.org, 16:52:30)

@dustymabe dustymabe removed the meeting topics for meetings label Jan 24, 2024
@dustymabe dustymabe self-assigned this Jan 24, 2024
dustymabe added a commit to dustymabe/fedora-coreos-pipeline that referenced this issue Jan 31, 2024
@dustymabe
Copy link
Member Author

dustymabe commented Jan 31, 2024

First step of enablement for this in the pipeline:

dustymabe added a commit to coreos/fedora-coreos-pipeline that referenced this issue Jan 31, 2024
@dustymabe
Copy link
Member Author

OK last week we started building using OSBuild for rawhide in our pipeline.

In order to compare a little I decided to write a small helper utility to do size comparison. diffbuildsizes.py.txt

Here is the output for the OSBuild built artifacts:

    platform     | compression  | 40.20240131.91.0 | 40.20240201.91.0
---------------------------------------------------------------------
qemu             | compressed   | 663MiB           | 848MiB          
qemu             | uncompressed | 1577MiB          | 876MiB          
metal4k          | compressed   | 661MiB           | 670MiB          
metal4k          | uncompressed | 2458MiB          | 2458MiB         
metal            | compressed   | 663MiB           | 698MiB          
metal            | uncompressed | 2458MiB          | 2458MiB         

What I really don't understand is the sizes for the qemu image. The uncompressed size is much smaller, but the compressed size is about 185MiB larger. All of this analysis is done using the size values from the meta.json file.

@dustymabe
Copy link
Member Author

OK I think I figured this out. OSBuild does the qcow2 conversion with compression on. This means the contents are internally compressed, which explains why the "uncompressed" size is much better (876MiB versus 1577MiB), but that means the outer xz compression is less effective (848MiB versus 663MiB).

dustymabe added a commit to dustymabe/coreos-assembler that referenced this issue Feb 5, 2024
We'll open a PR upstream to make compression an option for this stage,
but for now we'll just disable it in the code because we know we don't
want it: coreos/fedora-coreos-tracker#1653 (comment)
dustymabe added a commit to coreos/coreos-assembler that referenced this issue Feb 6, 2024
We'll open a PR upstream to make compression an option for this stage,
but for now we'll just disable it in the code because we know we don't
want it: coreos/fedora-coreos-tracker#1653 (comment)
lukewarmtemp added a commit to lukewarmtemp/osbuild that referenced this issue Feb 6, 2024
Modify the stages/org.osbuild.qemu stage such that compression is.
Optional. This resolves the image size differences between an image
built with coreos assember vs osbuild, as discussed in:
coreos/fedora-coreos-tracker#1653 (comment)
lukewarmtemp added a commit to lukewarmtemp/osbuild that referenced this issue Feb 6, 2024
Modify the stages/org.osbuild.qemu stage such that compression is
optional. This resolves the image size differences between an image
built with coreos assember vs osbuild, as discussed in:
coreos/fedora-coreos-tracker#1653 (comment)
lukewarmtemp added a commit to lukewarmtemp/osbuild that referenced this issue Feb 6, 2024
Modify the stages/org.osbuild.qemu stage such that compression is
optional. This resolves the image size differences between an image
built with coreos assember vs osbuild, as discussed in:
coreos/fedora-coreos-tracker#1653 (comment)
lukewarmtemp added a commit to lukewarmtemp/osbuild that referenced this issue Feb 7, 2024
Modify the stages/org.osbuild.qemu stage such that compression is
optional. This resolves the image size differences between an image
built with coreos assember vs osbuild, as discussed in:
coreos/fedora-coreos-tracker#1653 (comment)
lukewarmtemp added a commit to lukewarmtemp/osbuild that referenced this issue Feb 7, 2024
Modify the stages/org.osbuild.qemu stage such that compression is
optional. This resolves the image size differences between an image
built with coreos assember vs osbuild, as discussed in:
coreos/fedora-coreos-tracker#1653 (comment)
lukewarmtemp added a commit to lukewarmtemp/osbuild that referenced this issue Feb 7, 2024
Modify the stages/org.osbuild.qemu stage such that compression is
optional. This resolves the image size differences between an image
built with coreos assember vs osbuild, as discussed in:
coreos/fedora-coreos-tracker#1653 (comment)
lukewarmtemp added a commit to lukewarmtemp/osbuild that referenced this issue Feb 7, 2024
Modify the stages/org.osbuild.qemu stage such that compression is
optional. This resolves the image size differences between an image
built with coreos assember vs osbuild, as discussed in:
coreos/fedora-coreos-tracker#1653 (comment)
lukewarmtemp added a commit to lukewarmtemp/osbuild that referenced this issue Feb 7, 2024
Modify the stages/org.osbuild.qemu stage such that compression is
optional. This resolves the image size differences between an image
built with coreos assember vs osbuild, as discussed in:
coreos/fedora-coreos-tracker#1653 (comment)
lukewarmtemp added a commit to lukewarmtemp/osbuild that referenced this issue Feb 7, 2024
Modify the stages/org.osbuild.qemu stage such that compression is
optional. This resolves the image size differences between an image
built with coreos assember vs osbuild, as discussed in:
coreos/fedora-coreos-tracker#1653 (comment)
dustymabe pushed a commit to lukewarmtemp/osbuild that referenced this issue Feb 7, 2024
Modify the stages/org.osbuild.qemu stage such that compression is
optional. This resolves the image size differences between an image
built with coreos assember vs osbuild, as discussed in:
coreos/fedora-coreos-tracker#1653 (comment)
dustymabe added a commit to dustymabe/coreos-assembler that referenced this issue Feb 15, 2024
We previously did this in a different way (2a8d1e6) but then
had to revert it (39fdd61) because it caused images to not boot [1].
The root cause appears to have been the virtiofs mount not
being unmounted cleanly from the supermin VM and that is now
fixed so let's switch back to not compressing since we rely on
our outer compression [2].

[1] coreos#3728
[2] coreos/fedora-coreos-tracker#1653 (comment)
jbtrystram pushed a commit to jbtrystram/fedora-coreos-pipeline that referenced this issue Feb 15, 2024
dustymabe added a commit to coreos/coreos-assembler that referenced this issue Feb 16, 2024
We previously did this in a different way (2a8d1e6) but then
had to revert it (39fdd61) because it caused images to not boot [1].
The root cause appears to have been the virtiofs mount not
being unmounted cleanly from the supermin VM and that is now
fixed so let's switch back to not compressing since we rely on
our outer compression [2].

[1] #3728
[2] coreos/fedora-coreos-tracker#1653 (comment)
@dustymabe
Copy link
Member Author

ok a lot of work has happened here in the background. osbuild/osbuild#1589 was the last big piece IIUC. I've now enabled OSBuild for the branched stream too (coreos/fedora-coreos-pipeline#966).

We'll enable it for next-devel once we are closer to F40 beta by merging coreos/fedora-coreos-pipeline#967

@dustymabe
Copy link
Member Author

With the switch of the next stream to F40 we are now shipping OSBuild built qemu, metal, and metal4k artifacts that were directly built using OSBuild. The first release for this was 40.20240322.1.0.

Note that most other images (aws, gcp, etc) are actually derived from the qemu artifact so in a way those are also indirectly built using OSBuild too. We'll switch them over to direct building as we add the functionality to support those.

@dustymabe dustymabe added the status/pending-next-release Fixed upstream. Waiting on a next release. label Mar 25, 2024
@dustymabe
Copy link
Member Author

The fix for this went into next stream release 40.20240322.1.0. Please try out the new release and report issues.

@dustymabe dustymabe added F40 status/pending-testing-release Fixed upstream. Waiting on a testing release. and removed status/pending-next-release Fixed upstream. Waiting on a next release. labels Mar 27, 2024
@dustymabe
Copy link
Member Author

We missed this when we switched the testing stream over to F40. It will be in the next testing release that goes out.

dustymabe added a commit to dustymabe/fedora-coreos-pipeline that referenced this issue Apr 23, 2024
dustymabe added a commit to coreos/fedora-coreos-pipeline that referenced this issue Apr 23, 2024
@jlebon
Copy link
Member

jlebon commented May 9, 2024

Out of scope for this first round is the ISO/PXE artifacts as those are a bit more complicated.

When closing this ticket, let's file another ticket to track that follow-up work. That way also, others interested in this can subscribe to it.

Edit: actually, filed it at #1725

@dustymabe
Copy link
Member Author

PR to make building using OSBuild the default in COSA: coreos/coreos-assembler#3800

@dustymabe
Copy link
Member Author

The fix for this went into testing stream release 40.20240504.2.0. Please try out the new release and report issues.

@dustymabe dustymabe added status/pending-stable-release Fixed upstream and in testing. Waiting on stable release. and removed status/pending-testing-release Fixed upstream. Waiting on a testing release. labels May 10, 2024
aaradhak pushed a commit to aaradhak/fedora-coreos-pipeline that referenced this issue May 14, 2024
aaradhak pushed a commit to aaradhak/fedora-coreos-pipeline that referenced this issue May 14, 2024
marmijo added a commit to marmijo/fedora-coreos-streams that referenced this issue Jun 27, 2024
includes updates for the following:
   - 2024-05-21:
	- coreos/fedora-coreos-tracker#1653
   - 2024-06-03
   - 2024-06-17:
	- coreos/fedora-coreos-tracker#1722
marmijo added a commit to marmijo/fedora-coreos-streams that referenced this issue Jun 27, 2024
includes updates for the following:
   - 2024-05-21:
	- coreos/fedora-coreos-tracker#1653
   - 2024-06-03
   - 2024-06-17:
	- coreos/fedora-coreos-tracker#1722
marmijo added a commit to marmijo/fedora-coreos-streams that referenced this issue Jun 27, 2024
includes updates for the following:
   - 2024-05-21:
	- coreos/fedora-coreos-tracker#1653
   - 2024-06-03
   - 2024-06-17:
	- coreos/fedora-coreos-tracker#1722
marmijo added a commit to coreos/fedora-coreos-streams that referenced this issue Jun 27, 2024
includes updates for the following:
   - 2024-05-21:
	- coreos/fedora-coreos-tracker#1653
   - 2024-06-03
   - 2024-06-17:
	- coreos/fedora-coreos-tracker#1722
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/usability F40 kind/enhancement status/pending-stable-release Fixed upstream and in testing. Waiting on stable release.
Projects
None yet
Development

No branches or pull requests

4 participants