Skip to content

ci(feat): add mkosi os image building#780

Draft
pendo324 wants to merge 11 commits intomainfrom
mkosi-squashed
Draft

ci(feat): add mkosi os image building#780
pendo324 wants to merge 11 commits intomainfrom
mkosi-squashed

Conversation

@pendo324
Copy link
Contributor

Description of changes

Adds scripts, configuration, and a GitHub workflow for building Finch OS images using mkosi.

Testing done

Created working images for macOS and Windows using the GitHub Workflow: https://github.com/pendo324/finch-core/actions/runs/19875268071?pr=1

TODO

These are items which need to be done, but have been split off from this PR because it has already gotten too large:

  • Integrate these images with our existing tooling in finch/finch-core (e.g. make sure these images are tested)

  • Set up a schedule / triggers for automatically rebuilding the OS image

    • Make the workflow only run when needed, instead of on every PR
  • Integrate the dependencies in these images with existing version control / tracking mechanisms

    • Upload build results to S3
    • Update the full-os.conf and rootfs.conf files
  • I've reviewed the guidance in CONTRIBUTING.md

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@pendo324 pendo324 self-assigned this Dec 12, 2025
@pendo324 pendo324 requested a review from a team as a code owner December 12, 2025 22:05
@@ -0,0 +1,305 @@
From 4597a8c36a5cd043fa27acfe90297a80c9a59f59 Mon Sep 17 00:00:00 2001
Copy link
Member

Choose a reason for hiding this comment

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

Is this Patch required because mkosi doesnt have support for Amazon linux?
If yes what is the maintenance overhead for the patch, in the sense do we need to change if mkosi gets updated or changes some pattern?

This is a bit concerning if this is the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The patch is taken from a PR which got abandoned. I don't anticipate much maintenance burden in mkosi since Amazon Linux is essentially treated as Fedora by mkosi, with a few small changes.

systemd/mkosi#3784

Copy link
Member

Choose a reason for hiding this comment

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

Can we add documentation about the reference for the patch in readme.
And probably also the caveats for fixes done for AL2023.

Lets say a new AL version comes out do we have to redo the changes, but probably not relevant as don't see Al2023 going out of life any time soon

Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if we could have used fedora or debian as the base distribution and gotten rid of the AL patch? Did we choose AL for familiarity or does it allow for an even smaller image size? Since we specify the packages to install in base configuration anyway, would it have made much difference?

Copy link
Member

Choose a reason for hiding this comment

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

can you check my understanding is AL here is for the kernel and user space is fedora. But i might be wrong here.


### Custom Package Building

- **`al2023-build/`**: Directory containing infrastructure for building custom AL2023 packages
Copy link
Member

Choose a reason for hiding this comment

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

nit: folder rename to al2023-custom-package-build

@@ -0,0 +1,204 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

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

this script probably can be split into single responsibility parts.

Shubhranshu153
Shubhranshu153 previously approved these changes Dec 16, 2025
@pendo324
Copy link
Contributor Author

@Shubhranshu153 addressed comments in latest revision. Had to rebase to fix the commit name

@pendo324 pendo324 force-pushed the mkosi-squashed branch 2 times, most recently from bbd5e89 to 64445b3 Compare January 27, 2026 20:50
@pendo324
Copy link
Contributor Author

@Shubhranshu153 @Swapnanil-Gupta PTAL

Copy link
Contributor

@Swapnanil-Gupta Swapnanil-Gupta left a comment

Choose a reason for hiding this comment

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

Great work! 👍

git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: Build QEMU
run: |
ln -s "$HOME/.docker" /root/.docker
Copy link
Contributor

@Swapnanil-Gupta Swapnanil-Gupta Jan 28, 2026

Choose a reason for hiding this comment

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

nit: is the symlinking redundant?

X86_64_ARTIFACT=Fedora-Cloud-Base-Generic-42-1.1.x86_64-20260107003429.qcow2
X86_64_512_DIGEST=b5a6cb3361f437bd74b8b44f96e96709de440c1b41094b8125ca203928df665a8cdd4d8e58d0a81198da0d5f9a158917336a4a8b14b8eb3f33cd24c6278d1510

# Cosign binary for image signing
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this can possibly be in it's own conf file. I can do a follow up on this.

@@ -0,0 +1,305 @@
From 4597a8c36a5cd043fa27acfe90297a80c9a59f59 Mon Sep 17 00:00:00 2001
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if we could have used fedora or debian as the base distribution and gotten rid of the AL patch? Did we choose AL for familiarity or does it allow for an even smaller image size? Since we specify the packages to install in base configuration anyway, would it have made much difference?

Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
pendo324 and others added 2 commits February 26, 2026 20:35
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
- no need for binfmt submodule update in build-qemu.sh because
we already have a separate workflow for that - submodulesync.yaml
- remove os updates from update-dependencies workflow as we
have a new build-os workflow which will do the same
- do not create os image update pr's if build-os workflow is
running from a pr trigger
- fix incorrent path in binfmt submodule update

Signed-off-by: Swapnanil Gupta <swpnlg@amazon.com>
Shubhranshu153
Shubhranshu153 previously approved these changes Feb 26, 2026
@Shubhranshu153
Copy link
Member

Shubhranshu153 commented Feb 26, 2026

LGTM.

Signed-off-by: Swapnanil Gupta <swpnlg@amazon.com>
Signed-off-by: Swapnanil Gupta <swpnlg@amazon.com>
Signed-off-by: Swapnanil Gupta <swpnlg@amazon.com>
Signed-off-by: Swapnanil Gupta <swpnlg@amazon.com>
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