Commit Graph

1079 Commits

Author SHA1 Message Date
Daniel, Dao Quang Minh 3d8270e1c2 Merge pull request #804 from wking/remove-exlicit-null
config-linux: Remove explicit 'null' from device cgroup values
2017-05-11 19:00:24 -05:00
W. Trevor King 10ab597ee5 config-linux: Remove explicit 'null' from device cgroup values
Catch the Markdown spec up with the JSON Schema change in 09274372
(schema: Drop pointers and nulls, 2017-01-18, #662).  The Markdown is
canonical, so we could restore the explicit-null handling to the JSON
Schema instead, but the maintainers feel (and I agree) that there's no
point in explicitly allowing a null value when callers can simply
leave the property unset [1].

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

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-11 01:29:56 -07:00
Tianon Gravi 1259a08e00 Merge pull request #798 from Mashimiao/bundle-root-reference
bundle.md: specify root reference the directory
2017-05-10 21:39:30 -07:00
Ma Shimiao 5a9013321c bundle.md: specify root reference the directory
I think this make clear what reference the directory in config.json

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-05-11 09:25:03 +08:00
Michael Crosby 02a936a402 Merge pull request #802 from wking/minimal-phony
Makefile: Remove unnecessary .PHONY entries
2017-05-10 17:16:48 -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
Tianon Gravi c4cc3958a7 Merge pull request #700 from wking/process-config-timing
runtime: Explicitly make process.* timing implementation-defined
2017-05-10 16:01:37 -07:00
Michael Crosby 8601fd7908 Merge pull request #732 from wking/drop-additional-actions-step
runtime: Remove "features the runtime chooses to support"
2017-05-10 16:00:48 -07:00
W. Trevor King ccbc57f41b runtime: Remove "features the runtime chooses to support"
Step 3 of the lifecycle from before this commit had two sentences
which both landed in be594153 (Split create and start, 2016-04-01,
#384).  I pushed back a bit on the entry then [1,2], but we seem to be
pretty comfortable with the current "keep all lifecyle entries in a
one-layer enumerated list" approach, so I'm leaving that alone in this
commit.  Step 3 isn't really a lifecycle step though, it's more about
clarifying that you can jump around in the lifecycle instead of
hitting all the steps in consecutive order.  I'd floated a new
paragraph addressing that jumping, but was unable to form a consensus
around wording, and the jumping is already somewhat covered by the
current list entries (e.g. "The container process exits.").  This
commit just drops the old step 3, and Michael will follow up with
wording about jumping [3].

The other sentence from the old step 3 doesn't need replacing, because
the limits are already covered in more detail in the operation
sections themselves.  For example, the 'delete' operation has:

  Attempting to delete a container that does not exist MUST generate
  an error.  Attempting to delete a container whose process is still
  running MUST generate an error.

I don't see the need to call generic attention to that idea, and
especially do not think that an entry in the lifecycle list is the
right place for such a generic call-out.

[1]: https://github.com/opencontainers/runtime-spec/pull/384#r60939710
[2]: https://github.com/opencontainers/runtime-spec/pull/384#issuecomment-214418730
[3]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2017/opencontainers.2017-05-10-21.03.log.html#l-79

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-10 15:44:06 -07:00
W. Trevor King 72e8062035 runtime: Explicitly make process.* timing implementation-defined
Based on IRC discussion today (times in PST) [1]:

  11:36 < crosbymichael> just take a step back and think about it.
    you have a process object in the spec.  its a single object
    defining what to run.  How do you run a process?  you exec its
    args.  From the spec pov its an atomic operation.  in between
    create and start its not running the users code and is left up to
    the runtime.  you either have a process defined by the spec and
    its created as an operation in the container on start or your
    dont.

With the previous wording, it was unclear how large a hole we were
poking with "the user-specified program MUST NOT be run at this time".
This commit removes that ambiguous wording and replaces it with an
explicit reference to 'process.args'.  It makes it clear that
everything outside of 'process' MUST happen at create-time.  And it
leaves all of 'process' except for 'process.args' up to the
implementation.

This means that the caller has no reliable way to set the
user/cwd/capabilities/… of the runtime's container process between
'create' and 'start'.  You could avoid that limitation by requiring
all process properties *except* process.args be applied at
create-time, but my attempt to make process.args optional (which would
have allowed that interpretation without burdening callers who never
intended to call 'start') was rejected in favor of this all-or-nothing
approach to 'process' handling [2].

[1]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/%23opencontainers.2017-02-27.log.html#t2017-02-27T19:35:35
[2]: https://github.com/opencontainers/runtime-spec/pull/620#issuecomment-282820279

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-10 15:41:32 -07:00
Mrunal Patel be3a1844f3 Merge pull request #681 from wking/valid-values
config: Move valid-value rules to their own section
2017-05-10 15:14:06 -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 7a75267286 Merge pull request #702 from wking/remove-operation-status-redefinition
runtime: Remove status redefinitions from operations
2017-05-10 14:59:50 -07:00
Michael Crosby 57428ed7ba Merge pull request #733 from wking/remove-base-operating-system-loophole
runtime: Drop "not supported by the base OS" loophole
2017-05-10 14:45:55 -07:00
Michael Crosby 844f392f39 Merge pull request #736 from wking/dev-symlink-conditional
runtime-linux: Condition /proc/self/fd symlinks on source existence
2017-05-10 14:16:14 -07:00
Michael Crosby 27064b8336 Merge pull request #767 from wking/rfc2119-namespaces
config-linux: RFC 2119 tightening for namespaces
2017-05-10 14:13:22 -07:00
Mrunal Patel aa1631cfaa Merge pull request #790 from tianon/punt-caps-to-kernel-docs
config: strengthen punt to kernel for valid "capabilities" strings
2017-05-10 14:00:19 -07:00
Mrunal Patel cde4b6624f Merge pull request #799 from wking/inline-internal-links
*: Use inline links for remaining internal references
2017-05-10 13:58:40 -07:00
Mrunal Patel d611cdc11e Merge pull request #800 from wking/remove-redundant-cgroup-must
config-linux: Remove redundant MUST for minimum cgroup controllers
2017-05-10 13:54:31 -07:00
W. Trevor King fae94dbab0 config-linux: Remove redundant MUST for minimum cgroup controllers
Any runtime which violated that constraint would necessarily violate
some more specific constraint on a 'resources' setting.

This also removes a non-spec-requirement "required" to avoid any
confusion with the spec-requirement REQUIRED [1].

[1]: https://github.com/opencontainers/runtime-spec/pull/729#issue-214550260

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-10 13:41:54 -07:00
Tianon Gravi cd92a0e385 Merge pull request #713 from Mashimiao/config-linux-fix-network-interface
config-linux: make interface name clear
2017-05-10 13:12:25 -07:00
W. Trevor King 65cb135df8 *: Use inline links for remaining internal references
Since f9dc90b0 (make link usage consistent across the specification,
2017-02-09, #687), the official style is to only use reference-style
links for external links.  I expect the remaining three entries just
slipped through.  This commit adjusts everything found with:

  $ git grep ']: [a-z]' | grep -v http

It also fixes the underscore -> hyphen in the
glossary.md#container-namespace target and updates the capabilities
location to catch up with 5a8a779f (Move process specific settings to
process, 2016-03-02, #329).

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-10 11:26:14 -07:00
Daniel, Dao Quang Minh f56fe8ba78 Merge pull request #796 from Mashimiao/small-tfix
small typo fix
2017-05-10 11:17:01 -05: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
Ma Shimiao 3864175855 small typo fix
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2017-05-10 19:57:34 +08:00
Daniel, Dao Quang Minh d974e9db4b Merge pull request #793 from wking/unique-solaris-zonecfg-link-target
config-solaris: Restore 'zonecfg.1m_2' link targets
2017-05-09 23:30:01 -05:00
Daniel, Dao Quang Minh 8202372717 Merge pull request #789 from wking/move-oom-adj-to-process
config: Shift oomScoreAdj from linux.resources to process
2017-05-09 23:19:05 -05:00
Qiang Huang db100f434f Merge pull request #730 from wking/drop-access-control-concerns
runtime: Drop "Barring access control concerns"
2017-05-10 09:56:26 +08:00
Qiang Huang 4245201619 Merge pull request #794 from wking/consistent-solaris-zonecfg-link-target
config: Update zonecfg(1M) link to match config-solaris.md
2017-05-10 09:53:14 +08:00
Michael Crosby 43c21541cb Merge pull request #737 from wking/config-lead-in
config: Lead off with the purpose of the config
2017-05-09 16:57:27 -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
W. Trevor King 2d8d50c2f8 runtime: Remove status redefinitions from operations
These states are already defined in the "State" section.  There's no
need to redefine them in the operation sections.

Operation-level redefinitions are dicy anyway, because they imply
something testable about the immediately-after-this-operation time,
and it's not possible to run race-free tests of that time (e.g. the
process could die for other reasons between the successful 'create'
call and the 'state' call you made to look for a 'created' status).

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-09 16:40:19 -07:00
W. Trevor King b644395e96 config-linux: RFC 2119 tightening for namespaces
Previously we had no MUST-level runtime requirements for namespace
entries in valid configs.  This commit attempts to pin those down.

I think we want more wording about new namespace creation (what
namespace is the seed/parent?  Which user namespace owns a runtime
namespace?  For more background on hierarchical namespaces, see [1].
For more background on the owning user namespace idea, see [2,3,4]),
but that wording proved contentious [5,6], so I punted it to [7].

The "'path' not associated with a namespace of type 'type'" condition
ensures that runtimes don't blindly call setns(2) on the path without
setting nstype nonzero.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a7306ed8d94af729ecef8b6e37506a1c6fc14788
     nsfs: add ioctl to get a parent namespace, 2016-09-06
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6786741dbf99e44fb0c0ed85a37582b8a26f1c3b
     nsfs: add ioctl to get owning user namespace for ns file
     descriptor, 2016-09-06
[3]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e5ff5ce6e20ee22511398bb31fb912466cf82a36
     nsfs: Add an ioctl() to return the namespace type, 2017-01-25
[4]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d95fa3c76a66b6d76b1e109ea505c55e66360f3c
     nsfs: Add an ioctl() to return owner UID of a userns, 2017-01-25
[5]: https://github.com/opencontainers/runtime-spec/pull/767#discussion_r115591844
[6]: https://github.com/opencontainers/runtime-spec/pull/767#discussion_r115592437
[7]: https://github.com/opencontainers/runtime-spec/pull/795

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-09 15:16:17 -07:00
Michael Crosby a6d839bd5f Merge pull request #792 from wking/pointer-for-console-size
specs-go/config: Use a pointer for Process.ConsoleSize
2017-05-09 15:05:15 -07:00
W. Trevor King 57795f4311 config: Update zonecfg(1M) link to match config-solaris.md
With the same link update that config-solaris.md got in ea65eb3d
(config-solaris.md: fix info, 2017-04-28, #786), since the old link
404s.

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-09 14:56:56 -07:00
W. Trevor King 27c045ab67 config-solaris: Restore 'zonecfg.1m_2' link targets
These were added in f9dc90b0 (make link usage consistent across the
specification, 2017-08-09, #687) to follow the new _N name-dedup
policy discussed in style.md.  They were removed in ea65eb3d
(config-solaris.md: fix info, 2017-04-28, #786), overlooking that
policy.  This commit brings them back.

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-09 14:50:16 -07:00
W. Trevor King ff071ccb02 config: Lead off with the purpose of the config
Instead of leading off with links to a bunch of other places, notes on
the Go tags, etc., make things more inviting by leading off with a
big-picture summary of what the configuration is about.

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-09 14:12:55 -07:00
W. Trevor King d42b44b8ff specs-go/config: Use a pointer for Process.ConsoleSize
Avoid injecting:

  "consoleSize":{"height":0,"width":0}

when serializing with Go's stock JSON serializer. Using a pointer for
this optional struct property works around [1].

[1]: https://github.com/golang/go/issues/11939

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-09 14:10:54 -07:00
Michael Crosby 5a39b39397 Merge pull request #756 from wking/config-drop-filename
config: Drop the redundant config.json filename requirement
2017-05-09 13:56:36 -07:00
Tianon Gravi 8de9b12191 config: strengthen punt to kernel for valid "capabilities" strings
Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
2017-05-09 13:44:21 -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
Mrunal Patel 01ec62d3e4 Merge pull request #781 from wking/oomScoreAdj-rfc-2119
config-linux: RFC 2119 wording for oomScoreAdj
2017-05-09 13:13:45 -07:00
Michael Crosby 8976b0a8ac Merge pull request #785 from wking/schema-tests
schema: Add 'test' target to the Makefile
2017-05-09 13:10:56 -07:00
Michael Crosby ee87262926 Merge pull request #786 from q384566678/fix-solaris
config-solaris.md: fix info
2017-05-09 13:09:04 -07:00
Mrunal Patel 9b4b6d796c Merge pull request #787 from wking/intel-rdt-style
config-linux: RFC 2119 wording for intelRdt
2017-05-09 13:08:00 -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
Michael Crosby 6a17a38085 Merge pull request #783 from q384566678/range-limt
Remove range limit
2017-05-09 09:48:17 -07:00
W. Trevor King b11ade4616 config-linux: RFC 2119 wording for intelRdt
So we can compliance-test runtimes for these settings.

Also remove the tutorial, since the kernel docs should provide
sufficient documentation on that front.  The kernel can be patched if
they do not, and we do not include tutorials for other config-linux
settings in this spec.

The updated example was recommended by Xiaochen to compensate for the
removed inline tutorial [1].

[1]: https://github.com/opencontainers/runtime-spec/pull/787#discussion_r114254422

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-09 09:29:49 -07:00
W. Trevor King e9a39e76f4 config-linux: RFC 2119 wording for oomScoreAdj
The previous wording hinted at, but did not require, this setting to
be implemented via oom_score_adj.  With the new wording, when proc is
mounted at /proc, the container process can check this value by
looking at /proc/self/oom_score_adj.

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-09 09:28:25 -07:00