Commit Graph

103 Commits

Author SHA1 Message Date
Michael Crosby 18f4f18955 Merge pull request #751 from hqhq/use_MUST_for_weight
Use MUST and MAY for weight and leafWeight
2017-04-03 14:18:18 -07:00
Qiang Huang 018c5f20b0 Use MUST and MAY for weight and leafWeight
Carry: #728

Signed-off-by: Rob Dolin <robdolin@microsoft.com>
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-03-30 13:01:38 +08:00
W. Trevor King ff207496ab *: Replace "array" type with "array of objects"
We have a few different element types in our arrays, so it's useful to
clarify the element type for the property being specified.  Before
this commit:

  $ sed -n 's|.*\*\*`\([^`]*\)`\*\*[^(]*(\([^,]*\),.*|\2|p' *.md | sort | uniq -c | grep array
        7 array
        1 array of ints
        8 array of objects
       13 array of strings

All of the bare 'array' instances turned out to be arrays of objects.

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-03-29 11:17:32 -07:00
Mrunal Patel 71366eecb5 Merge pull request #741 from q384566678/fix-info
config-linux.md: fix info
2017-03-28 16:30:59 -07:00
Michael Crosby 3adac26772 Merge pull request #706 from q384566678/fix-seecomp
config-linux.md: fix seccomp
2017-03-27 10:24:44 -07:00
zhouhao 8c12f6038c config-linux.md: fix info
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-03-24 14:02:02 +08:00
zhouhao 3ca5c6c58e config-linux.md: fix seccomp
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-03-20 13:32:30 +08:00
Vincent Batts 55e1a84c1f Merge pull request #720 from Mashimiao/config-linux-fix-namespace-path
config-linux.md: clearly require absolute path for namespace
2017-03-10 18:06:17 -05:00
Mrunal Patel 76159da8ca Merge pull request #630 from xiaochenshen/rdt-cat-resctrl-cgroup-v1
specs-go/config: add Intel RDT/CAT Linux support
2017-03-10 09:41:16 -08:00
Xiaochen Shen 73a6002bf3 specs-go/config: add Intel RDT/CAT Linux support
Add support for Intel Resource Director Technology (RDT) / Cache Allocation
Technology (CAT). Add L3 cache resource constraints in Linux-specific
configuration.

This is the prerequisite of this runc proposal:
https://github.com/opencontainers/runc/issues/433

For more information about Intel RDT/CAT, please refer to:
https://github.com/opencontainers/runc/issues/433

Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
2017-03-10 17:29:08 +08:00
Ma Shimiao 72cbff6786 config-linux.md: clearly require absolute path for namespace
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-03-10 12:00:16 +08:00
zhouhao 90427c9345 remove comment
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-03-10 09:19:28 +08:00
Jesse Butler f9dc90b05a make link usage consistent across the specification
Signed-off-by: Jesse Butler <jesse.butler@oracle.com>
2017-03-03 14:43:09 -05:00
Mrunal Patel f47e43c643 Merge pull request #705 from q384566678/test-seecomp
Add new architectures from libseccomp 2.3.2
2017-03-03 11:36:27 -08:00
Mrunal Patel d01ef9a806 Add anchors to config and config linux
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-03-02 11:00:31 -08:00
zhouhao 513ab686e9 Add new architectures from libseccomp 2.3.2
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-03-02 14:33:06 +08:00
Qiang Huang ec9449187b Set specs value the same as kernel API input
This partially revert #648 , after a second thought, I think we
should use specs value the same as kernel API input, see:
https://github.com/opencontainers/runtime-spec/issues/692#issuecomment-281889852

For memory and hugetlb limits *.limit_in_bytes, cgroup APIs take the values
as string, but the parsed values are unsigned long, see:
https://github.com/torvalds/linux/blob/v4.10/mm/page_counter.c#L175-L193

For `cpu.cfs_quota_us` and `cpu.rt_runtime_us`, cgroup APIs take the input
value as signed long long, while `cpu.cfs_period_us` and `cpu.rt_periof_us`
take the input value as unsigned long long.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-03-01 09:10:43 +08:00
zhouhao 5a470213e7 config-linux.md: fix info
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-02-27 16:07:52 +08:00
Mrunal Patel ae7a541930 Merge pull request #657 from GrantSeltzer/improve-seccomp-spec
config: Improve seccomp format to be more expressive
2017-02-24 18:59:49 -08:00
grantseltzer 652323cd77 improve seccomp format to be more expressive
Signed-off-by: grantseltzer <grantseltzer@gmail.com>
2017-02-22 18:17:16 -05:00
Qiang Huang a5c4e91dae Remove uid/gid mapping limit depend on kernel
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-02-22 14:43:18 -08:00
Daniel Dao 279c3c095c
linux: relax filesystem requirements for container
change MUST to SHOULD so containers are not required to have all these
filesystems mounted.

