Skip to content

Commit b1aff30

Browse files
committed
*: Replace "user-specified code" with "user-specified program"
In [1], I'd proposed replacing our old "user-specified process" with "user-specified code" to help distinguish between 'create' (cloning the container process) and 'start' (signaling the container process to execve or similar the user-specified $STUFF_FROM_THE_process_CONFIG). That PR was rejected, although the renaming proposed there had already landed via dd0cd21 (Add a 'status' field to our state struct, 2016-05-26, opencontainers#462). This PR attempts to find a common ground between "process" (preferred by maintainers in opencontainers#466 [2,3,4], but which I consider incorrect [5]) and "code" (which maintainers found confusing [3,4,6]). The Linux execve(2) has says "program" and unpacks that to "a binary executable, or a script starting with a [shebang]" [7]. proc(5) documents /proc/[pid]/exe by talking about "the executed command" [8]. The POSIX exec docs call this the "process image" and talk about loading it from the "new process image file" [9]. POSIX formally defines "command" [11], "executable file" [12], and "program" [13]. The only reference to "process image" in the definitions is in the "executable file" entry. The "command" definition is focused on the shell, the "executable file" definition is focused on files, and the "program" definition talks about a "prepared sequence of instructions to the system", so "program" seems like the best fit. [1]: opencontainers#466 Subject: runtime: Replace "user-specified process" with "user-specified code" in 'create' [2]: opencontainers#466 (comment) [3]: opencontainers#466 (comment) [4]: opencontainers#466 (comment) [5]: opencontainers#466 (comment) [6]: opencontainers#466 (comment) [7]: http://man7.org/linux/man-pages/man2/execve.2.html [8]: http://man7.org/linux/man-pages/man5/proc.5.html [9]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html [10]: https://git.kernel.org/cgit/docs/man-pages/man-pages.git/ [11]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_104 [12]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_154 [13]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_306 Signed-off-by: W. Trevor King <[email protected]>
1 parent 7839cbb commit b1aff30

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ Presently there are `Prestart`, `Poststart` and `Poststop`.
321321
* [`Poststart`](#poststart) is a list of hooks to be run immediately after the container process is started
322322
* [`Poststop`](#poststop) is a list of hooks to be run after the container process exits
323323

324-
Hooks allow one to run code before/after various lifecycle events of the container.
324+
Hooks allow one to run programs before/after various lifecycle events of the container.
325325
Hooks MUST be called in the listed order.
326326
The state of the container is passed to the hooks over stdin, so the hooks could get the information they need to do their work.
327327

runtime.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ This MUST be unique across all containers on this host.
1515
There is no requirement that it be unique across hosts.
1616
* **`status`**: (string) is the runtime state of the container.
1717
The value MAY be one of:
18-
* `created`: the container has been created but the user-specified code has not yet been executed
19-
* `running`: the container has been created and the user-specified code is running
20-
* `stopped`: the container has been created and the user-specified code has been executed but is no longer running
18+
* `created`: the container has been created but the user-specified program has not yet been executed
19+
* `running`: the container has been created and the user-specified program is running
20+
* `stopped`: the container has been created and the user-specified program has been executed but is no longer running
2121

2222
Additional values MAY be defined by the runtime, however, they MUST be used to represent new runtime states not defined above.
2323
* **`pid`**: (int) is the ID of the container process, as seen by the host.
@@ -49,12 +49,12 @@ The lifecycle describes the timeline of events that happen from when a container
4949
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.
5050
2. The container's runtime environment MUST be created according to the configuration in [`config.json`](config.md).
5151
If the runtime is unable to create the environment specified in the [`config.json`](config.md), it MUST generate an error.
52-
While the resources requested in the [`config.json`](config.md) MUST be created, the user-specified code (from [`process`](config.md#process)) MUST NOT be run at this time.
52+
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.
5353
Any updates to [`config.json`](config.md) after this step MUST NOT affect the container.
5454
3. Once the container is created additional actions MAY be performed based on the features the runtime chooses to support.
5555
However, some actions might only be available based on the current state of the container (e.g. only available while it is started).
5656
4. Runtime's [`start`](runtime.md#start) command is invoked with the unique identifier of the container.
57-
The runtime MUST run the user-specified code, as specified by [`process`](config.md#process).
57+
The runtime MUST run the user-specified program, as specified by [`process`](config.md#process).
5858
5. The container's process is stopped.
5959
This MAY happen due to them erroring out, exiting, crashing or the runtime's [`kill`](runtime.md#kill) operation being invoked.
6060
6. Runtime's [`delete`](runtime.md#delete) command is invoked with the unique identifier of the container.
@@ -86,7 +86,7 @@ This operation MUST return the state of a container as specified in the [State](
8686
This operation MUST generate an error if it is not provided a path to the bundle and the container ID to associate with the container.
8787
If the ID provided is not unique across all containers within the scope of the runtime, or is not valid in any other way, the implementation MUST generate an error and a new container MUST NOT be created.
8888
Using the data in [`config.json`](config.md), this operation MUST create a new container.
89-
This means that all of the resources associated with the container MUST be created, however, the user-specified code MUST NOT be run at this time.
89+
This means that all of the resources associated with the container MUST be created, however, the user-specified program MUST NOT be run at this time.
9090
If the runtime cannot create the container as specified in [`config.md`](config.md), it MUST generate an error and a new container MUST NOT be created.
9191

9292
Upon successful completion of this operation the `status` property of this container MUST be `created`.
@@ -102,7 +102,7 @@ Any changes made to the [`config.json`](config.md) file after this operation wil
102102
This operation MUST generate an error if it is not provided the container ID.
103103
Attempting to start a container that does not exist MUST generate an error.
104104
Attempting to start an already started container MUST have no effect on the container and MUST generate an error.
105-
This operation MUST run the user-specified code as specified by [`process`](config.md#process).
105+
This operation MUST run the user-specified program as specified by [`process`](config.md#process).
106106

107107
Upon successful completion of this operation the `status` property of this container MUST be `running`.
108108

0 commit comments

Comments
 (0)