chimera-linux / chimera-live

Image creation tooling
Other
41 stars 12 forks source link

Add basic support to build EC2 cloud images #18

Open yoctozepto opened 4 months ago

yoctozepto commented 4 months ago

I feel like this needs to switch from shell to something more manageable in the long term.

Some TODOs inline.

Shared to get early feedback.

Neither cloud-init-like functionality nor automatic networking are included but access from serial console allows to configure the remaining bits for now.

yoctozepto commented 4 months ago

Also, this probably generalises to more cloud providers and basically any virtualisation stack that can run a raw image in UEFI.

yoctozepto commented 4 months ago

Also, this is only for AMD64 here, but ARM64 (aarch64) should be similarly fine to add.

q66 commented 4 months ago

i want to add support into cloud-init, i don't think we should be doing this manually

yoctozepto commented 4 months ago

i want to add support into cloud-init

Perfect. I was thinking about trying something more lightweight to align with the lightweightness of chimera. Specifically, I was thinking about glean: https://opendev.org/opendev/glean I know it works very fine across OpenStack installations but never used it with proprietary cloud providers...

i don't think we should be doing this manually

What do you mean? I.e., doing what manually? If you mean in terms of cloud-init-like functionalities, then yes, we should rely on that de-facto standard, at least for the most used parts.

yoctozepto commented 4 months ago

Another TODO: secure the default fstab entry for the boot partition to make systemd-boot happier (and early randomness security a bit more too).

yoctozepto commented 4 months ago

i want to add support into cloud-init

Perfect. I was thinking about trying something more lightweight to align with the lightweightness of chimera. Specifically, I was thinking about glean: https://opendev.org/opendev/glean I know it works very fine across OpenStack installations but never used it with proprietary cloud providers...

Nothing beyond OpenStack with config-drives is supported so glean is a no-go.

Meanwhile, I've found https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud but it's focused on Alpine Linux, and https://github.com/clearlinux/micro-config-drive (in C!) but it's limited to config-drives as well.

So, it seems to me the best way forward is to adapt cloud-init accordingly. @q66 where can I find your effort so far? Any notes and whatever else you have would be appreciated. :-)

yoctozepto commented 4 months ago

NOTE-TO-SELF: This image is good enough across major cloud providers/services (AWS, GCP, OpenStack) so can be renamed to "cloud".

ALSO: Despite lack of cloud-init, it can be easily made more friendly (albeit less secure) - by not requiring configuration via a serial console - and instead enabling dhcpcd and sshd with root password auth allowed (that's why less secure) - the only scenario this won't cover would be static addressing but this basically needs proper cloud-init support to be manageable.