-
Notifications
You must be signed in to change notification settings - Fork 550
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
Add LayerFolders to Windows platform config #828
Add LayerFolders to Windows platform config #828
Conversation
PullApprove doesn't like your Signed-off-by [1]. I'm guessing that's
because the author is Sunjay Bhatia and the Signed-off-by is Matthew
Horan. If you're forwarding Matthew's original Signed-off-by, you can
use:
Signed-off-by: Matthew Horan <[email protected]>
Signed-off-by: Sunjay Bhatia <[email protected]>
Using clause (c) in the DCO [2,3].
[1]: https://pullapprove.com/opencontainers/runtime-spec/pull-request/828/
[2]: http://developercertificate.org
[3]: https://github.com/opencontainers/runtime-spec/blob/v1.0.0-rc5/README.md#sign-your-work
|
config-windows.md
Outdated
@@ -3,6 +3,21 @@ | |||
This document describes the schema for the [Windows-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). | |||
The Windows container specification uses APIs provided by the Windows Host Compute Service (HCS) to fulfill the spec. | |||
|
|||
## <a name="configWindowsLayerFolders" />LayerFolders | |||
|
|||
**`layerfolders`** (array of strings, REQUIRED) specifies a list of layer folders the container image relies on. The list is ordered from topmost layer to base layer. |
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.
Just to be clear, this is something that is not covered by mounts
or by image-spec unpacking? These layers need to be assembled by the runtime at container-creation time?
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.
These layers need to be assembled by the runtime at container-creation time?
Yes, this is true. As mentioned in #817 (comment), the underlying subsystem requires that a list of layer paths be passed to the kernel in order to spin up the container. These are not mounts, and I don't believe any functionality like image-spec unpacking is applicable in this case.
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.
For required arrays, you probably also want to require at least one entry (otherwise you might as well make the property OPTIONAL). See #769 for an example of the spec wording and minItems
JSON Schema I've used for that sort of thing before.
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.
Not my call, but it looks like the variables are all camelCase in here. Should this instead be "layerFolders"?
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.
thanks @wking @TomSweeneyRedHat, we made these changes and modified the commit for this PR
Thanks for the note about PullApprove. We use git-duet to automatically sign our commits when pairing, and it only adds a single sign-off which corresponds to the other pair. That doesn't work with the requirements of PullApprove. |
On Mon, May 15, 2017 at 12:51:53PM -0700, Sunjay Bhatia wrote:
Thanks for the note about PullApprove. We use git-duet…
I've filed git-duet/git-duet#51 in case they have any ideas about
making this easier for git-duet users.
|
@sunjayBhatia Thanks for submitting this - I was just about to add it myself! (@wking FYI, this is the last of the additions required for Windows - the complete set is #801, #814, #815, #816, #817 and #818) @sunjayBhatia There's a few issues here which need addressing. The type LayerOption struct {
// LayerFolderPath is the path to the current layer folder. Empty for Hyper-V containers.
LayerFolderPath string `json:",omitempty"`
// Layer paths of the parent layers
LayerPaths []string
} It also needs an update to |
@jhowardmsft I'm not sure I agree with including the The "current layer" (sandbox layer in With other config options, we have little choice to do anything other than bubble up the |
Updated |
(Taking back my LGTM for now -- @jhowardmsft tells me he's going to review and comment on this one. ❤️) |
@wking any more thoughts on this? |
@sunjayBhatia TL;DR LGTM (not a maintainer). I'm good with this change. However, addressing your comment above, it's slightly more complicated. We actually always need to populate a As for your comment about Edit - I'm actually going to add it as Edit2 - There's no reason to add it. From a spec perspective, it can be in the LayerFolders as the top-most layer. And split by the runtime into the HCS API. |
@@ -3,6 +3,22 @@ | |||
This document describes the schema for the [Windows-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). | |||
The Windows container specification uses APIs provided by the Windows Host Compute Service (HCS) to fulfill the spec. | |||
|
|||
## <a name="configWindowsLayerFolders" />LayerFolders | |||
|
|||
**`layerFolders`** (array of strings, REQUIRED) specifies a list of layer folders the container image relies on. The list is ordered from topmost layer to base layer. |
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.
This is the first instance (as far as I know) of a REQUIRED property that is a direct child of a platform property (windows
, in this case). Because REQUIRED is only “if the parent is set”, I think you'll want to adjust this section to say that windows
MUST be set when platform.os
is windows
.
Discussion in #830 may end up with platform
being removed entirely. If that lands first, it will change the phrasing for the windows
requirement, but requiring the windows
object for configs aimed at the windows
platform will still be something you want.
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.
Updated config.md
to specify that the windows
configuration section is required if the windows
platform is set. We can update this again if #830 lands before this PR.
Signed-off-by: Matthew Horan <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]>
@@ -328,7 +328,7 @@ Runtime implementations MAY support any valid values for platform-specific field | |||
* **`linux`** (object, OPTIONAL) [Linux-specific configuration](config-linux.md). | |||
This MAY be set if **`platform.os`** is `linux` and MUST NOT be set otherwise. | |||
* **`windows`** (object, OPTIONAL) [Windows-specific configuration](config-windows.md). | |||
This MAY be set if **`platform.os`** is `windows` and MUST NOT be set otherwise. | |||
This MUST be set if **`platform.os`** is `windows` and MUST NOT be set otherwise. |
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'm not entirely clear on the maintainers' preference for this (@mrunalp was going to document them), but it's possible that they'll want *Windows
changed to Windows
in the Go structure now that this property is required on one platform. At least, something like that was the reason given for not wanting pointers for User.UID
and User.GID
.
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.
Thats an interesting point. Will it be a little odd that the other platform specific fields are not pointers as well? I would expect the maintainers would like to keep these fields uniform.
@@ -430,6 +430,8 @@ type SolarisAnet struct { | |||
|
|||
// Windows defines the runtime configuration for Windows based containers, including Hyper-V containers. | |||
type Windows struct { | |||
// LayerFolders contains a list of absolute paths to directories containing image layers. | |||
LayerFolders []string `json:"layerFolders"` |
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.
Just spotted this. Should be all lower-case for consistency. And the config-windows.json schema file needs the matching update.
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.
Should be all lower-case for consistency.
There are currently some camelCase entries in config-windows.md
. For example, the network
properties.
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.
@darrenstahlmsft Could you open a PR to fix ^^
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.
@wking @jhowardmsft i modified the field name as per this suggestion, should I revert it back?
It looks like there are linux fields that use camel case as well.
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.
It looks like there are linux fields that use camel case as well.
The Linux config tries to consistently use camelCase. I don't know if the maintainers care what convention the Windows-only fields use; probably wait for them to weigh in.
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.
OK, lets leave this as is. I'll take an action item to clean up the casing once this is merged. Opened #857 to track.
@wking - Are you OK with this now? |
On Thu, May 25, 2017 at 10:58:34AM -0700, John Howard wrote:
@wking - Are you OK with this now?
I'm not familiar with the underlying tech, so I can't comment on that.
I've just been pushing for internal consistency, and that looks pretty
good to me with 284ab58. My only outstanding concern is the
discrepancy between pointer policy for windows and process.user.uid
[1], but Go types aren't part of the spec so we don't have to resolve
that discrepancy before landing this PR.
[1]: #828 (comment)
|
ping @mrunalp @vbatts @crosbymichael Could one of you review please. Thanks. 👍 |
I should note this is the last of the structural missing pieces in Windows for 1.0. I have proved now that the docker engine using the current spec plus this PR is fully functional. |
LGTM |
Thanks @tianon ❤️ |
LayerFolders is a property that is missing from the runtime spec that is required for all useful containers on Windows.
This issue mentions extending the runtime spec with "required" platform specific fields.