You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue tracks the ability to set and manage Unikraft unikernels as individual systemd entries. Ultimately this would give users the ability to use unikernels as secure, persistent system services.
At a glance, creating and managing unikernels as systemd processes should be designed to be simple, making it an effective mechanism and alternative approach for system services. As such, a new flag --systemd should be provided to the following subcommands to enable managing and running via this interface:
kraft run --systemd [...]
kraft start --systemd [...]
kraft stop --systemd [...]
kraft rm --systemd [...]
kraft ps --systemd [...]
In order to prevent large disruption to the individual subcommand codebases, (i.e. preventing having a large if opts.Systemd flag with a different line-of-execution), a simple wrapper around the machine API can be used to proxy all interface methods into relevant systemd service management actions.
In order to propagate such functionality, a new machine service implementation is required in kraftkit.sh/machine/platform/systemd which implements the MachineService interface:
The new method NewMachineV1alpha1ServiceSystemdWrapper will consume all interface methods and directly interface with systemd which can be accomplished with this existing Go module.
Warning
Installing systemd process should ultimately create an entry which invokes kraft itself and that not all interface methods are a simple 1-to-1 call of one another. This is because wrapper will pass through the machine API store twice and some verbs do not map directly to the machine API. Careful consideration should be practice when proxying commands. For example, the Create command should both create the systemd service entry and also initialize the unikernel. The Start method, however, could, only start the systemd service as this will invoke kraft which will actually start the unikernel.
Feature request summary
This issue tracks the ability to set and manage Unikraft unikernels as individual systemd entries. Ultimately this would give users the ability to use unikernels as secure, persistent system services.
At a glance, creating and managing unikernels as systemd processes should be designed to be simple, making it an effective mechanism and alternative approach for system services. As such, a new flag
--systemd
should be provided to the following subcommands to enable managing and running via this interface:kraft run --systemd [...]
kraft start --systemd [...]
kraft stop --systemd [...]
kraft rm --systemd [...]
kraft ps --systemd [...]
In order to prevent large disruption to the individual subcommand codebases, (i.e. preventing having a large
if opts.Systemd
flag with a different line-of-execution), a simple wrapper around the machine API can be used to proxy all interface methods into relevant systemd service management actions.In order to propagate such functionality, a new machine service implementation is required in
kraftkit.sh/machine/platform/systemd
which implements theMachineService interface
:kraftkit/api/machine/v1alpha1/machine.zip.go
Lines 149 to 162 in 71509c7
To utilize the machine API via a controller, it should be a simple case of wrapping an existing controller, e.g.:
The new method
NewMachineV1alpha1ServiceSystemdWrapper
will consume all interface methods and directly interface with systemd which can be accomplished with this existing Go module.Warning
Installing systemd process should ultimately create an entry which invokes
kraft
itself and that not all interface methods are a simple 1-to-1 call of one another. This is because wrapper will pass through the machine API store twice and some verbs do not map directly to the machine API. Careful consideration should be practice when proxying commands. For example, theCreate
command should both create the systemd service entry and also initialize the unikernel. TheStart
method, however, could, only start the systemd service as this will invokekraft
which will actually start the unikernel.Additional context
@MdSahil-oss wants to work on this.
The text was updated successfully, but these errors were encountered: