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 a bootstrap stage to allow a two stage node boot process #1115

Open
1 task done
griznog opened this issue Feb 29, 2024 · 5 comments · May be fixed by #1191
Open
1 task done

Add a bootstrap stage to allow a two stage node boot process #1115

griznog opened this issue Feb 29, 2024 · 5 comments · May be fixed by #1191
Labels
discuss A topic for discussion in a community meeting enhancement New feature or request stake:ciq CIQ is a stakeholder of this issue
Milestone

Comments

@griznog
Copy link
Contributor

griznog commented Feb 29, 2024

Summary

Request is for warewulfd to serve a

  • stage=bootstrap_container which would download a container to be specified by BootStrapContainer in the node config
  • stage=bootstrap_kernel which would download a kernel to be specified by BootStrapKernel in the node config
  • stage=bootstrap_system which would download the system overlay for the BootStrapSystemOverlay
  • stage=bootstrap_runtime which would download the runtime overlay for the BootStrapRuntimeOverlay

This would allow optionally booting nodes with an arbitrary kernel and container, which could then perform whatever actions are needed before downloading the final kernel/container/overlays and pivot/switch-root-ing and/or doing a kexec().

Rationale

This enhancement would allow easily testing using a shim bootstrap, whether that is a dracut initrd, custom bootstrap image or just a minimal OS container. Potential applications/benefits are:

  • Making large containers possible with Legacy BIOS by loading them from a shim minimal OS
  • Allowing for a full OS environment to set up disks, grub and any other steps required to statefully provision nodes
  • Allow stateless provisioning to be direct to disk rather than using a tmpfs and depending on swapping to free memory

Description

  • Add methods to set the values of BootStrap [Container|Kernel|SystemOverlay|RuntimeOverlay] in the node config
  • Add necessary stage_* requests to warewulfd

The BootStrap containers, kernels and overlays can be managed just like any other containers, kernels and overlays.

Additional information

Not sure how this would look for ipxe or grub or any other boot methods, so leaving those as an exercise for the admin after the bootstrrap functionality is available.

General information

  • I have searched the issues of this repo and believe this is not a duplicate
@griznog griznog added the enhancement New feature or request label Feb 29, 2024
@anderbubble anderbubble changed the title RFE: Add a bootstrap stage to allow a two stage node boot process. Add a bootstrap stage to allow a two stage node boot process. Feb 29, 2024
@anderbubble anderbubble added the stake:ciq CIQ is a stakeholder of this issue label Feb 29, 2024
@anderbubble anderbubble added this to the v4.6.0 milestone Feb 29, 2024
@anderbubble anderbubble added the discuss A topic for discussion in a community meeting label Feb 29, 2024
@msquantori
Copy link

This will be very useful. I don't think it has to be complicated though with bootstrap overlays. All we need - some minimal os that boots first and then can properly load big OS container, setting up disks, grab secrets, etc. This is exactly how it is done in Brigth Cluster Manager as far as I remember and it worked perfectly well. No issues with old BIOS/pxe/whatever, also - easy stateless setup, but with disks. Meaning - every time node boots, disks are wiped out and OS just rsynced to disks.

@griznog
Copy link
Contributor Author

griznog commented Mar 4, 2024

This will be very useful. I don't think it has to be complicated though with bootstrap overlays. All we need - some minimal os that boots first and then can properly load big OS container, setting up disks, grab secrets, etc.

Treating the bootstrap exactly the way a normal container is treated keeps things consistent. Allowing the bootstrap to have overlays brings that same flexibility to the bootstrap phase and is effectively already written in WW4.

Rather than having a single bootstrap which is hard-coded, a site might want to build their own with dracut directly from a container, creating a container-specific bootstrap that does not need a kexec() call, just a switch_root to the final init and /. I think ( but haven't proven yet) that it'd be possible to produce a container-specific dracut built initrd that used systemd as the native init rather than needing to shim an init script in the boot process. For these and other reasons, the most important being "all the things I haven't thought of but someone else will", I think it's worth making the bootstrap process as configurable as the current container/overlay system to give admins that flexibility.

A follow up to this RFE would definitely be that WW should include a standard and documented bootstrap container that gives new users a working default, but given that it's just as simple to allow complete freedom for local sites to build their own bootstraps and processes, it'd be a shame to restrict to a single "approved" bootstrap image/process.

Also I want WW to be BETTER than Bright, not LIKE Bright 😁

@yqin
Copy link
Contributor

yqin commented Mar 6, 2024

I'm a supporter of this idea. If you came from WW3 (or even WW2/Perceus) you know that has been the model for years (2-stage provisioning). I believe we had some discussion on this during the early days of WW4 project and @gmkurtzer decided to go to current model. From what I recall the original argument was like, if you are already provisioning a container to the node, why not just provision it directly, instead of relying on another stager/bootstrap to provision it for you. But I do see the value of being flexible. Technically this is not too difficult to do with current model as well and you can build a 1st stage container that works just like the old bootstrap, and perform the necessary tasks such as preparing disks that @msquantori would like to do, then wget the second stage container from the same warewulfd, extract it, and switch_root to it.

@msquantori
Copy link

msquantori commented Mar 6, 2024 via email

@yqin
Copy link
Contributor

yqin commented Mar 6, 2024

My use case for the 2-stage provisioning is different than yours. So just throw it out as well for some thoughts. We have some hardware (NIC in this case) that lack of ipxe support, basically after some fiddling with ipxe itself I was only able to get it negotiate to 100 Mbps instead of the expected 1 Gbps (I think there are similar reports in ipxe community as well). This causes downloading the full-blown container image taking a lot of time. However the OS driver does not have that limit so the use case would be to just use the ipxe to download the 1st stage container as small as possible, then load up the OS driver and download the 2nd stage full-blown container. Yes I agree that a native support would be ideal but just saying that this isn't a showstopper with the current model.

@anderbubble anderbubble changed the title Add a bootstrap stage to allow a two stage node boot process. Add a bootstrap stage to allow a two stage node boot process Mar 19, 2024
@anderbubble anderbubble added discuss A topic for discussion in a community meeting and removed discuss A topic for discussion in a community meeting labels Mar 21, 2024
@anderbubble anderbubble linked a pull request Apr 16, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss A topic for discussion in a community meeting enhancement New feature or request stake:ciq CIQ is a stakeholder of this issue
Projects
None yet
4 participants