Signed-off-by: Daniel Dao <dqminh89@gmail.com>
2017-01-23 12:44:36 +00:00
Rob Dolin (MSFT) 646826658d [Config Linux] Clarify: App --> Container
Replaces #577

Signed-off-by: Rob Dolin (MSFT) <robdolin@microsoft.com>
2017-01-18 10:29:13 -08:00
Mrunal Patel c0206be451 Merge pull request #647 from Mashimiao/config-linux-fix-device-path
config-linux: Add restriction for duplicated device path
2017-01-12 09:57:11 -08:00
Ma Shimiao 1fc1464dbc config-linux: Add restriction for duplicated device path
I think runtime should generate an error, if devices has
duplicated device path.
Because we don't know which one is really needed.

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-01-12 14:24:52 +08:00
W. Trevor King d43fc428aa config-linux: Lift no-tweaking namespace restriction
This restriction originally landed via 02b456e9 (Clarify behavior
around namespaces paths, 2015-09-08, #158).  The hostname case landed
via 66a0543e (config: Require a new UTS namespace for config.json's
hostname, 2015-10-05, #214) citing the namespace restriction.  The
restriciton extended to runtime namespaces in 01c2d55f (config-linux:
Extend no-tweak requirement to runtime namespaces, 2016-08-24, #538).
There was a proposal in-flight to get config-wide consistency around
the no-tweaking concept [1].

In today's meeting, the maintainer consensus was to strike the
no-tweaking restriction [2], which is what I've done here.  I've
removed the ROADMAP entry because this gives folks a way to adjust
existing containers (launch a new container which joins and tweaks the
original).

The hostname entry still mentions the UTS namespace to provide a guard
against accidental foot-gunning.  There was no no-tweaking language
for properties related to other namespaces (e.g. 'mounts').
Maybe the other namespaces have more obvious names.

[1]: https://github.com/opencontainers/runtime-spec/pull/540
[2]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2017/opencontainers.2017-01-11-22.04.log.html#l-117

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-01-11 15:16:54 -08:00
Qiang Huang 082e93a2bd Allow negative value for some resource fields
Carry #499

For these values, cgroup kernal APIs accept -1 to set
them as unlimited, as docker and runc all support
update resources, we should not set drawbacks in spec.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-01-05 19:03:57 +08:00
Doug Davis e7be40f0c3 Cleanup the spec a bit to remove WG/git text that's not really part of the spec
renamed an href to "container-namespace2" to avoid a dup-warning msg from
the PDF generator

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-11-16 09:50:03 -08:00
Rob Dolin (MSFT) 675a67dc17 [Config Linux] Consistent size values in example
Matches the example in config.md

Signed-off-by: Rob Dolin <robdolin@microsoft.com>
2016-11-08 13:44:16 -08:00
Daniel, Dao Quang Minh f815650e67 Merge pull request #608 from hqhq/fix_format_issues
Fix several format issues found by pdf and html
2016-11-08 02:21:10 +00:00
Qiang Huang 0df2586f03 Merge pull request #518 from mrunalp/terminal
Clarify wording for terminal setting and /dev/console
2016-11-07 09:49:28 +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
Qiang Huang b8e2ebec5f Merge pull request #597 from WeiZhang555/fix-duplicated-namespaces
Forbid duplicated namespaces with same `type`.
2016-11-01 11:42:41 +08:00
Mrunal Patel dc42b45811 Merge pull request #601 from hqhq/rewrite_idmapping
Rewrite LinuxIDMappings
2016-10-31 13:58:45 -07:00
Qiang Huang 4404abf6cb Consistent wording for parameters in array and object
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-10-28 15:09:05 +08:00
Vincent Batts 28c6afea8b Merge pull request #600 from hqhq/fix_typos
Fix some typos
2016-10-28 01:11:18 +00:00
Qiang Huang 621684f645 Rewrite LinuxIDMappings
Basicly make the format consistent with others, no
semantics change.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-10-27 19:00:39 +08:00
Qiang Huang f37cd3a903 Fix some typos
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-10-27 18:00:08 +08:00
Qiang Huang 2379be75cb Use IO instead of io
For consistency, while all other places use IO.

$ grep -rnIw IO * | wc -l
10

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-10-27 16:10:02 +08:00
Zhang Wei c22eeb2197 Forbid duplicated namespaces with same `type`.
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-10-27 11:25:43 +08:00
Mrunal Patel 52f3cdecd1 Clarify wording for terminal setting and /dev/console
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-10-19 10:22:05 -07:00
Ma Shimiao 25f44dd0e8 config-linux: fix format and definitely require value of masked and readonly paths
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2016-09-30 13:51:00 +08:00
W. Trevor King d49c29f042 config: Replace "required" with "REQUIRED"
In all of these cases we want to use the RFC 2119 semantics.
Generated with:

  $ sed -i 's/required/REQUIRED/g' config*.md

after which I rolled back the change for:

  ...controllers required to fulfill...

since that was already MUSTed.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-09-17 22:03:26 -07:00
W. Trevor King c35cf57303 config: Replace "optional" with "OPTIONAL"
In all of these cases we want to use the RFC 2119 semantics.
Generated with:

  $ sed -i 's/optional/OPTIONAL/g' config*.md

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-09-17 22:03:26 -07:00
W. Trevor King 01c2d55fac config-linux: Extend no-tweak requirement to runtime namespaces
Since [1] we've required runtimes to error out if a configuration
joins an existing namespace and adjusts it somehow (e.g. joining an
existing UTC namespace and setting 'hostname', [2]).  However, the
wording from [1] (which survives untouched in the current master) only
talked about "when a path is specified".  I see two possible
approaches for internal consistency:

a. Lift the OCI restriction and allow join-and-tweak [3] where the
   kernel supports it.  When we landed the current restriction, the
   main issues seemed to be "we don't have a clear use-case for join
   and tweak" [4] (although see [5]) and "this is a foot gun [6,7]"
   (I'd rather leave policy to higher-level config linters).

b. Extend the OCI restriction to all cases where the runtime does not
   create a new namespace.  Besides the already covered "namespace
   entry exists and includes 'path'", we'd also want to forbid configs
   that were missing the relevant namespace(s) entirely (in which case
   the container inherits the host namespace(s)).

I'm partial to (a) in the long run, but (b) is less of a shift from
the current spec and likely a better choice for a pending 1.0.

This commit implements (b).

It also makes it explicit that not listing a namespace type will cause
the container to inherit the runtime namespace of that type.

[1]: https://github.com/opencontainers/runtime-spec/pull/158
     Subject: Clarify behavior around namespaces paths
[2]: https://github.com/opencontainers/runtime-spec/pull/214
     Subject: config: Require a new UTS namespace for config.json's hostname
[3]: https://github.com/opencontainers/runtime-spec/pull/158#issuecomment-138687129
[4]: https://github.com/opencontainers/runtime-spec/pull/158#issuecomment-138997548
[5]: https://github.com/opencontainers/runtime-spec/pull/305
     Subject: [Tracker] Live Container Updates
[6]: https://github.com/opencontainers/runtime-spec/pull/158#issuecomment-139106987
[7]: https://github.com/opencontainers/runtime-spec/issues/537#issuecomment-242132288
     Subject: [linux] Tweaking host namespaces?

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-08-24 10:41:50 -07:00
Lei Jitang d0b0ac224f Use filesystem instead of file system
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-08-12 00:00:00 -04:00
W. Trevor King 054d2df15a config-linux: Make linux.resources.devices explicitly optional
And mark it omitempty to avoid:

  $ ocitools generate --template <(echo '{"linux": {"resources": {}}}') | jq .linux
  {
    "resources": {
      "devices": null
    }
  }

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-08-03 09:13:53 -07:00
W. Trevor King 60fff3f51c config-linux: Add (array, optional) for linux.devices
To match the omitempty which the Go property has had since 28cc4239
(add omitempty to 'Device' and 'Namespace', 2016-03-10, #340).

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-08-03 09:13:53 -07:00
Aleksa Sarai 4ed839e747
config-linux: add example of cgroup resource limits
The example section looks very sparse otherwise.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-07-23 02:46:12 +10:00
Aleksa Sarai 4291fd1d5a
config-linux: allow lazy cgroup handling
Make explicit that runtimes only have to attach to the bare minimum
number of cgroups in order to fulfil the users' requirements. However,
runtimes are of course allowed to attach to more than the bare minimum.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-07-23 02:46:12 +10:00