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: Add Hyper-V isolation fields #818

Merged
merged 1 commit into from
May 23, 2017

Conversation

lowenna
Copy link
Contributor

@lowenna lowenna commented May 12, 2017

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

Similar to #814, the Windows implementation of the docker daemon still passes a number of fields out of band from the OCI runtime spec. This PR addresses the fields required to support Hyper-V containers by adding them to the runtime spec.


* **`utilityvmpath`** *(string, OPTIONAL)* - specifies the path to the image used for the utility VM. If not supplied, the runtime will search the container filesystem layers from the bottom-most layer upwards, until it locates "UtilityVM", and default to that path.

* **`sandboxpath`** *(string)* - specifies the root of the path to the sandbox to be used for the container.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this REQUIRED or OPTIONAL? My very uninformed guess is that it is REQUIRED (if you set hyperv, you MUST set sandboxpath). In case it helps (if you like ABNF), I took a stab at explaining the property-definition syntax here (from #747).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wking Yes, you are correct it is REQUIRED if the Hyper-V structure is supplied. It's not REQUIRED though from a global spec perspective as the Hyper-V structure itself is optional. I took a look at the link, but I'm not entirely sure how I would represent that differently or how you suggest I alter this.

Copy link
Contributor

Choose a reason for hiding this comment

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

… but I'm not entirely sure how I would represent that differently or how you suggest I alter this.

I suggest you use:

* **`sandboxpath`** *(string, REQUIRED)* - specifies the root of the path to the sandbox to be used for the container.

The relevant section from the link is:

If an OPTIONAL parent property is an object with a REQUIRED child, the child is only REQUIRED if the parent is set. For example…

and the following example. For an example of this in the current spec, see mounts[].destination, where mounts is OPTIONAL, but any entry in that array MUST include destination.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, thanks. Updated.


## <a name="configWindowsHyperV" />HyperV

`hyperv` is an OPTIONAL field of the Windows configuration. If present, the container will be run with Hyper-V isolation. If omitted, the container will be run as a Windows Server container.
Copy link
Member

@tianon tianon May 18, 2017

Choose a reason for hiding this comment

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

Do you think it would be appropriate to replace will be with MUST be in these instances?
ala:

`hyperv` is an OPTIONAL field of the Windows configuration.
If present, the container MUST be run with Hyper-V isolation.
If omitted, the container MUST be run as a Windows Server container.

(Or another of our RFC-requirement words, if MUST is too strong; https://github.com/opencontainers/runtime-spec/blob/master/spec.md#notational-conventions)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tianon Sure, updated. I have to be honest it does feel a little strong, but there's nothing closer.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, if that feels too strong, maybe relaxing the second half to a SHOULD would be appropriate? ie, if Hyper-V is requested via config, the container either MUST run via Hyper-V, or there must be an error, but otherwise, the behavior can be determined by the runtime if necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On reflection, MUST is fine.

@lowenna
Copy link
Contributor Author

lowenna commented May 22, 2017

Rebased

@lowenna lowenna force-pushed the hyper-v branch 2 times, most recently from c872dc7 to f362d22 Compare May 23, 2017 04:39
@lowenna
Copy link
Contributor Author

lowenna commented May 23, 2017

Rebased again.

@lowenna
Copy link
Contributor Author

lowenna commented May 23, 2017

Also verified this update is correct in the context of the docker engine.

@tianon
Copy link
Member

tianon commented May 23, 2017

LGTM

Approved with PullApprove


The following parameters can be specified:

* **`utilityvmpath`** *(string, OPTIONAL)* - specifies the path to the image used for the utility VM. If not supplied, the runtime will search the container filesystem layers from the bottom-most layer upwards, until it locates "UtilityVM", and default to that path.

Choose a reason for hiding this comment

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

It would be nice to have an example of this field in the example below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TomSweeneyRedHat Yes, I thought about that, but it was a deliberate omission. The reason is that to give an example of something meaningful (except c:\\path\\to\\utilityvm) is difficult as we don't currently (Windows RS1 and RS2) ship any base image which doesn't include the utility vm image contained within the base image. I expect this to change (in fact will have to) when we support Linux containers on Windows in the RS3 timeframe though, but I still can't at this time provide anything meaningful. Does that make sense?

Choose a reason for hiding this comment

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

@jhowardmsft Thanks for the background info. Your call on this. If I was personally making the decision, I'd put in the sample that you had in your comment, it at least gets the idea into the users mind. I would ask though that once a real world sample can be given here that you loop back and either edit or add it. Cheers!

Copy link
Contributor Author

@lowenna lowenna May 23, 2017

Choose a reason for hiding this comment

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

How about I update the comment to

...specifies the path to the image used for the utility VM. This would be specified if using a base image which does not contain a utility VM image. If not supplied, the runtime will.... and add the example then? To be fair \\path\\to\\utilityvm is probably about as meaningful an example as I could get regardless 😸

@dqminh
Copy link
Contributor

dqminh commented May 23, 2017

Needs rebase now that the other windows PR was just merged 😢

@lowenna
Copy link
Contributor Author

lowenna commented May 23, 2017

@dqminh Fully expected, no worries at all. Rebased again.

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

tianon commented May 23, 2017

LGTM

(redux)

Approved with PullApprove

@crosbymichael
Copy link
Member

crosbymichael commented May 23, 2017

LGTM

Approved with PullApprove

@crosbymichael crosbymichael merged commit 2e588b3 into opencontainers:master May 23, 2017
@lowenna lowenna deleted the hyper-v branch May 23, 2017 19:47
@vbatts vbatts mentioned this pull request Jul 5, 2017
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