Commit Graph

515 Commits

Author SHA1 Message Date
Vincent Batts d118a8ff53 schema: updates and fixes
Several fields needed the correct typing, and updates for recent changes.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-04-07 10:13:39 -04:00
Mrunal Patel 91c67c7d72 Merge pull request #369 from wking/sentence-line-style
style: Move one-sentence-per-line rule over from the README
2016-04-06 13:49:54 -07:00
W. Trevor King e0525bcbd9 style: Move one-sentence-per-line rule over from the README
This is style information, even though it's about the spec and not
about the behavior covered by the spec.  The Go-pointer rule is also
about more peripheral stuff though, and the README has a lot of stuff
in it, so it seems like a better fit after the move.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-04-06 11:19:05 -07:00
Mrunal Patel 81b865dedb Merge pull request #365 from vbatts/repo_rename
*: specs -> runtime-spec
2016-04-05 10:57:45 -07:00
Vincent Batts faad7e0fcf README: title rename
And align wording with
https://github.com/opencontainers/image-spec/pull/5

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-04-05 13:24:40 -04:00
Vincent Batts 207267d0de *: specs -> runtime-spec
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-04-04 14:16:01 -04:00
Mrunal Patel 93ca97e83c Merge pull request #364 from crosbymichael/masked-paths
Add masked and readonly paths
2016-04-01 12:02:13 -07:00
Michael Crosby adcbe530a9 Add masked and readonly paths
Fixes #320

This adds the maskedPaths and readonlyPaths fields to the spec so that
proper masking and setting of files in /proc can be configured.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-01 10:46:41 -07:00
Mrunal Patel c33fd5fb21 Merge pull request #358 from wking/irc-logs
README: Add a link to the IRC logs
2016-03-31 13:29:39 -07:00
Mrunal Patel d2de3d95e5 Merge pull request #363 from crosbymichael/revert-ffjson
Remove ffjson because of gccgo issues
2016-03-31 13:29:00 -07:00
Michael Crosby 51f8868c30 Remove ffjson because of gccgo issues
Fixes #362

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-31 11:21:45 -07:00
Qiang Huang 0d6ad0b968 Merge pull request #359 from vbatts/cleanup-paren
style: dangling paren
2016-03-31 09:13:34 +08:00
Vincent Batts 47bca68489 style: dangling paren
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-30 13:44:04 -04:00
W. Trevor King ab61f5db8b README: Add a link to the IRC logs
We have these irclog2html.py logs because we're part of a MeetBot pool
managed by the Linux Foundation [1], so they should be pretty
reliable.

We could have this link in the /topic, but there's already a lot there
and folks may want to browse the logs over HTTP without bothering to
connect to the live channel.

[1]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/%23opencontainers.2015-12-29.log.html#t2015-12-29T21:51:30

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-03-30 09:15:31 -07:00
Vincent Batts cf8ebc9d6e Merge pull request #351 from crosbymichael/regen-json
Regenerate ffjson for Timeout field
2016-03-29 13:13:19 -04:00
Michael Crosby 0eb138d1d6 Regenerate ffjson for Timeout field
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-23 16:16:13 -07:00
Mrunal Patel 691faa09ab Merge pull request #352 from vbatts/go-version-golint
travis: add go1.6 and work around golint
2016-03-23 16:14:12 -07:00
Vincent Batts 7aa7dcde06 Merge pull request #347 from vbatts/user-name
config: clarify the uname mapping
2016-03-23 15:38:58 -04:00
Mrunal Patel b37fe273ac Merge pull request #353 from giuseppe/fix-typo
specs: fix typo
2016-03-21 16:35:58 -07:00
Mrunal Patel 1185630371 Merge pull request #354 from runcom/fix-typos
*: fix typos
2016-03-21 16:32:30 -07:00
Vincent Batts 54cd96d2fb travis: add go1.6 and work around golint
closes #350

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-21 14:29:37 -04:00
Antonio Murdaca 5ded78475c *: fix typos
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-21 11:51:19 +01:00
Giuseppe Scrivano f4950a17c2 specs: fix typo
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2016-03-21 11:33:43 +01:00
Mrunal Patel e23fbbb408 Merge pull request #346 from crosbymichael/hook-timeout
Add timeout field to hooks
2016-03-18 10:21:31 -07:00
Michael Crosby 7aeccd73da Merge pull request #328 from hqhq/hq_update_associated_projects
Update associated projects
2016-03-18 10:20:34 -07:00
Qiang Huang fd376358fd Update associated projects
Now we have ocitools in opencontainers, thanks @mrunalp .

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-03-18 11:22:51 +08:00
Vincent Batts a306c5841f Merge pull request #343 from crosbymichael/marshal-performance
Improve json encoding performance for specs-go
2016-03-16 21:35:28 -04:00
Vincent Batts 95f0c672a0 config: clarify the uname mapping
Closes #38

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-17 01:17:18 +00:00
Michael Crosby 5a3b1816b2 Add timeout field to hooks
So that runtimes don't lock up forever waiting on a hook to return I
added a timeout field.  This allows the author to specify the timeout in
seconds that they want the hook to run before aborting the hook and
container execution.

