Commit Graph

116 Commits

Author SHA1 Message Date
v1.0.0.batts 09404adbac Merge pull request #859 from jhowardmsft/camelCase
Windows: Fix camelCase inconsistencies
2017-05-31 17:56:22 -04: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
John Howard c6338b37af Windows: Fix camelCase
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-05-25 16:22:29 -07:00
John Howard 2283e6313d Windows: Remove Sandbox, additional tweaks
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-05-24 10:05:22 -07:00
Sunjay Bhatia 284ab58eeb Add LayerFolders to Windows platform config
Signed-off-by: Matthew Horan <mhoran@pivotal.io>
Signed-off-by: Sunjay Bhatia <sbhatia@pivotal.io>
2017-05-23 23:18:32 -04:00
Darren Stahl 6b2fcafaa5 Update to Windows network options
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-05-23 13:38:26 -07:00
John Howard 6b7a7ab304 Windows: Add Hyper-V isolation fields
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-05-23 09:25:39 -07:00
John Howard 4b01400b20 Windows: Add IgnoreFlushesDuringBoot
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-05-22 21:54:17 -07:00
John Howard 3c0a84ce0e Windows: Add servicing
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-05-22 15:20:04 -07:00
v1.0.0.batts c83b8c80fd Merge pull request #820 from jhowardmsft/clarifyrootpath
Clarify root path
2017-05-18 14:16:14 -04:00
Tianon Gravi 57531940cd Merge pull request #814 from jhowardmsft/credentialspec
Windows: Add CredentialSpec
2017-05-18 11:15:57 -07:00
John Howard 5a9490a8e6 Windows: Add CredentialSpec
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-05-15 16:28:07 -07:00
John Howard 7c9acf6c3e Clarify root path
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-05-15 13:33:23 -07:00
Michael Crosby ce6011c65a Merge pull request #766 from wking/cap-validation
schema/defs-linux: Drop 'Capability' type
2017-05-12 15:17:12 -07:00
W. Trevor King 90423a0dc3 schema/test/config/good/minimal: Drop 'process'
It's optional since c41ea83d (config: Make process optional,
2017-02-27, #701) which landed yesterday.

Mrunal wanted to continue testing a config which has enough for a
'start' invocation [1], so I've kept the old JSON as
minimal-for-start.json (washing it through 'make -C schema fmt' to
adjust the args indenting).

[1]: https://github.com/opencontainers/runtime-spec/pull/805#issuecomment-300811461

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-11 10:12:44 -07:00
W. Trevor King 327a6367f0 Makefile: Remove unnecessary .PHONY entries
The only .PHONY entry we *need* is for schema/validate, since that's a
real file but we haven't told Make about its real dependencies (which
involve complicated Go lookups).  I'm personally in favor of using
.PHONY for all targets that aren't on-disk files, because it hints to
readers that the rule is not generating a file at the target.  But
there has been resistance to adding .PHONY entries to all such cases
(e.g. [1,2]), so this commit brings us around to a
internally-consistent "only use .PHONY when you always need it"
position.

That means that, for example, users who create files named 'clean'
will turn 'clean' the target into a no-op, but runtime-spec
maintainers are ok with that.

