Uh oh!
There was an error while loading. Please reload this page.
Add LayerFolders to Windows platform config - #828
Conversation
wking
commented
May 15, 2017
via email
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 <mhoran@pivotal.io>
Signed-off-by: Sunjay Bhatia <sbhatia@pivotal.io>
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 |
| ## <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.
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.
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.
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.
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.
thanks @wking@TomSweeneyRedHat, we made these changes and modified the commit for this PR
sunjayBhatia
commented
May 15, 2017
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. |
wking
commented
May 15, 2017
via email
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. |
lowenna
commented
May 15, 2017
@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 typeLayerOptionstruct {
// LayerFolderPath is the path to the current layer folder. Empty for Hyper-V containers.LayerFolderPathstring`json:",omitempty"`// Layer paths of the parent layersLayerPaths []string
}It also needs an update to |
sunjayBhatia
commented
May 16, 2017
@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 |
sunjayBhatia
commented
May 16, 2017
Updated |
tianon
commented
May 17, 2017
(Taking back my LGTM for now -- @jhowardmsft tells me he's going to review and comment on this one. ❤️) |
sunjayBhatia
commented
May 22, 2017
@wking any more thoughts on this? |
sunjayBhatia
commented
May 22, 2017
@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. |
| ## <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.
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.
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 <mhoran@pivotal.io> Signed-off-by: Sunjay Bhatia <sbhatia@pivotal.io>
| 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.
I'm not entirely clear on the maintainers' preference for this (@mrunalpwas going to document them), but it's possible that they'll want *Windows changed to Windowsin 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.
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.
| // 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.
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.
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.
@darrenstahlmsft Could you open a PR to fix ^^
There was a problem hiding this comment.
@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.
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.
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.
lowenna
commented
May 25, 2017
@wking - Are you OK with this now? |
wking
commented
May 25, 2017
via email
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) |
lowenna
commented
May 25, 2017
ping @mrunalp@vbatts@crosbymichael Could one of you review please. Thanks. 👍 |
lowenna
commented
May 25, 2017
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. |
TomSweeneyRedHat
commented
May 26, 2017
LGTM |
lowenna
commented
May 30, 2017
lowenna
commented
May 30, 2017
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.