Commit Graph

59 Commits

Author SHA1 Message Date
W. Trevor King 5ed105996e runtime: Fix config.md -> config.json typo
From 766abd6f (runtime.md: Require 'create' to fail if config.json
asks for the impossible, 2016-09-08, #559).

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-12-07 10:02:58 -08:00
W. Trevor King c45ffb4ce7 *: 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 dd0cd210 (Add a 'status' field to our state struct,
2016-05-26, #462).

This PR attempts to find a common ground between "process" (preferred
by maintainers in #466 [2,3,4], but which I consider incorrect [5])
and "code" (which maintainers found confusing [3,4,6]).  The Linux
execve(2) 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" (although they also sprinkle in a
number of “program” references, apparently interchangeably with
“process image”) [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]: https://github.com/opencontainers/runtime-spec/pull/466
     Subject: runtime: Replace "user-specified process" with "user-specified code" in 'create'
[2]: https://github.com/opencontainers/runtime-spec/pull/466#r64982402
[3]: https://github.com/opencontainers/runtime-spec/pull/466#issuecomment-223132793
[4]: https://github.com/opencontainers/runtime-spec/pull/466#issuecomment-258563220
[5]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_295
[6]: https://github.com/opencontainers/runtime-spec/pull/466#r64982165
[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 <wking@tremily.us>
2016-11-18 03:42:10 -08:00
W. Trevor King bf9694db6e config: Change "Process configuration" -> "Process" header
All of these sections are about configuration, and we don't usually
use "{Whatever} configuration" in the headers.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-11-10 20:43:51 -08:00
Qiang Huang 661314a926 Fix several format issues found by pdf and html
This carries #578 and fixes some other format issues.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-11-03 09:33:51 +08:00
Lei Jitang a83c0965b2 typo: fix missing `)`
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-10-28 03:41:44 -04:00
Michael Crosby 1e7faf0c4c Merge pull request #596 from WeiZhang555/add-related-links
Add some related docs links
2016-10-25 09:11:38 -07:00
Zhang Wei 98f0bdfe70 Add some related docs links
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-10-25 20:52:31 +08:00
Zhang Wei 932fba6802 Fix typo
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-10-25 16:59:26 +08:00
W. Trevor King 766abd6f54 runtime.md: Require 'create' to fail if config.json asks for the impossible
We don't want to silently ignore settings that we understand but
cannot implement [1] (we *do* want to ignore settings that we don't
understand [2], but that's a separate issue).

This raises a slightly sticky certification issue.  If a runtime
*always* exits 'create' with an error:

  func create() err {
    return fmt.Errorf("nope, I cannot create that container either.")
  }

it would be neither complaint nor non-compliant.  It would not fail
any MUSTs, but availing itself of the "cannot create the maintainer"
option specified in this commit would mean the test suite could not
test the deeper requirements around the config properties themselves.

So with this change, making Microsoft certifiable will still need an
explicit weakening around root.path.  The easiest way to do that might
be to have separate annotations for whether a setting is optional for
config authors and whether it's optional for runtime authors
(supported):

  * **`readonly`** (bool, config:optional, support:optional) ...

But I'll leave hashing that out to a later commit.  Regardless of the
certification impact, we want to be clear that silently ignoring known
parameters is wrong.

[1]: 9b8e21826c (r65400731)
     Subject: [ Config | Root Config ] Clarify readonly
[2]: https://github.com/opencontainers/runtime-spec/pull/510
     Subject: Add text about extensions

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-09-16 08:08:05 -07:00
W. Trevor King a2d07dcfda Replace " : " with ": "
There's an outside change that these are intentional, since I pointed
one of these out earlier [1] and it wasn't fixed.  But I haven't seen
" : " used intentionally outside of this project, and don't think we
want to break ground in that direction ;).

[1]: https://github.com/opencontainers/runtime-spec/pull/510#discussion_r77291554

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-09-06 22:21:33 -07:00
W. Trevor King 9500be8470 Replace "container's main process" with "container process"
We use both forms, but the latter was more popular.  Before this
branch:

  $ git grep -i 'container process' origin/master | wc -l
  13
  $ git grep -i 'main process' origin/master | wc -l
  4

Also fix "process id" -> "process ID" in one of the lines I touched,
to match fork(2) [1].

[1]: http://man7.org/linux/man-pages/man2/fork.2.html

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-08-03 00:10:52 -07:00
Graham Whaley 7795661d84 runtime.md: Fix sub-bullet indentation
The indentation of the sub bullets for the status entries under State were not
indented by the 4 spaces required by markdown. They did not render well in
the pdf, at least with my native build with pandoc v1.13.2. Change them to 4
spaces, which now renders well.

Signed-off-by: Graham Whaley <graham.whaley@linux.intel.com>
2016-06-08 19:05:08 +01:00
Vincent Batts 831d961964 Merge pull request #397 from cyphar/add-cgroup-namespace
*: add support for cgroup namespace
2016-06-03 13:45:27 -04:00
Mrunal Patel 34901c10b3 Merge pull request #484 from duglin/ShowAnnot
Add annotations to the state json
2016-06-03 10:43:59 -07:00
Aleksa Sarai d514aad1bc runtime: lifecycle: environment must match config.json
Make it clear that if a runtime cannot set up an environment that
*precisely* matches the config.json provided, it must generate an error.
This is important because not doing this can cause security issues.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-06-04 00:14:39 +10:00
Qiang Huang fddb3e5527 Merge pull request #468 from wking/start-does-not-confirm-success
runtime: Remove start's "fails to run" monitoring
2016-06-03 10:20:05 +08:00
Doug Davis 9cb0c7fa6c Add annotations to the state json
Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-06-02 13:31:09 -07:00
Doug Davis dd0cd2102b Add a 'status' field to our state struct
Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-05-31 10:42:05 -07:00
W. Trevor King 7b28a16f7a runtime: Consistent indent for "However, some actions..."
The shorter-than-normal (for the rest of this list) indent landed with
the line in be594153 (Split create and start, 2016-04-01, #384).

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-05-31 10:25:48 -07:00
W. Trevor King 78d37e9ddf runtime: Restore leading blank line before lifecycle list
Restore the line removed by be594153 (Split create and start,
2016-04-01, #384).  Without this, GitHub renders the list as a single
paragraph.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-05-28 13:06:21 -07:00
W. Trevor King 9b47c1241c runtime: Remove start's "fails to run" monitoring
The in-flight runC implementation just fires a signal at the container
[1,2].  It doesn't wait around to see if the signal has an effect, or if
it causes the container to crash, etc., etc.

[1]: 28126f8039/start.go (L29-L30)
[2]: 28126f8039/libcontainer/container_linux.go (L253-L258)

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-05-26 23:13:25 -07:00
W. Trevor King 05a548f135 runtime: Drop create-specific API caveat from lifecycle
This wording is descended from 7117ede7 (Expand on the definition of
our ops, 2015-10-13, #225), but the idea is covered generically by
e53a72b (Clarify the operation is not for command-line api,
2016-05-24, #450), so we no longer need a create-specific note.
Especially in the lifecycle docs, where there's already enough going
on without this low-level detail.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-05-26 22:37:50 -07:00
Doug Davis be594153b5 Split create and start
Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-05-26 16:52:18 -07:00
Mrunal Patel 32601fbb80 Merge pull request #446 from hqhq/hq_remove_MUST_JSON
Remove one JSON related MUST requirement
2016-05-26 08:06:06 -07:00
Qiang Huang e53a72b7c9 Clarify the operation is not for command-line api
Replace: https://github.com/opencontainers/runtime-spec/pull/447

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-05-24 15:12:36 +08:00
Qiang Huang 95f106ed9d Remove one JSON related MUST requirement
JSON is not a mandatory format, we should not use MUST
requirement on this.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-05-23 16:13:53 +08:00
Qiang Huang 6d879c81d5 Move errors section out of operations
The `Errors` section is more like a general description about
runtime, if it's a sub-section of `Operations`, it'll be hard
for both implementations and tests to define what this
`errors` operation really is.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-05-23 15:48:20 +08:00
Michael Crosby 4436094090 Merge pull request #418 from wking/optional-start-validation
runtime: Explicitly allow 'start' to not validate config.json
2016-05-18 10:30:56 -07:00
W. Trevor King d7b5e15566 runtime: Explicitly allow 'start' to not validate config.json
This spec places RFC-2119 requirements on both bundles (bundle.md,
config.md, ...)  and runtimes (runtime.md, runtime-linux.md).  While
it's possible to envision a system where bundle validation is required
before container setup begins, it is also possible to decoupled
validation and allow the runtime to blindly stumble through as far as
it can.

We already link to ocitools and OCT for testing both runtimes and
bundles [1], so users interested in pre-start validation can use those
tools.

This commit explicitly documents the non-requirement and links to
those tools, to make life less surprising for everybody.

[1]: https://github.com/opencontainers/runtime-spec/blob/v0.5.0/implementations.md#testing--tools

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-05-02 11:58:31 -07:00
W. Trevor King 0382257baf runtime: Fix 'step 8' -> 'step 7' references
This slipped through the renumbering in 7117ede7 (Expand on the
definition of our ops, 2015-10-13, #225).

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-05-02 11:40:48 -07:00
Rob Dolin (MSFT) 9630bf7acb [ Lifecycle ] Increase importance of logging errors (#410)
"errors, if any, MAY be logged" --> "errors, if any, SHOULD be logged"

Signed-off-by: Rob Dolin <RobDolin@microsoft.com>
2016-05-02 14:09:25 -04:00
Rob Dolin (MSFT) 063eb099ac [ Runtime | State] Fix typo
propeties --> properties

Signed-off-by: Rob Dolin <RobDolin@microsoft.com>
2016-04-26 17:49:31 -07:00
Vishnu kannan a7a366b334 Remove exec from required runtime functionalities.
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-04-19 15:27:23 -07:00
Vincent Batts 547e00b42e *.md: normalize the "example" anchors
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-04-08 10:01:45 -04:00
Giuseppe Scrivano f4950a17c2 specs: fix typo
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2016-03-21 11:33:43 +01:00
Doug Davis 7117ede74b Expand on the definition of our ops
Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-02-22 06:43:28 -08:00
W. Trevor King cb2da5430a config: Single, unified config file
Reverting 7232e4b1 (specs: introduce the concept of a runtime.json,
2015-07-30, #88) after discussion on the mailing list [1].  The main
reason is that it's hard to draw a clear line around "inherently
runtime-specific" or "non-portable", so we shouldn't try to do that in
the spec.  Folks who want to flag settings as non-portable for their
own system are welcome to do so (e.g. "we will clobber 'hooks' in
bundles we run") are welcome to do so, but we don't have to have
to split the config into multiple files to do that.

There have been a number of additional changes since #88, so this
isn't a pure Git reversion.  Besides copy-pasting and the associated
link-target updates, I've:

* Restored path -> destination, now that the mount type contains both
  source and target paths again.  I'd prefer 'target' to 'destination'
  to match mount(2), but the pre-7232e4b1 phrasing was 'destination'
  (possibly due to Windows using 'target' for the source?).

* Restored the Windows mount example to its pre-7232e4b1 content.

* Removed required mounts from the config example (requirements landed
  in 3848a238, config-linux: specify the default devices/filesystems
  available, 2015-09-09, #164), because specifying those mounts in the
  config is now redundant.

* Used headers (vs. bold paragraphs) to set off mount examples so we
  get link anchors in the rendered Markdown.

* Replaced references to runtime.json with references to config.json.

[1]: https://groups.google.com/a/opencontainers.org/forum/#!topic/dev/0QbyJDM9fWY
     Subject: Single, unified config file (i.e. rolling back specs#88)
     Date: Wed, 4 Nov 2015 09:53:20 -0800
     Message-ID: <20151104175320.GC24652@odin.tremily.us>

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-01-27 09:51:54 -08:00
W. Trevor King 0a55d5ca5a lifecycle: Mention runtime.json
As discussed earlier [1,2].  I'm in favor of rolling it back into
config.json [3], but we aren't there yet [4].

[1]: https://github.com/opencontainers/specs/pull/231#discussion_r43262848
[2]: https://github.com/opencontainers/specs/pull/231/files#r46735828
[3]: https://groups.google.com/a/opencontainers.org/forum/#!topic/dev/0QbyJDM9fWY
     Subject: Single, unified config file (i.e. rolling back specs#88)
     Date: Wed, 4 Nov 2015 09:53:20 -0800
     Message-ID: <20151104175320.GC24652@odin.tremily.us>
[4]: 4a63e81a80/bundle.md (container-format)

Signed-off-by: W. Trevor King <wking@tremily.us>
2015-12-16 09:41:45 -08:00
W. Trevor King f89cb852ae lifecycle: Don't require /run/opencontainer/<runtime>/containers
We already require it for Linux/Unix-based systems [1], so we don't
have to repeat it here.  And other systems will use different paths,
which we haven't specified yet.  When I asked why we didn't specify a
path for Windows [2], Vincent said we were waiting on help from PoC
implementations [3].  So this commit punts the location to the "State"
section, and lets the "Lifecycle" section just focus on when the
write-to-filesystem happens.

There's also discussion about removing the filesystem state registry
completely [4], in which case we'd want to remove the whole line from
the lifecycle.

[1]: 7713efc1be (diff-b84a8d65d8ed53f4794cd2db7e8ea731L7)
[2]: https://github.com/opencontainers/specs/pull/211#discussion_r41066673
[3]: https://github.com/opencontainers/specs/pull/211#discussion_r41067134
[4]: https://groups.google.com/a/opencontainers.org/forum/#!topic/dev/q6TYqVZOcX8
     Subject: removal of /run/opencontainer/containers
     Date: Wed, 25 Nov 2015 14:29:35 +0000
     Message-ID: <CAD2oYtNipt3i_C6=J4Bc-jwauo5YAvKXUqTROnPNP3vZ9+C5Vw@mail.gmail.com>

Signed-off-by: W. Trevor King <wking@tremily.us>
2015-12-14 10:46:21 -08:00
Vincent Batts 82cfe56140 Merge pull request #231 from mrunalp/lifecycle
Add lifecycle for containers
2015-12-09 13:03:29 -05:00
Mrunal Patel 4a63e81a80 Merge pull request #144 from wking/state-version-example
runtime: Add 'version' to the state.json example
2015-12-04 13:12:12 -08:00
Mrunal Patel 7713efc1be Add lifecycle for containers
The lifecycle described is generic and should apply all platforms.
It provides leeway for the runtimes to be flexible in how they
implement it.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-12-04 15:52:39 -05:00
nponeccop c19a920a9c Example lists "root' but text mentions "bundlePath"
Signed-off-by: Andrii Melnykov <andy.melnikov@gmail.com>
2015-12-02 11:33:41 +02:00
W. Trevor King 889f775dcf runtime: Add 'version' to the state.json example
The version field was added while 180df9d (Add runtime state
configuration and structs, 2015-07-29, #87) was in-flight [1], and it
missed getting documented in the example.

[1]: https://github.com/opencontainers/specs/pull/87#issuecomment-135117343

Signed-off-by: W. Trevor King <wking@tremily.us>
2015-12-01 14:54:45 -08:00
Doug Davis 44d9ba6a5e Add some clarity around the state.json file
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-10-05 10:28:54 -07:00
Michael Crosby 34def3a09c Rename State's Root to Bundle
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-09-29 12:09:32 -07:00
Lai Jiangshan 26d39ae967 convert **name** to **`name`**
we have both styles in the *.md, we should use only one of the styles.
**`name`** is much prettier than **name** in the result,
so we use **`name`**

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
2015-09-29 22:19:26 +08:00
Vincent Batts 2d3065b335 hooks: deduplicate the hooks docs
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2015-09-25 11:50:22 -04:00
梁辰晔 (Liang Chenye) 8efcfad4b1 Update runtime.md
Add an explicit explanation of the hooks order.
 
Signed-off-by: Liang Chenye <liangchenye@huawei.com>
2015-09-10 14:24:28 +08:00
Vincent Batts 6cab2747d9 *.md: markdown formatting
Closes https://github.com/opencontainers/specs/issues/83

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2015-09-09 10:17:06 -04:00