Commit Graph

933 Commits

Author SHA1 Message Date
W. Trevor King 5bf9b95c45 schema/defs-linux: Fix type for seccomp names
The:

  "type": [
    "string"
  ]

syntax added in 652323cd (improve seccomp format to be more
expressive, 2017-01-13, #657) is not valid:

  $ ./validate ./config-schema.json <../config.json
  The document is not valid. see errors :
  - linux.seccomp.syscalls.0.names: Invalid type. Expected: string, given: array

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-03-06 12:15:47 -08:00
Michael Crosby d87ec6945f Merge pull request #687 from jlbutler/link-cleanup-676
make link usage consistent across the specification
2017-03-03 11:50:37 -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
Michael Crosby 7da699dcda Merge pull request #532 from wking/tk/restore-hook-lifecycle
Restore hook language removed by create/start split
2017-03-03 10:36:20 -08:00
W. Trevor King f636808bfd *: Restore hook lifecycle information removed by create/start split
I expect the lifecycle information was removed accidentally in
be594153 (Split create and start, 2016-04-01, #384), because for a
time it seemed like that PR would also be removing hooks.  Putting the
lifecycle information back in, I made some tweaks to adjust to the new
environment, for example:

* Put the pre-start hooks after the 'start' call, but before the meat
  of the start call (the container-process exec trigger).  Folks who
  want a post-create hook can add one with that name.  I'd like to
  have renamed poststop to post-delete to avoid confusion like [1].
  But the motivation for keeping hooks was backwards compatibility [2]
  so I've left the name alone.

* Put each "...command is invoked..." lifecycle entry in its own list
  entry, to match the 'create' list entry.

* Move the rules about what happens on hook failure into the
  lifecycle.  This matches pre-split entries like:

    If any prestart hook fails, then the container MUST be stopped and
    the lifecycle continues at step 7.

  and avoids respecifying that information in a second location
  (config.md).

* I added the warning section to try and follow post-split's generic
  "generates an error" approach while respecting the pre-split desire
  to see what failed (we had "then an error including the exit code
  and the stderr is returned to the caller" and "then an error is
  logged").

* I left the state 'id' context out, since Michael didn't want it [3].

* Make runtime.md references to "generate an error" and "log a
  warning" links, so readers have an easier time finding more detail
  on that wording.

Where I reference a section, I'm still using the auto-generated anchor
for that header and not the anchors which were added in 41839d7 (Merge
pull request #707 from mrunalp/anchor_tags, 2017-03-03) and similar.
Mrunal suggested that the manually-added anchors were mainly intended
for the validation tooling [4].

[1]: https://github.com/opencontainers/runtime-spec/pull/395
     Subject: Run post-stop hooks before the container sandbox is deleted.
[2]: https://github.com/opencontainers/runtime-spec/pull/483#issuecomment-240568422
     Subject: *: Remove hooks
[3]: https://github.com/opencontainers/runtime-spec/pull/532#discussion_r99232480
     Subject: Restore hook language removed by create/start split
[4]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/%23opencontainers.2017-03-03.log.html#t2017-03-03T18:02:12

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-03-03 10:04:23 -08:00
Michael Crosby 41839d7f95 Merge pull request #707 from mrunalp/anchor_tags
Anchor tags
2017-03-03 09:38:08 -08:00
Mrunal Patel c942816d76 Add anchors to misc. docs
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-03-02 11:01:18 -08:00
Mrunal Patel 4b0755490e Add anchors to runtime
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2017-03-02 11:00:53 -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
Mrunal Patel 40474dd78c Merge pull request #704 from hqhq/use_uint64_for_memory
Set specs value the same as kernel API input
2017-03-01 14:05:37 -08:00
Qiang Huang 2db839104d Merge pull request #699 from crosbymichael/mount-optional
Make mount type and source optional
2017-02-28 20:05:03 -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
Michael Crosby 52461516ea Make mount type and source optional
These are optional on multiple platforms and should be left up to the
runtime/host system for validation.

Closes #470

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-02-28 13:50:18 -08:00
Mrunal Patel 2d491b03fa Merge pull request #694 from q384566678/state-json
state-schema.json: add the value of status
2017-02-27 11:19:26 -08:00
Mrunal Patel fb76f47bf4 Merge pull request #696 from q384566678/json-fix
Fix config-schema.json
2017-02-27 11:19:04 -08:00
Mrunal Patel 18965b08af Merge pull request #697 from q384566678/config-linux-fix
config-linux.md: fix info
2017-02-27 11:17:45 -08:00
Michael Crosby 472cdae2de Merge pull request #695 from q384566678/config-fix
add REQUIRED to platform field
2017-02-27 11:03:24 -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
zhouhao ec49ba1ada remove mounts from required
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-02-27 09:29:01 +08:00
zhouhao 0a8ef1d7b5 config-schema.json: add required
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-02-27 09:27:04 +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
zhouhao 5dda457654 add REQUIRED to platform field
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-02-24 14:05:33 +08:00
zhouhao 7ec622e5c3 state-schema.json: add the value of status
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-02-24 13:33:54 +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
Michael Crosby 3f5078dab0 Merge pull request #693 from hqhq/dont_limit_mapping
Remove uid/gid mapping limit depend on kernel
2017-02-22 15:00:00 -08:00
Mrunal Patel ac9f8e0b5f Merge pull request #675 from crosbymichael/caps
Add ambient and bounding capability support
2017-02-22 14:59:11 -08:00
Michael Crosby eb114f0570 Add ambient and bounding capability support
Closes #668

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-02-22 14:47:51 -08: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
Mrunal Patel 8c22b690a4 Merge pull request #688 from Mashimiao/schema-fix-device-required
schema: remove major,minor from device required items
2017-02-17 10:18:30 -08:00
Mrunal Patel 359de8f44d Merge pull request #691 from crosbymichael/abstract
Add OCI Runtime Abstract
2017-02-17 08:08:04 -08:00
Michael Crosby b81c09c9fd Add OCI Runtime Abstract
Closes #506

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-02-16 15:39:35 -08:00
Mrunal Patel e6d2a0ff2b Merge pull request #685 from Mashimiao/config-fix-and-hook-args
config.md: args of Hooks should be optional
2017-02-15 14:12:46 -08:00
Ma Shimiao 0e808fcad0 schema: remove major,minor from device required items
When type is p, major and minor is not required.
So, we should not leave them in require.

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-02-14 14:15:12 +08:00
Vincent Batts 21f7998bfb Merge pull request #570 from wking/go-protocol-definition
config: Link platform:"…" JSON tags with ~~protocol~~ platform slugs
2017-02-09 14:33:25 -06:00
Ma Shimiao fcd62099ff config.md: args of Hooks should be optional
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-02-09 09:45:42 +08:00
Vincent Batts 67c81aa3c6 Merge pull request #684 from Mashimiao/schema-fix-invalid-types
schema: fix invalid types
2017-02-08 15:24:26 -05:00
Mrunal Patel 1f408dc1db Merge pull request #507 from wking/add-creating-status
runtime: Add 'creating' to state status
2017-02-08 11:46:50 -08:00
Mrunal Patel 7c1a16b54a Merge pull request #552 from x1022as/validate
improve validate usage message
2017-02-08 11:45:29 -08:00
W. Trevor King 4af0c72f92 config: Link platform:"..." JSON tags with platform slugs
So that the semantics of the tags are clear.

The platform/protocol disconnect is unfortunate.  "Protocol" was
chosen in de3f1af6 (Remove language around Solaris being optional as
it is covered in compliance language, 2016-08-17, #527) because we may
have compliance subsets that aren't linked to platforms [1].  I'd be
open to renaming the JSON tag from platform:"..." -> protocol:"...",
but that's probably more change than it's worth.  The approach taken
in this commit, on the other hand, renames "protocol" to "platform".
I think that unnecessarily limits (or sets up confusing semantics for)
the platform/protocol values you can use, but two maintainers both
prefer "platform" [2,3].

[1]: https://github.com/opencontainers/runtime-spec/pull/527#issuecomment-238979250
[2]: https://github.com/opencontainers/runtime-spec/pull/570#discussion_r99227202
[3]: https://github.com/opencontainers/runtime-spec/pull/570#discussion_r100013014

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-02-08 08:01:47 -08:00
W. Trevor King b4a3c8daeb spec: Slug protocol names
We'll be referring to these in code, and using a slug everywhere
avoids having to define both a slug form (linux) and an English form
(Linux containers).

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-02-08 07:47:09 -08:00
Ma Shimiao 4100020dfc schema: fix invalid types
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-02-08 16:35:45 +08:00
Deng Guangxing 21ee162b42 add explicit usage message to validate and some fix
this commit contains:
* add explicit usage message to validate
* schemaPath was overrided by filepath.Abs(), schemaLoader would not get
* the abs path.
* check local scheme and document file path with os.Stat()

Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
2017-02-08 15:18:18 +08:00
Michael Crosby 2e2d568b83 Merge pull request #673 from jlbutler/config-compat-303
narrative cleanup in support of Base Config Compatibility #303
2017-02-07 14:19:21 -08:00
Jesse Butler 718f9f3f5d minor narrative cleanup regarding config compatibility
Signed-off-by: Jesse Butler <jesse.butler@oracle.com>
2017-02-07 12:57:06 -05:00
Vincent Batts 0d104bb63c Merge pull request #672 from vbatts/bump-version
Bump version for 1.0.0-rc4
2017-02-06 12:30:34 -05:00
Qiang Huang 2392e66f16 Merge pull request #674 from crosbymichael/state
Rename bundlePath to bundle
2017-02-06 10:43:17 +08:00
Qiang Huang ce0783aa1c Merge pull request #662 from wking/json-schema-no-pointer
schema: Drop pointers and nulls
2017-02-06 10:41:35 +08:00
Mrunal Patel 7278567eb2 Merge pull request #666 from dqminh/container-filesystem
linux: relax filesystem requirements for container
2017-02-03 11:22:16 -08:00