[1]: https://github.com/opencontainers/runtime-spec/pull/791#issuecomment-300369882
[2]: https://github.com/opencontainers/runtime-spec/pull/791#issuecomment-300612827

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-10 16:54:53 -07:00
Michael Crosby 57a587635d Merge pull request #701 from wking/optional-process
config: Make process optional
2017-05-10 15:03:06 -07:00
Tianon Gravi 60fa44d737 Merge pull request #703 from Mashimiao/schema-fix-user
schema: add username for user field
2017-05-10 08:14:36 -07:00
W. Trevor King 4b49c64a88 config: Shift oomScoreAdj from linux.resources to process
The only discussion related to this is in [1,2], where the
relationship between oomScoreAdj and disableOOMKiller is raised. But
since 429f936 (Adding cgroups path to the Spec, 2015-09-02, #137)
resources has been tied to cgroups, and oomScoreAdj is not about
cgroups.  For example, we currently have (in config-linux.md):

  You can configure a container's cgroups via the resources field of
  the Linux configuration.

I suggested we move the property from linux.resources.oomScoreAdj to
linux.oomScoreAdj so config authors and runtimes don't have to worry
about what cgroupsPath means if the only entry in resources is
oomScoreAdj.  Michael responded with [4]:

  If anything it should probably go on the process

So that's what this commit does.

I've gone with the four-space indents here to keep Pandoc happy (see
7795661 (runtime.md: Fix sub-bullet indentation, 2016-06-08, #495),
but have left the existing entries in this list unchanged to reduce
churn.

[1]: https://github.com/opencontainers/runtime-spec/pull/236
[2]: https://github.com/opencontainers/runtime-spec/pull/292
[3]: https://github.com/opencontainers/runtime-spec/pull/137
[4]: https://github.com/opencontainers/runtime-spec/issues/782#issuecomment-299990075

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-09 16:46:30 -07:00
Michael Crosby e1b2e61320 Merge pull request #764 from wking/strictly-positive-timeout
config: Require strictly-positive timeout values
2017-05-09 13:43:24 -07:00
W. Trevor King 0b7efd2235 schema: Add 'test' target to the Makefile
And fill in some known-good and known-bad examples.  We can make this
as detailed as we want, but this commit just adds enough to know that:

* The full-file spec examples are valid.
* The JSON Schema can distinguish valid examples from invalid JSON.

This will help catch JSON Schema typos like those being addressed by
[1].

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

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-09 11:10:49 -07:00
Michael Crosby 70e26370d8 Merge pull request #784 from q384566678/schema-fix
schema: bug fixes
2017-05-09 09:48:59 -07:00
Darren Stahl aaed975b55 Remove Memory reservation on Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-05-08 17:41:51 -07:00
Darren Stahl 7d007ca1d4 Change Windows CPU Percent to Maximum
In order to increase the granularity of CPU resource control, change
the CPU Percent (0-100) resource setting to CPU Maximum (0-10000)

Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-05-08 14:08:26 -07:00
zhouhao 11d1ae747c schema: Format fix
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-04-27 13:57:49 +08:00
zhouhao 79494b2175 schema: Fix the error
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-04-27 13:49:18 +08:00
Mrunal Patel 13895d6074 Merge pull request #775 from q384566678/rootfs-enum
schema: Add enumeration to rootfsPropagation values
2017-04-26 15:59:09 -07:00
Tianon Gravi 138ad89ca8 Merge pull request #768 from wking/optional-syscalls
config-linux: Make linux.seccomp.syscalls OPTIONAL
2017-04-26 08:29:52 -07:00
v1.0.0.batts c6bff91450 Merge pull request #769 from wking/require-syscall-names
config-linux: Require at least one entry in linux.seccomp.sycalls[].names
2017-04-26 11:26:05 -04:00
Mrunal Patel cb90a82fc1 Merge pull request #778 from wking/schema-makefile-phony
schema/Makefile: Add .PHONY declarations for phony targets
2017-04-26 08:08:27 -07:00
Qiang Huang ce55de2517 Remove range limit which depend on kernel
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2017-04-26 22:46:02 +08:00
W. Trevor King 42984e8d3c config-linux: Make linux.seccomp.syscalls OPTIONAL
Before this commit, linux.seccomp.sycalls was required, but we didn't
require an entry in the array.  That means '"syscalls": []' would be
technically valid, and I'm pretty sure that's not what we want.

If it makes sense to have a seccomp property that does not need
syscalls entries, then syscalls should be optional (which is what this
commit is doing).

If it does not makes sense to have an empty/unset syscalls then it
should be required and have a minimum length of one.

Before 652323c (improve seccomp format to be more expressive,
2017-01-13, #657), syscalls was omitempty (and therefore more
optional-feeling, although there was no real Markdown spec for seccomp
before 3ca5c6c, config-linux.md: fix seccomp, 2017-03-02, #706, so
it's hard to know).  This commit has gone with OPTIONAL, because a
seccomp config which only sets defaultAction seems potentially valid.

The SCMP_ACT_KILL example is prompted by:

On Tue, Apr 25, 2017 at 01:32:26PM -0700, David Lyle wrote [1]:
> Technically, OPTIONAL is the right value, but unless you specify the
> default action for seccomp to be SCMP_ACT_ALLOW the result will be
> an error at run time.
>
> I would suggest an additional clarification to this fact in
> config-linux.md would be very helpful if marking syscall as
> OPTIONAL.

I've phrased the example more conservatively, because I'm not sure
that SCMP_ACT_ALLOW is the only possible value to avoid an error.  For
example, perhaps a SCMP_ACT_TRACE default with an empty syscalls array
would not die on the first syscall.  The point of the example is to
remind config authors that without a useful syscalls array, the
default value is very important ;).

Also add the previously-missing 'required' property to the seccomp
JSON Schema entry.

[1]: https://github.com/opencontainers/runtime-spec/pull/768#issuecomment-297156102

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-04-25 15:06:57 -07:00
W. Trevor King 45cd926102 schema/Makefile: Add .PHONY declarations for phony targets
The only non-phony target (where the target name matches the output
file) is 'validate', but we need .PHONY there because the Go
dependencies are not represented in the Makefile.  This commit adds
the missing .PHONY declarations to the other targets, which truly are
phony.

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-04-24 13:47:03 -07:00
zhouhao a084798c96 schema: Add enumeration to rootfsPropagation values
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-04-21 13:29:13 +08:00
zhouhao df784c5fb8 schema: add clean to Makefile
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-04-18 17:51:15 +08:00
W. Trevor King ecf73148cb config: Require strictly-positive timeout values
If the timeout value was zero, the hook would always error, and there
doesn't seem to be much point to that.  And I'm not sure what negative
timeouts would mean.  By adding this restriction, we do not limit
useful hook entries, and we give the validation code grounds to warn
users attempting to validate configs which are poorly defined or have
useless hook entries.

I'd like to remove the pointer from the Go type to comply with our
anti-pointer zero-value style (style.md) now that Go's zero-value is
clearly invalid.  However, there has been maintainer resistance to
removing the pointer [1] (although I don't think this is consistent
with previous maintainer statements that we don't need pointers when
the zero value is invalid [2]).  In order to land the normative spec
change, this commit keeps the current *int for Hook.Timeout and punts
a consistent policy to future work.

[1]: https://github.com/opencontainers/runtime-spec/pull/764#discussion_r111607155
[2]: https://github.com/opencontainers/runtime-spec/pull/653#issuecomment-272253010

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-04-15 10:18:29 -07:00
W. Trevor King 5c62f9b839 config-linux: Require at least one entry in linux.seccomp.sycalls[].names
I expect the (undocumented) intention here is to iterate through
'names' and call seccomp_rule_add(3) or similar for each name.  In
that case, an empty 'names' makes the whole syscall entry a no-op, and
with this commit we can warn users who are validating such configs.

If, on the other hand, we were comfortable with no-op syscall entries,
we'd want to make 'names' OPTIONAL.

Warning folks who accidentally empty (or don't set) 'names' seems more
useful to me, and doesn't restrict the useful config space, so that's
what I've gone with in this commit.

minItems is documented in [1], and there is an example of its use in
[2]:

  "options": {
    "type": "array",
    "minItems": 1,
    "items": { "type": "string" },
    "uniqueItems": true
  },

[1]: https://tools.ietf.org/html/draft-wright-json-schema-validation-00#section-5.11
[2]: http://json-schema.org/example2.html

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-04-12 10:17:13 -07:00
W. Trevor King ca6e025818 schema/defs-linux: Drop 'Capability' type
The current "For example, valid values for Linux..." wording in
config.md does not seem strong enough to support this condition,
especially since the spec makes no claims about what valid
capabilities are for non-Linux OSes.  And process.capabilities has
been nominally legal for non-Linux OSes since 718f9f3f (minor
narrative cleanup regarding config compatibility, 2017-01-30, #673).

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-04-11 10:13:20 -07:00
zhouhao 8b8afafec7 Makefile: modify the default value
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-04-10 09:40:24 +08:00
zhouhao 3324e7e876 schema: add .PHONY to validate
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-03-30 11:19:11 +08:00
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
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
Ma Shimiao a4ff8879bc schema: add username for user field
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-02-28 17:58:08 +08:00
W. Trevor King c41ea83d84 config: Make process optional
Since be59415 (Split create and start, 2016-04-01, #384), it's
possible for a container process to never execute user-specified code
(e.g. you can call 'create', 'kill', 'delete' without calling
'start').  For folks who expect to do that, there's no reason to
define process.args.

The only other process property required for all platforms is 'cwd',
but the runtime's idler code isn't specified in sufficient detail for
the configuration author to have an opinion about what its working
directory should be.

On Linux and Solaris, 'user' is also required for 'uid' and 'gid'.  My
preferred approach here is to make those optional and define defaults
[1,2]:

  If unset, the runtime will not attempt to manipulate the user ID
  (e.g. not calling setuid(2) or similar).

But the maintainer consensus is that they want those to be explicitly
required properties [3,4,5].  With the current spec, one option could
be to make process optional (with the idler's working directory
unspecified) for OSes besides Linux and Solaris.  On Windows, username
is optional, but that was likely accidental [6].

So an unspecified 'process' would leave process.cwd and process.user
unset.  What that means for the implementation-defined container
process between 'create' and 'start' is unclear, but clarifying how
that is handled is a separate issue [7] independent of whether
'process' is optional or not.

[1]: https://github.com/opencontainers/runtime-spec/pull/417#issuecomment-216076069
[2]: https://groups.google.com/a/opencontainers.org/forum/#!topic/dev/DWdystx5X3A
     Subject: Exposing platform defaults
     Date: Thu, 14 Jan 2016 15:36:26 -0800
     Message-ID: <20160114233625.GN6362@odin.tremily.us>
[3]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2016/opencontainers.2016-05-04-17.00.log.html#l-44
[4]: https://github.com/opencontainers/runtime-spec/pull/417#issuecomment-216937010
[5]: https://github.com/opencontainers/runtime-spec/pull/417#issuecomment-216937090
[6]: https://github.com/opencontainers/runtime-spec/issues/618#issuecomment-277105273
[7]: https://github.com/opencontainers/runtime-spec/pull/700

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-02-27 12:39:14 -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