From e6fd589bdef6504d181931e97d7bfd2005be537c Mon Sep 17 00:00:00 2001 From: "Rob Dolin (MSFT)" Date: Tue, 8 Nov 2016 14:03:07 -0800 Subject: [PATCH] [Runtime] Add anchor tags for headings and bullets Signed-off-by: Rob Dolin --- runtime.md | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/runtime.md b/runtime.md index cedb224c6..cde9ec2e4 100644 --- a/runtime.md +++ b/runtime.md @@ -1,29 +1,29 @@ -# Runtime and Lifecycle +# Runtime and Lifecycle -## Scope of a Container +## Scope of a Container Barring access control concerns, the entity using a runtime to create a container MUST be able to use the operations defined in this specification against that same container. Whether other entities using the same, or other, instance of the runtime can see that container is out of scope of this specification. -## State +## State The state of a container MUST include, at least, the following properties: -* **`ociVersion`**: (string) is the OCI specification version used when creating the container. -* **`id`**: (string) is the container's ID. +* **`ociVersion`**: (string) is the OCI specification version used when creating the container. +* **`id`**: (string) is the container's ID. This MUST be unique across all containers on this host. There is no requirement that it be unique across hosts. -* **`status`**: (string) is the runtime state of the container. +* **`status`**: (string) is the runtime state of the container. The value MAY be one of: * `created`: the container has been created but the user-specified code has not yet been executed * `running`: the container has been created and the user-specified code is running * `stopped`: the container has been created and the user-specified code has been executed but is no longer running Additional values MAY be defined by the runtime, however, they MUST be used to represent new runtime states not defined above. -* **`pid`**: (int) is the ID of the container process, as seen by the host. -* **`bundlePath`**: (string) is the absolute path to the container's bundle directory. +* **`pid`**: (int) is the ID of the container process, as seen by the host. +* **`bundlePath`**: (string) is the absolute path to the container's bundle directory. This is provided so that consumers can find the container's configuration and root filesystem on the host. -* **`annotations`**: (map) contains the list of annotations associated with the container. +* **`annotations`**: (map) contains the list of annotations associated with the container. If no annotations were provided then this property MAY either be absent or an empty map. When serialized in JSON, the format MUST adhere to the following pattern: @@ -43,35 +43,35 @@ When serialized in JSON, the format MUST adhere to the following pattern: See [Query State](#query-state) for information on retrieving the state of a container. -## Lifecycle +## Lifecycle The lifecycle describes the timeline of events that happen from when a container is created to when it ceases to exist. -1. OCI compliant runtime's [`create`](runtime.md#create) command is invoked with a reference to the location of the bundle and a unique identifier. -2. The container's runtime environment MUST be created according to the configuration in [`config.json`](config.md). +1. OCI compliant runtime's [`create`](runtime.md#create) command is invoked with a reference to the location of the bundle and a unique identifier. +2. The container's runtime environment MUST be created according to the configuration in [`config.json`](config.md). If the runtime is unable to create the environment specified in the [`config.json`](config.md), it MUST generate an error. While the resources requested in the [`config.json`](config.md) MUST be created, the user-specified code (from [`process`](config.md#process-configuration)) MUST NOT be run at this time. Any updates to [`config.json`](config.md) after this step MUST NOT affect the container. -3. Once the container is created additional actions MAY be performed based on the features the runtime chooses to support. +3. Once the container is created additional actions MAY be performed based on the features the runtime chooses to support. However, some actions might only be available based on the current state of the container (e.g. only available while it is started). -4. Runtime's [`start`](runtime.md#start) command is invoked with the unique identifier of the container. +4. Runtime's [`start`](runtime.md#start) command is invoked with the unique identifier of the container. The runtime MUST run the user-specified code, as specified by [`process`](config.md#process-configuration). -5. The container's process is stopped. +5. The container's process is stopped. This MAY happen due to them erroring out, exiting, crashing or the runtime's [`kill`](runtime.md#kill) operation being invoked. -6. Runtime's [`delete`](runtime.md#delete) command is invoked with the unique identifier of the container. +6. Runtime's [`delete`](runtime.md#delete) command is invoked with the unique identifier of the container. The container MUST be destroyed by undoing the steps performed during create phase (step 2). -## Errors +## Errors In cases where the specified operation generates an error, this specification does not mandate how, or even if, that error is returned or exposed to the user of an implementation. Unless otherwise stated, generating an error MUST leave the state of the environment as if the operation were never attempted - modulo any possible trivial ancillary changes such as logging. -## Operations +## Operations OCI compliant runtimes MUST support the following operations, unless the operation is not supported by the base operating system. Note: these operations are not specifying any command-line APIs, and the parameters are inputs for general operations. -### Query State +### Query State `state ` @@ -79,7 +79,7 @@ This operation MUST generate an error if it is not provided the ID of a containe Attempting to query a container that does not exist MUST generate an error. This operation MUST return the state of a container as specified in the [State](#state) section. -### Create +### Create `create ` @@ -96,7 +96,7 @@ Runtime callers who are interested in pre-create validation can run [bundle-vali Any changes made to the [`config.json`](config.md) file after this operation will not have an effect on the container. -### Start +### Start `start ` This operation MUST generate an error if it is not provided the container ID. @@ -106,7 +106,7 @@ This operation MUST run the user-specified code as specified by [`process`](conf Upon successful completion of this operation the `status` property of this container MUST be `running`. -### Kill +### Kill `kill ` This operation MUST generate an error if it is not provided the container ID. @@ -115,7 +115,7 @@ This operation MUST send the specified signal to the process in the container. When the process in the container is stopped, irrespective of it being as a result of a `kill` operation or any other reason, the `status` property of this container MUST be `stopped`. -### Delete +### Delete `delete ` This operation MUST generate an error if it is not provided the container ID. @@ -126,6 +126,6 @@ Note that resources associated with the container, but not created by this conta Once a container is deleted its ID MAY be used by a subsequent container. -## Hooks +## Hooks Many of the operations specified in this specification have "hooks" that allow for additional actions to be taken before or after each operation. See [runtime configuration for hooks](./config.md#hooks) for more information.