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

⚠️ Add pure alpine flavor #1465

Merged
merged 10 commits into from
Oct 18, 2023
Merged

⚠️ Add pure alpine flavor #1465

merged 10 commits into from
Oct 18, 2023

Conversation

Itxaka
Copy link
Member

@Itxaka Itxaka commented May 30, 2023

What this PR does / why we need it:
Provides a pure alpine flavor with alpine kernel and custom initrd

Requires:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@Itxaka Itxaka requested review from mudler and a team May 30, 2023 20:27
mauromorales
mauromorales previously approved these changes May 30, 2023
Copy link
Member

@mauromorales mauromorales left a comment

Choose a reason for hiding this comment

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

🔥

@mudler mudler changed the title Add pure alpine flavor ⚠️ Add pure alpine flavor May 31, 2023
mudler
mudler previously approved these changes May 31, 2023
Copy link
Member

@mudler mudler left a comment

Choose a reason for hiding this comment

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

absolute love! <3

@Itxaka
Copy link
Member Author

Itxaka commented May 31, 2023

fails due to kernel and initramfs being in different versions, new package with both bundled incoming.

mauromorales
mauromorales previously approved these changes May 31, 2023
@Itxaka
Copy link
Member Author

Itxaka commented Jun 1, 2023

weird, it passes locally with no issues the autoinstall test, in fact is fast af (67 seconds)

@Itxaka Itxaka force-pushed the alpine-initrd branch 6 times, most recently from 66b3d0e to a4f4a10 Compare June 16, 2023 13:28
@Itxaka
Copy link
Member Author

Itxaka commented Jun 16, 2023

@mudler this now passes all basic tests except the upgrade-to-latest which makes sense because it moves from an opensuse to a pure alpine system, so until release+1 that test wont work.

Anything that you want me to test on this? Any scenarios? I manually installed k3s on it, but was going to test a provider with this and encryption next

@Itxaka
Copy link
Member Author

Itxaka commented Jun 22, 2023

I havent tested this on rpi AT ALL. So no idea if this would work.

@mauromorales
Copy link
Member

gave it a spin on the RPi and got this issue

image

@Itxaka
Copy link
Member Author

Itxaka commented Jun 22, 2023

gave it a spin on the RPi and got this issue

image

Thanks @mauromorales !

I think I screwed up because dracut should not be there 😭

@Itxaka
Copy link
Member Author

Itxaka commented Oct 3, 2023

Time to get this ball running again....

@Itxaka Itxaka force-pushed the alpine-initrd branch 3 times, most recently from f0bee7c to 80cd3df Compare October 9, 2023 20:28
@Itxaka
Copy link
Member Author

Itxaka commented Oct 10, 2023

only thing missing for x86 is a missing cryptsetup in the initramfs, then it should pass the encryption tests as well.

For rpi, needs manual testing.

Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka Itxaka force-pushed the alpine-initrd branch 2 times, most recently from cb377e2 to 82973e9 Compare October 12, 2023 11:23
@Itxaka
Copy link
Member Author

Itxaka commented Oct 12, 2023

This now should pass all tests, both other flavors and alpine pure, including encryption.

Only thing missing:

  • check yip configs to see why hey are not behaving (probably some checks not working as expected under initramfs)
  • check manual QA on rpi flavors

@Itxaka
Copy link
Member Author

Itxaka commented Oct 16, 2023

rpi boots as expected.

Minor issue with machine-id, seems to be generated during initramfs but not in the correct size somehow? So on rootfs switch dbus complains about it and cant start...

UUID file '/etc/machine-id' should contain a hex string of length 32, not length 25, with no other text

@Itxaka
Copy link
Member Author

Itxaka commented Oct 16, 2023

This is what is autogenerated during initramfs I guess:

cat /etc/machine-id 
969551ab2fa82dc82a27e2f4d

And this is the proper format:

localhost:~$ dbus-uuidgen 
ae9ccad8d83b84d51bfb20fb00000092

@Itxaka
Copy link
Member Author

Itxaka commented Oct 16, 2023

Needed to clean up /var/lib/dbus/machine-id as seems like its created during base image build!

Also, expansion of COS_PERSISTENT does not work, maybe missing a udev trigger somewhere? udev is run on the initramfs start and luks tests confirmt hat the /dev/disk/by-label is filled correctly, otherwise it cant work as expected... so no idea why that is happening, iut doesnt seem to find the partition correctly somehow.

@Itxaka
Copy link
Member Author

Itxaka commented Oct 16, 2023

kairos-agent running twice on datasource -> Fixed by kairos-io/packages#489
Expansion not working -> deps missing from initramfs, working on that currently... Fixed by mudler/yip#116

I think this is mostly covered, only thing missing is:

  • (rpi) machine-id wrong format -> Already patched, needs confirmation confirmed working

  • (all) run edgevpn and all that

  • (rpi) fix clock on initramfs (not set, defaults to 1970) - Not urget, need to decide between using swclock or ntp if network.

  • investigate sysinfo in initramfs, not able to use random in the cloud-config templates, probably mounts missing?

  • (all) run k3s -> not sure if cgroups and such are ok, need to properly test it fixed by Even more alpine fixes packages#492

  • (standard) on recovery k3s service tries to start which creates noise on the terminal. Should probably stop it somehow? its probably the same on systemd services but the logs go to a different place so its invisible. Fixed on Improve alpine initrd output packages#493

@jimmykarily
Copy link
Contributor

rpi boots as expected.

Minor issue with machine-id, seems to be generated during initramfs but not in the correct size somehow? So on rootfs switch dbus complains about it and cant start...

UUID file '/etc/machine-id' should contain a hex string of length 32, not length 25, with no other text

Maybe relevant?

RUN rm -rf /etc/machine-id

@Itxaka
Copy link
Member Author

Itxaka commented Oct 17, 2023

rpi boots as expected.
Minor issue with machine-id, seems to be generated during initramfs but not in the correct size somehow? So on rootfs switch dbus complains about it and cant start...
UUID file '/etc/machine-id' should contain a hex string of length 32, not length 25, with no other text

Maybe relevant?

RUN rm -rf /etc/machine-id

not reall, that would be good, but something is creating a /var/lib/dbus/machine-id which is not correct...no idea what, maybe udev, maybe busybox with its services...

Anyway, its fixed now :)

includes bpf for alpine fix in config files
includes changes for the network and sysext generic packages
includes missing deps for initramfs in flavors
includes fixes for config files
includes fixes for tty overwriting on alpine
includes fixes for cgroups on alpine

Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
Copy link
Member

@mauromorales mauromorales left a comment

Choose a reason for hiding this comment

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

Fantastic work @Itxaka 👏 👏

@Itxaka
Copy link
Member Author

Itxaka commented Oct 17, 2023

only thing missing is provider-kairos with p2p enabled takes over the terminals witht he output, blocking the loging console. Something minor IMHO.

Fixes tty management on alpine

Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka
Copy link
Member Author

Itxaka commented Oct 18, 2023

Missing things:

  • (all) run edgevpn and all that
  • (rpi) fix clock on initramfs (not set, defaults to 1970) - Not urget, need to decide between using swclock or ntp if network.
  • (all) wrong motd is show on boot. For some reason our own motd is not being set and the default one is being used which is annoying

Fixes typo in alpine service file

Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka Itxaka merged commit 541dea6 into kairos-io:master Oct 18, 2023
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants