Commit Graph

1184 Commits

Author SHA1 Message Date
Tianon Gravi 198f23f827 Merge pull request #876 from justincormack/memory-int64
Make Linux memory allocations int64 not uint64
2017-06-23 16:24:22 -07:00
Justin Cormack e73cd70caa Make Linux memory allocations int64 not uint64
The kernel ABI to these values is a string, which accepts the value `-1`
to mean "unlimited" or an integer up to 2^63 for an amount of memory in
bytes.

While the internal representation in the kernel is unsigned, this is not
exposed in any ABI directly. Because of the user-kernel memory split, values
over 2^63 are not really useful; indeed that much memory is not supported,
as physical memory is limited to 52 bits in the forthcoming switch to five
level page tables. So it is much more natural to support the value `-1` for
unlimited, especially as the actual number needed to represent the maximum
has varied in different kernel versions, and across 32 and 64 bit architectures,
so determining the value to use is not possible, so it is necessary to write
the string `-1` to the cgroup files.

See also discussion in
- https://github.com/opencontainers/runc/pull/1494
- https://github.com/opencontainers/runc/pull/1492
- https://github.com/opencontainers/runc/pull/1375
- https://github.com/opencontainers/runc/issues/1421

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-06-23 15:43:28 -07:00
Michael Crosby c1a98486c4 Merge pull request #875 from mrunalp/create_kill
Allow created containers to be killed
2017-06-23 13:30:13 -07:00
Mrunal Patel b33fb3db88 Allow created containers to be killed and clarify start/delete
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-06-23 13:26:19 -07:00
Michael Crosby 0b38a4ce7f Merge pull request #868 from greenhouse-org/windows-readonly-mount
Add readonly option for mount
2017-06-23 10:52:09 -07:00
Amin Jamali 06971c9e9d Add readonly option for mount
Signed-off-by: Amin Jamali <ajamali@pivotal.io>
Signed-off-by: Mark DeLillo <mdelillo@pivotal.io>
2017-06-22 22:12:30 -04:00
Tianon Gravi fd0b0b6f75 Merge pull request #873 from wking/symlinks-for-devices
config-linux: Explicitly allow symlinks for providing devices
2017-06-21 08:24:50 -07:00
Daniel, Dao Quang Minh 92e028a53b Merge pull request #840 from wking/dry-bundle-hyper-v
bundle: DRYer root.path entry
2017-06-21 16:19:07 +01:00
Michael Crosby 63b7c6c338 Merge pull request #850 from hqhq/simply_platform
Remove platform field
2017-06-16 11:36:30 -07:00
W. Trevor King dbfae1456b bundle: DRYer root.path entry
Instead of repeating the config.md conditions, just make the linkage
more clear.  Now the chain is:

1. Bundles REQUIRE a config.json which is a bundle artifact.
2. If that config.json has a root.path entry (as specified in
   config.md), then add the referenced directory to the set of bundle
   artifacts.  The config.md requirements include "If defined, a
   directory MUST exist at the path declared by the field".
3. Apply the "MUST all be present in a single directory" condition to
   all bundle artifacts.  I don't like that direct-child restriction
   [1], but I'm not touching it in this commit.

So these are the same requirements as before this commit, but with
less redundancy and fewer words.

[1]: https://github.com/opencontainers/runtime-spec/pull/469

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-06-16 09:59:17 -07:00
Qiang Huang af0e225e79 Remove platform field
Close: #725

See discussion in #830 and dev-weekly-meeting discussion
in http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2017/opencontainers.2017-06-14-21.03.log.txt

We don't use this field in runc, and mostly only
image-spec cares about this, we can assume tools know
what specific platform this spec is built for.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-06-16 14:49:00 +08:00
Qiang Huang b5017e22ec Merge pull request #809 from Mashimiao/config-minor-process-changes
config.md: minor changes for process
2017-06-14 22:23:01 +08:00
Qiang Huang 9434694de8 Merge pull request #874 from Mashimiao/config-tfix
config.go: tiny tfix
2017-06-14 22:17:35 +08:00
Ma Shimiao 32f5ac66c9 config.go: tiny tfix
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-06-07 23:16:49 +08:00
W. Trevor King 04187ecbcc config-linux: Explicitly allow symlinks for providing devices
I'd rather address runtime compliance by breaking this down into
explicit checks based on POSIX stat(3) calls.  But with that approach
rejected [1], mentioning symlinks here helps motivate runtime-tools'
choice of os.Stat [2,3] (which follows symlinks) vs. os.Lstat (which
does not [4]).

[1]: https://github.com/opencontainers/runtime-spec/pull/829#issuecomment-305582159
[2]: https://github.com/opencontainers/runtime-tools/blob/f5c82b3918bdfc3ed4b594dcfab4d1554beaf992/cmd/runtimetest/main.go#L319
[3]: https://golang.org/pkg/os/#Stat
[4]: https://golang.org/pkg/os/#Lstat

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-06-06 12:51:04 -07:00
Mrunal Patel e95b4f8ead Merge pull request #871 from wking/linux-devices-may
config-linux: "may" -> "MAY" for supplying linux.devices
2017-06-03 16:44:07 -07:00
Ma Shimiao cbae6d0ebe config.md: minor changes for process
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-06-02 09:47:03 +08:00
W. Trevor King 33c3c019c5 config-linux: "may" -> "MAY" for supplying linux.devices
The way that the runtime supplies these is "truly optional", as long
as they get supplied.

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-06-01 16:09:31 -07:00
Michael Crosby 239c4e44f2 Merge pull request #863 from wking/console-size-if-attached
config: Explicily make consoleSize unspecified if terminal is false or unset
2017-06-01 14:54:06 -07:00
Mrunal Patel 1ff127d28b Merge pull request #852 from wking/cleaner-container-namespace-glossary
glossary: Remove "leaf" and "hierarchy" from container namespace definition
2017-06-01 14:53:06 -07:00
Tianon Gravi ccfcf0bfa3 Merge pull request #854 from jhowardmsft/mount
Mount correction
2017-06-01 14:00:35 -07:00
W. Trevor King ed6c9eff0a config: Explicily make consoleSize unspecified if terminal is false or unset
The old language is from a502caf6 (config: Add consoleSize to process,
2016-09-14, #563), where nobody commented on the "if attached" wording
[1].  But reading the old line now, it's not clear to me what
consoleSize means when terminal is not true.

This commit explicitly declares consoleSize ignored in that condition.
I'd rather have made it unspecified, so runtimes are free to do what
they want short of erroring out, but Michael wanted the more specific
"ignored" [2].  I considered making the property undefined or
requiring it to be unset, but those seemed too strict given our
permissive "MUST ignore unknown properties" extensibility requirement.

[1]: https://github.com/opencontainers/runtime-spec/pull/563
[2]: https://github.com/opencontainers/runtime-spec/pull/863#discussion_r119682760

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-06-01 12:04:04 -07:00
John Howard 96854157d6 Mount correction
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-06-01 11:54:38 -07:00
Mrunal Patel 2719e66a84 Merge pull request #735 from wking/relative-mount-source
config: Clarify mounts[].source relative path anchor
2017-06-01 11:50:37 -07:00
Mrunal Patel be3960a587 Merge pull request #811 from Mashimiao/style-consistent-fix
consistency and style fix
2017-06-01 11:49:53 -07:00
Michael Crosby 0239d877f0 Merge pull request #827 from wking/implicit-link-name-shortcut
config-linux: Use the implicit link name shortcut
2017-06-01 11:40:06 -07:00
Michael Crosby b1ccc597d1 Merge pull request #851 from wking/remove-may-support-any-valid-values
config: Remove "MAY support any valid values" sentence
2017-06-01 10:57:58 -07:00
Mrunal Patel 69380b0a61 Merge pull request #847 from wking/no-should-consider
config: Replace "SHOULD consider" for 'rootfs' path value
2017-06-01 10:57:32 -07:00
W. Trevor King b536f13054 glossary: Remove "leaf" and "hierarchy" from runtime namespace definition
Namespaces are not all hierarchical and processes aren't always in
leaves.  Also punt to config-linux.md for details about namespace
creation, although currently that section doesn't talk much about how
the runtime namespaces relate to new container namespaces [1].

Also mention resource access, because runtime namespaces play a role
even if no new container namespaces are created.  I've used resources
that currently explicitly mention runtime namespaces as examples,
although I think more resources (e.g. root.path and mounts[].source
[2,3]) deserve wording about that as well and would be better examples
if they'd already landed such wording.

Examples of resources retrieved from this namespace include
linux.namespaces[].path and the resctrl psuedo-filesystem used for
`linux.intelRdt`, but Mrunal and Michael didn't want me to include the
examples in the glossary entry (probably because they could go stale).

[1]: https://github.com/opencontainers/runtime-spec/pull/795#issuecomment-303768518
[2]: https://github.com/opencontainers/runtime-spec/pull/735#issuecomment-301198710
[3]: https://github.com/opencontainers/runtime-spec/commit/604205e5e1b58854c43e07901d3ec241df31df4e#diff-c9c91c29b41257aea3a3403cc606ad99R65

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-06-01 10:56:14 -07:00
W. Trevor King 76c740e906 config: Remove "MAY support any valid values" sentence
This line landed in 718f9f3 (origin/pr/673) minor narrative cleanup
regarding config compatibility, 2017-01-30, #673), but I'm not clear
on the motivation.  The wording reads to me like "you don't have to
support valid values for platform-specific fields if you don't want
to", but we already cover unsupported value handling with the "MUST
generate an error when invalid or unsupported values are encountered"
language separated out in c763e641 (config: Move valid-value rules to
their own section, 2017-02-07, #681).  This commit removes the
ambiguous line.

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-06-01 10:55:21 -07:00
Michael Crosby a9bdd59c89 Merge pull request #858 from wking/tk/bump-posix-spec
config: Bump POSIX spec references to IEEE Std 1003.1-2008, 2016 Edition
2017-06-01 10:49:26 -07:00
Michael Crosby c8fec52117 Merge pull request #860 from wking/remove-redundant-blkio
config-linux: Drop redundant 'blkio' prefix from blockIO properties
2017-06-01 10:48:18 -07:00
Michael Crosby 10b5414851 Merge pull request #862 from wking/redundant-unique-key
config: Drop redundant "unique within this map" annotation requirement
2017-06-01 10:45:35 -07:00
Michael Crosby 358f49e332 Merge pull request #870 from wking/no-hooks-on-windows
config: Require hook support on Linux and Solaris
2017-06-01 10:36:22 -07:00
Ma Shimiao b92cf90a59 consistency and style fix
replace file sytem with filesystem for consistent in context
keep one sentence per line

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-06-02 00:29:56 +08:00
W. Trevor King eba7304384 config: Drop redundant "unique within this map" annotation requirement
This condition landed in 27a05de3 (Add text about extensions,
2016-06-26, #510) with subsequent wording tweaks in 3f0440b4
(config.md: add empty limit for key of annotations, Dec 28 10:35:19
2016, #645) and 2c8feeb3 (config: Bring "unique... within this map"
back together, 2017-01-12, #654).  However, since eeaccfab (glossary:
Make objects explicitly unordered and forbid duplicate names,
2016-09-27, #584) we forbid duplicate keys on *all* objects (not just
annotations), so this PR removes the redundant annotation-specific
condition.

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-06-01 08:34:05 -07:00
W. Trevor King d8ca338a30 config-linux: Drop redundant 'blkio' prefix from blockIO properties
These are long enough without the prefix, and
linux.resources.blockIO.blkioWeight, etc. are just as specific as
linux.resources.blockIO.weight.

Generated with:

  $ sed -i s/blkioWeight/weight/g $(git grep -l blkioWeight)
  $ sed -i s/blkioLeaf/leaf/g $(git grep -l blkioLeaf)
  $ sed -i s/blkioThrottle/throttle/g $(git grep -l blkioThrottle)

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-06-01 08:23:08 -07:00
W. Trevor King 3fb7d4b8bb config: Bump POSIX spec references to IEEE Std 1003.1-2008, 2016 Edition
These references had been using IEEE Std 1003.1, 2004 Edition, but:

  $ curl -s http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html | grep -B2 'newer edition'
  <center><font size="2">The Open Group Base Specifications Issue 6<br>
  IEEE Std 1003.1, 2004 Edition<br>
  Copyright &copy; 2001-2004 The IEEE and The Open Group, All Rights reserved.</font></center><center><font color="red">A newer edition of this document exists <a href="http://pubs.opengroup.org/onlinepubs/9699919799/" target="_parent">here</a></font></center>

Shifting to 2016 also syncs us with the 'file' reference in
config-linux.md.  The initial reasoning for the 2004 edition is
unclear to me (more on that in 70858bc4, config: Adjust process.args
to cite POSIX's execvp, 2016-05-19, #427),

The change-log for the exec page [1] doesn't list any relevant
changes, and skimming a diff of the two HTML pages didn't turn up
anything significant.

Diffing the two HTML pages for environment variables also turned up no
significant changes.  Both definition reference the Portable Character
Set for uppercase letters, digits, and underscore, but the U####
values for those have not changed [2,3].

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html#tag_16_111_14
[2]: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap06.html#tag_06_01
[3]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap06.html#tag_06_01

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-06-01 08:21:35 -07:00
W. Trevor King 7de3cb814d config: Replace "SHOULD consider" for 'rootfs' path value
SHOULD means that [1]:

  ... there may exist valid reasons in particular circumstances to
  ignore a particular item, but the full implications must be
  understood and carefully weighed before choosing a different course.

So consideration is already baked into the definition, and we can just
say "SHOULD be" and warn folks whenever they use a value other than
'rootfs'.

Also move this under the non-Windows conditions, because the advice
they doesn't apply to Windows where the value MUST be a volume GUID
path (since 2283e63, Windows: Remove Sandbox, additional tweaks,
2017-05-23, #849).

[1]: https://tools.ietf.org/html/rfc2119#section-3

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-06-01 08:17:32 -07:00
W. Trevor King 50e13d9249 config: Clarify mounts[].source relative path anchor
Borrowing language from root.path for absolute/relative.

I think we also need to talk about 'mounts' being in the container
mount namespace (after creating it with the runtime mount namespace as
a seed) and before the pivot into root.path.  But Michael and/or
Mrunal are going to file follow-up work to address that.

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-06-01 08:01:27 -07:00
Tianon Gravi f79b61d6e8 Merge pull request #846 from Mashimiao/format-specs
format specs with 4 spaces indent
2017-06-01 07:56:54 -07:00
Ma Shimiao 01c0762d0b replace must with MUST
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-06-01 10:08:17 +08:00
Ma Shimiao 137b9c3750 format specs with 4 spaces indent
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-06-01 10:08:17 +08:00
W. Trevor King 1a6cb18db1 config: Require hook support on Linux and Solaris
Clarifying the language from 28e8f68 (Hooks to linux,solaris and doc
clarification, 2017-05-24, #855), which did not say which platforms
support hooks and which don't.  Without something like this commit,
there's no clear way for config authors to know if their runtime will
support hooks or not, and there was previous agreement that that sort
of ambiguity was not helpful [1].  This also gives normative Markdown
grounding for the Go platform tag added in 28e8f68.

[1]: https://github.com/opencontainers/runtime-spec/pull/472#r78088802

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-31 16:00:33 -07:00
W. Trevor King 0bdeae6cdc config: Remove incorrect "after the container namespaces are created"
Not all hooks are run after creation.  In fact, there are currently no
postcreate hooks (prestart hooks are called "after the start operation
is called but before the user-specified program command is executed".

Fixing 28e8f68 (Hooks to linux,solaris and doc clarification,
2017-05-24, #855), which pulled the broken line in from a Go comment
[1].

[1]: https://github.com/opencontainers/runtime-spec/pull/855#discussion_r118341546

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-31 15:49:12 -07:00
Tianon Gravi ec44a7e38b Merge pull request #855 from jhowardmsft/hooks
Hooks to linux,solaris and doc clarification
2017-05-31 15:44:07 -07:00
v1.0.0.batts 09404adbac Merge pull request #859 from jhowardmsft/camelCase
Windows: Fix camelCase inconsistencies
2017-05-31 17:56:22 -04:00
Mrunal Patel e9c40d54fd Merge pull request #865 from epilatow/fix-doc-links
fix docs.oracle.com links #864
2017-05-31 14:52:43 -07:00
Tianon Gravi aaa24815e0 Merge pull request #828 from greenhouse-org/windows-layer-paths
Add LayerFolders to Windows platform config
2017-05-30 16:10:34 -07:00
Edward Pilatowicz 76ada33590 Fix docs.oracle.com links #864
Signed-off-by: Edward Pilatowicz <edward.pilatowicz@oracle.com>
2017-05-26 16:20:53 -07:00