I think the hook is the proper place to specify a timeouot like this
because any type of overall timeout in the runtime will probably not
work for all hooks and will not be flexable enough.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-16 16:51:29 -07:00
Mrunal Patel a7a90d986d Merge pull request #275 from wking/namespace-host-paths
config-linux: Specify host mount namespace for namespace paths
2016-03-16 14:55:00 -07:00
W. Trevor King 5dad125595 config-linux: Specify host mount namespace for namespace paths
Avoid trouble with situations like:

  # mount --bind /mnt/test /mnt/test
  # mount --make-rprivate /mnt/test
  # touch /mnt/test/mnt /mnt/test/user
  # mount --bind /proc/123/ns/mnt /mnt/test/mnt
  # mount --bind /proc/123/ns/user /mnt/test/user
  # nsenter --mount=/proc/123/ns/mnt --user /proc/123/ns/user sh

which uses the required private mount for binding mount namespace
references [1,2,3].  We want to avoid:

1. Runtime opens /mnt/test/mnt as fd 3.
2. Runtime joins the mount namespace referenced by fd 3.
3. Runtime fails to open /mnt/test/user, because /mnt/test is not
   visible in the current mount namespace.

and instead get runtime authors to setup flows like:

1. Runtime opens /mnt/test/mnt as fd 3.
2. Runtime opens /mnt/test/user as fd 4.
3. Runtime joins the mount namespace referenced by fd 3.
4. Runtime joins the user namespace referenced by fd 4.

This also applies to new namespace creation.  We want to avoid:

1. Runtime clones a container process with a new mount namespace.
2c. Container process fails to open /mnt/test/user, because /mnt/test
    is not visible in the current mount namespace.

in favor of something like:

1. Runtime opens /mnt/test/user as fd 3.
2. Runtime clones a container process with a new mount namespace.
3h. Host process closes unneeded fd 3.
3c. Container process joins the user namespace referenced by fd 3.

I also define runtime and container namespaces, so we have consistent
terminology.  I prefer:

* host namespace: a namespace you are in when you invoke the runtime
* host process: the runtime process invoked by the user
* container process: the process created by a clone call in the host
  process which will eventually execute the user-configured process.

Both the host and container processes are running runtime code
(although the container process eventually transitions to
user-configured code), so I find "runtime process", "runtime
namespace", etc. to be imprecise.  However, the maintainer consensus
is for "runtime namespace" [4,5], so that's what we're going with
here.

[1]: http://karelzak.blogspot.com/2015/04/persistent-namespaces.html
[2]: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4ce5d2b1a8fde84c0eebe70652cf28b9beda6b4e
[3]: http://mid.gmane.org/87haeahkzc.fsf@xmission.com
[4]: https://github.com/opencontainers/specs/pull/275#discussion_r48057211
[5]: https://github.com/opencontainers/specs/pull/275#discussion_r48324264

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-03-16 14:47:29 -07:00
Michael Crosby cfec788d67 Add makefile target for ffjson
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-16 11:30:16 -07:00
Mrunal Patel b8d67bbaf1 Merge pull request #342 from wking/canonical-markdown-and-go-links
config: Make Markdown canonical
2016-03-16 10:30:21 -07:00
Vincent Batts 4d4a07952e Merge pull request #340 from liangchenye/master
add omitempty to 'Devices
2016-03-16 13:27:20 -04:00
Michael Crosby 4e99e8fb89 Use ffjson for faster marshal and unmarshal
By using ffjson for json encoding we can reduce the time for encoding
and decoding.

