Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ The value MAY be one of:

* `creating`: the container is being created (step 2 in the [lifecycle](#lifecycle))
* `created`: the runtime has finished the [create operation](#create) (after step 2 in the [lifecycle](#lifecycle)), and the container process has neither exited nor executed the user-specified program
* `running`: the container process has executed the user-specified program but has not exited (after step 4 in the [lifecycle](#lifecycle))
* `stopped`: the container process has exited (step 5 in the [lifecycle](#lifecycle))
* `running`: the container process has executed the user-specified program but has not exited (after step 5 in the [lifecycle](#lifecycle))
* `stopped`: the container process has exited (step 7 in the [lifecycle](#lifecycle))

Additional values MAY be defined by the runtime, however, they MUST be used to represent new runtime states not defined above.
* **`pid`** (int, REQUIRED when `status` is `created` or `running`) is the ID of the container process, as seen by the host.
Expand Down Expand Up @@ -55,19 +55,17 @@ The lifecycle describes the timeline of events that happen from when a container
If the runtime is unable to create the environment specified in the [`config.json`](config.md), it MUST [generate an error](#errors).
While the resources requested in the [`config.json`](config.md) MUST be created, the user-specified program (from [`process`](config.md#process)) 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.
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.
5. The [prestart hooks](config.md#prestart) MUST be invoked by the runtime.
If any prestart hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 10.
6. The runtime MUST run the user-specified program, as specified by [`process`](config.md#process).
7. The [poststart hooks](config.md#poststart) MUST be invoked by the runtime.
3. Runtime's [`start`](runtime.md#start) command is invoked with the unique identifier of the container.
4. The [prestart hooks](config.md#prestart) MUST be invoked by the runtime.
If any prestart hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step 9.
5. The runtime MUST run the user-specified program, as specified by [`process`](config.md#process).
6. The [poststart hooks](config.md#poststart) MUST be invoked by the runtime.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the removal of the old step 3, the rest of this hunk is just renumbering. Shown more clearly on the command line:

$ git show --word-diff origin/pr/732
…
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.
[-5.-]{+4.+} The [prestart hooks](config.md#prestart) MUST be invoked by the runtime.
   If any prestart hook fails, the runtime MUST [generate an error](#errors), stop the container, and continue the lifecycle at step [-10.-]
[-6.-]{+9.+}
{+5.+} The runtime MUST run the user-specified program, as specified by [`process`](config.md#process).
[-7.-]{+6.+} The [poststart hooks](config.md#poststart) MUST be invoked by the runtime.
   If any poststart hook fails, the runtime MUST [log a warning](#warnings), but the remaining hooks and lifecycle continue as if the hook had succeeded.
[-8.-]{+7.+} The container process exits.
   This MAY happen due to erroring out, exiting, crashing or the runtime's [`kill`](runtime.md#kill) operation being invoked.
[-9.-]{+8.+} Runtime's [`delete`](runtime.md#delete) command is invoked with the unique identifier of the container.
[-10.-]{+9.+} The container MUST be destroyed by undoing the steps performed during create phase (step 2).
[-11.-]{+10.+} The [poststop hooks](config.md#poststop) MUST be invoked by the runtime.
    If any poststop hook fails, the runtime MUST [log a warning](#warnings), but the remaining hooks and lifecycle continue as if the hook had succeeded.
…

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO GitHub's "rendered" version makes it even more clear:

image

If any poststart hook fails, the runtime MUST [log a warning](#warnings), but the remaining hooks and lifecycle continue as if the hook had succeeded.
8. The container process exits.
7. The container process exits.
This MAY happen due to erroring out, exiting, crashing or the runtime's [`kill`](runtime.md#kill) operation being invoked.
9. Runtime's [`delete`](runtime.md#delete) command is invoked with the unique identifier of the container.
10. The container MUST be destroyed by undoing the steps performed during create phase (step 2).
11. The [poststop hooks](config.md#poststop) MUST be invoked by the runtime.
8. Runtime's [`delete`](runtime.md#delete) command is invoked with the unique identifier of the container.
9. The container MUST be destroyed by undoing the steps performed during create phase (step 2).
10. The [poststop hooks](config.md#poststop) MUST be invoked by the runtime.
If any poststop hook fails, the runtime MUST [log a warning](#warnings), but the remaining hooks and lifecycle continue as if the hook had succeeded.

## <a name="runtimeErrors" />Errors
Expand Down