auraed
auraed copied to clipboard
Graceful shutdown
We need to implement a graceful shutdown flow. This flow must be executed when auraed gets a SIGTERM signal, the power button is pressed (if executed as pid 1) or when auraed gets a reboot or shutdown request via GRPC.
- An event has to be sent to all GRPC clients to inform them about the imminent shutdown.
- No new workloads (processes, containers, VMs, ...) may be scheduled.
- All threads, processes, containers, VMs, MicroVMs must be shut down gracefully (e.g. sending SIGTERM to processes, waiting for x seconds and then sending SIGKILL if they have not shut down; sending ACPI shutdown to VMs, power off after timeout).
- The GRPC API needs to be stopped.
- The API socket needs to be deleted.
Using serve_with_incoming_shutdown, we can stop the GRPC server on a supplied signal.
It would replace: https://github.com/aurae-runtime/auraed/blob/809a488d8c36c45ccde88d4dc668d3cd5c085652/src/lib.rs#L141