Without:

BenchmarkMarsalSpec-4     100000             18276 ns/op
BenchmarkUnmarshal-4       30000             55115 ns/op

With:

BenchmarkMarsalSpec-4     100000             13649 ns/op
BenchmarkUnmarshal-4       50000             24747 ns/op

This is a reduces time about 25% on marshal and 50% on unmarshal.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-15 17:30:18 -07:00
Michael Crosby 7a00e0ce5e Add basic marshal tests
This adds basic benchmark tests for the performace of marshaling and
unmarshaling the spec into json.  These tests are helpful to optimize
the performace because the main way the spec is consumed is via json.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-15 17:21:40 -07:00
liangchenye 28cc423977 add omitempty to 'Device' and 'Namespace'
Signed-off-by: liangchenye <liangchenye@huawei.com>
2016-03-11 11:28:58 +08:00
W. Trevor King 2123330983 project: Update link to version.go now that it's in specs-go/
Catch up with 7bf06d5 (source and schema: differentiate with examples,
2015-12-18, #276).

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-03-10 13:42:35 -08:00
W. Trevor King 160b4a262a config: Make Markdown canonical
Also:

* Update the link to Go bindings after 7bf06d5 (source and schema:
  differentiate with examples, 2015-12-18, #276).
* Add a reference to the JSON Schema after cdcabde (schema: JSON
  Schema and validator for `config.json`, 2016-01-19, #313).

It's pretty clear that the Go bindings cannot be canonical on their
own, because they do not define limits (e.g. the 0 through 512 range
for FileMode).  The JSON Schema is closer, but still does not cover
everything (e.g. "a directory must exist at root.path").  Both the Go
bindings and the JSON Schema could grow to cover the full spec by
adding that sort of thing to comments and descriptions, but that's not
how things seem to be working now.

Signed-off-by: W. Trevor King <wking@tremily.us>
2016-03-10 13:42:35 -08:00
Mrunal Patel 41031086f1 Merge pull request #336 from vbatts/bump-v0.4.0
Bump v0.4.0
2016-03-10 13:18:32 -08:00
Vincent Batts ab44e373ec version: bump v0.5.0-dev
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-10 18:54:08 +00:00
Vincent Batts 3ce138b193 version: v0.4.0
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-10 18:54:08 +00:00
W. Trevor King 698d93075b ChangeLog: Document changes since v0.3.0
Through 0bcb7119 (Merge pull request #341 2016-03-10).

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-10 18:53:53 +00:00
W. Trevor King 2042424786 ChangeLog: Strip trailing whitespace
Signed-off-by: W. Trevor King <wking@tremily.us>
2016-03-10 18:49:11 +00:00
Mrunal Patel 0bcb7119b7 Merge pull request #341 from cloudfoundry-incubator/move-rlimits-to-process
Move rlimits to process
2016-03-10 10:27:24 -08:00
Mrunal Patel 9b19e76405 Merge pull request #313 from vbatts/json-schema
json-schema: initial pass at schema and validator
2016-03-10 10:26:17 -08:00
Julian Friedman 9d9ed06d5e Move rlimits to process
Signed-off-by: Julian Friedman <julz.friedman@uk.ibm.com>
2016-03-10 09:44:43 +00:00
Julian Friedman 77f3b7b68f Nit: systems not systemd
Signed-off-by: Julian Friedman <julz.friedman@uk.ibm.com>
2016-03-10 09:30:00 +00:00
Michael Crosby dfd71f755e Merge pull request #337 from vbatts/carry-335
ReadMe: Update content to match print order
2016-03-09 17:03:57 -08:00
Vincent Batts eea2a6c15b Merge pull request #310 from vbatts/multi-platform
config: platform dependent reference source
2016-03-09 15:47:07 -05:00