-
Notifications
You must be signed in to change notification settings - Fork 593
Description
As of now, the runtime lifecycle states that there is a Start action which results in creation of a container sandbox and spawning the first process inside the container.
It would be better to separate lifecycle of the container sandbox from that of container processes.
To be more precise, I'm proposing introducing the following oci actions:
- Create - This action will create a container sandbox. On Linux, this would be all cgroups and namespaces, excepting pid namespace (assuming all cgroups and namespaces were requested as part of the Spec).
- Start - This action will spawn a new process in the existing container sandbox. On Linux, a new pid namespace will be created for the first process that is being spawned. Subsequent processes will run the same pid namespace.
- Cleanup - This action will kill all processes in a container sandbox. In the case of Linux, this will result in loss of pid namespace.
- Delete - This action will delete the container sandbox.
This split will obviate the need for supporting hooks. Users are free to run hooks outside of the runtime as they please.
The existing Spec needs to be split into a Sandbox configuration and a Process configuration.
The process configuration can be reused for the Exec use-case.
FYI: This was discussed during the OCI meeting on 1/12/16 and everyone present agreed to this proposal.
We need to prototype this separation in one or more Operating Systems before requiring it in the Spec.
Input from runtime authors on non-linux platforms will be helpful here.