Skip to content
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

Windows: OCI process struct and console size to uint #26579

Merged
merged 1 commit into from
Sep 19, 2016

Conversation

lowenna
Copy link
Member

@lowenna lowenna commented Sep 14, 2016

Signed-off-by: John Howard jhoward@microsoft.com

Convergence closer to OCI compliance - this modifies the Process struct definition in the hacked OCI spec used on Windows to match the existing structure from https://github.com/opencontainers/runtime-spec/blob/master/specs-go/config.go#L30-L54, but also adding the initialConsoleSize field which is required on Windows submitted to OCI as opencontainers/runtime-spec#563.

As a result of opencontainers/runtime-spec#563 (comment), have changed the docker codebase to use uint instead of int for the console size throughout.

There is one further update which will be required (and simplify the code by no longer needing to cast from uint to int in the Windows libcontainerd files) after microsoft/hcsshim#67 is merged, and a revendor of https://github.com/Microsoft/hcsshim is done in docker.

There are no functional changes in the PR.

@lowenna lowenna force-pushed the jjh/ociprocess branch 4 times, most recently from 0fd4f5f to a3701ad Compare September 15, 2016 19:35
@lowenna lowenna changed the title Windows: OCI process struct convergence Windows: OCI process struct and console to uint Sep 15, 2016
@lowenna lowenna changed the title Windows: OCI process struct and console to uint Windows: OCI process struct and console size to uint Sep 15, 2016
@lowenna
Copy link
Member Author

lowenna commented Sep 17, 2016

@mlaventure @tonistiigi @stevvooe PTAL. Thanks.

@@ -313,7 +313,7 @@ type HostConfig struct {
Runtime string `json:",omitempty"` // Runtime to use with this container

// Applicable to Windows
ConsoleSize [2]int // Initial console size
ConsoleSize [2]uint // Initial console size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wish ConsoleSize would have been 2 fields initially, but changing it now would break compatibility.

Could you specify in the comment which order they are supposed to be in the array? (i.e. is it Height, Width or Width, Height)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mlaventure Updated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, thinking about this, I don't have to deal with back compat on Windows yet. I'll change it to a structure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mlaventure Updated to use type Box as per this comment in the matching OCI spec PR (opencontainers/runtime-spec#563 (comment)). Also updated it to ConsoleSize as per opencontainers/runtime-spec#563 (comment), dropping Initial. I'll open a follow-up PR to update the HCSShim APIs to also use a structure and re-vendor with the changes once this one is in.

@lowenna lowenna force-pushed the jjh/ociprocess branch 2 times, most recently from 415a19a to b8b60f9 Compare September 19, 2016 16:09
Copy link
Contributor

@mlaventure mlaventure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: John Howard <jhoward@microsoft.com>
@thaJeztah
Copy link
Member

all green, merging

@thaJeztah thaJeztah merged commit 8c508ef into moby:master Sep 19, 2016
@thaJeztah thaJeztah added this to the 1.13.0 milestone Sep 19, 2016
@lowenna lowenna deleted the jjh/ociprocess branch September 19, 2016 20:59
@runcom
Copy link
Member

runcom commented Sep 20, 2016

@jhowardmsft @mlaventure @tonistiigi @thaJeztah this commit broke backward compatibility - old users cannot post anymore an [2]int and get cannot unmarshal array into Go value of type container.Box. There should be some sort of backward compatibility

@runcom
Copy link
Member

runcom commented Sep 20, 2016

we should check API version for this 537744#diff-49c513a9f9836642d75d7f8478e8f521R316

@mlaventure
Copy link
Contributor

@runcom, yes it was in one of my comment.

But, if I'm not mistaken, the Windows support is only going to be considered "stable" once Windows Server 2016 RTM is released.

@mlaventure
Copy link
Contributor

Oh, damned. Just realized this is part of the common HostConfig struct 😓

@runcom
Copy link
Member

runcom commented Sep 20, 2016

Oh, damned. Just realized this is part of the common HostConfig struct

:) wanna take a peek at this? I'm going ahead and fix it if I can

@lowenna
Copy link
Member Author

lowenna commented Sep 20, 2016

Ugh. I can fix unless you have something already in progress @runcom?

@lowenna
Copy link
Member Author

lowenna commented Sep 20, 2016

Oh hang on, there's no need to fix this, unless it's broken Linux? Windows compatibility doesn't matter.

@runcom
Copy link
Member

runcom commented Sep 20, 2016

Oh hang on, there's no need to fix this, unless it's broken Linux? Windows compatibility doesn't matter.

@jhowardmsft it's broken on linux as well :( I'm trying to find some time to fix this tomorrow morning - buried into something

@lowenna
Copy link
Member Author

lowenna commented Sep 20, 2016

Don't worry - I'll fix shortly. Sorry for not thinking about that.

dnephin pushed a commit to dnephin/docker that referenced this pull request Apr 17, 2017
Windows: OCI `process` struct and console size to uint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants