-
Notifications
You must be signed in to change notification settings - Fork 596
Change layout of mountpoints and mounts #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link with “… of [mount points from the portable config](config.md#mount-points)”?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link is now on line 7 (“Only [mounts from …]”), so I'm fine leaving this line as it stands.
|
On Wed, Sep 02, 2015 at 08:47:03AM -0700, Alexander Morozov wrote:
I don't think so. We need different Go names because we're putting |
|
Actually we don't need different go name too. |
|
On Wed, Sep 02, 2015 at 09:45:00AM -0700, Alexander Morozov wrote:
We don't? They're both in the specs package in the same directory. |
|
@wking It's type name, have nothing in common with field name. |
|
On Wed, Sep 02, 2015 at 09:51:08AM -0700, Alexander Morozov wrote:
Ah, right. +1 to making both field names Mounts to match the JSON |
runtime_config.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/configuration/configurations/
|
@wking I actually added example of |
|
On Wed, Sep 02, 2015 at 11:43:07AM -0700, Alexander Morozov wrote:
But it only lists ‘proc’, while the runtime.json example in the runtime docs lists proc, |
config.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I wasn't suggesting we copy the runtime.json side over here. I want to link to it. But I think the config.json example here should be compatible with the runtime.json example we link to. I'm happy to PR a fixup against your branch if that's easier ;).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay
|
On Wed, Sep 02, 2015 at 11:50:11AM -0700, W. Trevor King wrote:
I've been explaining this poorly, so here's a PR with my suggested |
67313c6 to
497b51f
Compare
runtime_config.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to touch this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see what changed in this comment.
Oh, I see now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Wed, Sep 02, 2015 at 01:12:41PM -0700, Alexander Morozov wrote:
- Mounts []Mount
json:"mounts"- // Hooks are the commands run at various lifecycle events of the container.
…- Mounts map[string]Mount
json:"mounts"- // Hooks are the commands run at various lifecycle events of the containers.
I don't see what changed in this comment.
The post-Mounts comment should be about hooks, and there's only one
container for lifecycle events.
- // Mounts is a mapping of names to mount configuration.
- // Which mounts will be mounted and where should be chosen with MountPoints
- // in Spec.
The pre-Mounts comment^, on the other hand should be talking about
“mount configurations”, not “mount configuration”.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<nit>Maybe “Mount destination in the container filesystem”? The colon-separated form works, but it took me a reread to understand what it meant.</nit>.
|
LGTM |
|
LGTM |
runtime-config.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a leftover "destination"
|
I think the mount order should be clearly defined in the spec. Alternative definitions in my mind:
Any thoughts? |
|
On Wed, Sep 02, 2015 at 04:53:54PM -0700, Lai Jiangshan wrote:
This is how I'd do it. |
Wait until full discussion? |
|
On Wed, Sep 02, 2015 at 05:30:18PM -0700, Lai Jiangshan wrote:
Probably wise ;). One thing to consider for auto-ordering, is what
I'm not actually sure ;), but it's possible that /d still looks into |
Added info about MountPoints to config.md. Signed-off-by: Alexander Morozov <[email protected]> Signed-off-by: W. Trevor King <[email protected]>
|
I prefer the strict/exact order. But it needs to be documented in the Spec. |
|
LGTM (c18c283) |
|
On Wed, Sep 02, 2015 at 09:25:54PM -0700, Lai Jiangshan wrote:
Looks good to me too. I'm fine punting explicit ordering statements |
|
I think we have enough LGTMs here and I want to fix spec for now. Feel free to post your suggestions as another PR. |
Change layout of mountpoints and mounts
I think Go's attribute syntax reads more clearly here, especially since there is no 'Spec.MountPoints' after c18c283 (Change layout of mountpoints and mounts, 2015-09-02, opencontainers#136). Signed-off-by: W. Trevor King <[email protected]>
c18c283 (Change layout of mountpoints and mounts, 2015-09-02, opencontainers#136) removed the destination field from the Go type and examples, but forgot to remove it from the documentation [1]. Fix that with this commit. [1]: opencontainers#109 (comment) Reported-by: 梁辰晔 (Liang Chenye) <[email protected]> Signed-off-by: W. Trevor King <[email protected]>
If we don't specify this, some bundle-authors or runtime-implementers
might expect the runtime to intelligently order mounts to get the
"right" order [1]. But that's not possible because:
$ mkdir -p a/b/c d/e/f h
# mount --bind a/b h
# mount --bind d a/b
$ tree --charset=ascii h
h
`-- c
But in the other order:
# umount a/b
# umount h
# mount --bind d a/b
# mount --bind a/b h
$ tree --charset=ascii h
h
`-- e
`-- f
So there's no "right" order. Allowing the bundle-author to specify
their intended order is both easy to implement and unambiguous.
[1]: opencontainers#136 (comment)
Suggested-by: Lai Jiangshan <[email protected]>
Signed-off-by: W. Trevor King <[email protected]>
'destination' has been the path inside the container since c18c283 (Change layout of mountpoints and mounts, 2015-09-02, opencontainers#136). My personal preference is to have an explicit pivot root and allow paths relative to the current working directory [1], but that would be a big shift from the current OCI spec. The only way the current spec lets you turn off the root pivot is by not setting a mount namespace at all (and even then, it's not clear if that turns off the pivot). And the config's root entry is required (despite my attempts to have it made optional [2]), it's not really clear how containers that don't set a mount namespace are supposed to work if they're supported at all. You might be able to get away with something like: When a mount namespace is not set, destination paths are relative to the runtime's initial working directory (or relative to the config.json, or whatever). When a mount namespace is set, destination paths are relative to the mount namespace's root. but with mount-namespace-less containers already so unclear, it seems better to just require absolute destinations. If/when we get clearer support for explicit pivot-root calls or containers that inherit the host mount namespace (without re-joining it and losing their old working directory), we can consider lifting the absolute-path restriction. [1]: https://github.com/wking/ccon/tree/v0.4.0#mount-namespace [2]: https://groups.google.com/a/opencontainers.org/forum/#!topic/dev/6ZKMNWujDhU Date: Wed, 26 Aug 2015 12:54:47 -0700 Subject: Dropping the rootfs requirement and restoring arbitrary bundle content Message-ID: <[email protected]> Signed-off-by: W. Trevor King <[email protected]>
'destination' has been the path inside the container since c18c283 (Change layout of mountpoints and mounts, 2015-09-02, opencontainers#136). My personal preference is to have an explicit pivot root and allow paths relative to the current working directory [1], but that would be a big shift from the current OCI spec. The only way the current spec lets you turn off the root pivot is by not setting a mount namespace at all (and even then, it's not clear if that turns off the pivot). And the config's root entry is required (despite my attempts to have it made optional [2]), so it's not really clear how containers that don't set a mount namespace are supposed to work (if they're supported at all). You might be able to get away with something like: When a mount namespace is not set, destination paths are relative to the runtime's initial working directory (or relative to the config.json, or whatever). When a mount namespace is set, destination paths are relative to the mount namespace's root. but with mount-namespace-less containers already so unclear, it seems better to just require absolute destinations. If/when we get clearer support for explicit pivot-root calls or containers that inherit the host mount namespace (without re-joining it and losing their old working directory), we can consider lifting the absolute-path restriction. [1]: https://github.com/wking/ccon/tree/v0.4.0#mount-namespace [2]: https://groups.google.com/a/opencontainers.org/forum/#!topic/dev/6ZKMNWujDhU Date: Wed, 26 Aug 2015 12:54:47 -0700 Subject: Dropping the rootfs requirement and restoring arbitrary bundle content Message-ID: <[email protected]> Signed-off-by: W. Trevor King <[email protected]>
Added info about MountPoints to config.md.
Filled after discuss in opencontainers/runc#242
I noticed that
MountPointsstill has json tagmounts, should I rename it tomountPoints?