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

Add readonly option for mount #868

Merged
merged 1 commit into from
Jun 23, 2017
Merged

Add readonly option for mount #868

merged 1 commit into from
Jun 23, 2017

Conversation

aminjam
Copy link
Contributor

@aminjam aminjam commented May 31, 2017

hcsshim supports readonly option.

Signed-off-by: Amin Jamali [email protected]

config.md Outdated
@@ -79,6 +79,7 @@ For Solaris, the mount entry corresponds to the 'fs' resource in the [zonecfg(1M
* **`options`** (array of strings, OPTIONAL) Mount options of the filesystem to be used.
* Linux: supported options are listed in the [mount(8)][mount.8] man page. Note both [filesystem-independent][mount.8-filesystem-independent] and [filesystem-specific][mount.8-filesystem-specific] options are listed.
* Solaris: corresponds to "options" of the fs resource in [zonecfg(1M)][zonecfg.1m].
* Windows: "ro" (readonly) is the only supported option for Windows.
Copy link
Contributor

Choose a reason for hiding this comment

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

Without any RFC 2119 wording, this wording places no compliance conditions on either runtimes or config JSON. I'd rather see wording like:

  • Windows: runtimes MUST support ro, mounting the filesystem read-only when ro is given.

Then:

  • Windows runtimes are free to add support for additional options if they want.
  • Config authors know they can rely on ro support in compliant Windows runtimes.

The drawback to allowing extensions is that configs that typo rp or some such won't always fail compliance testing. You can cover that case with stricter-than-required validation (e.g the --base level in my opencontainers/image-tools#66 proposal) though, so I don't think it's worth MUSTing configs to only use ro.

The other platform entries for options aren't currently great examples of this, although I hope to revive #771 if/when opencontainers/runc#1460 lands, and that would help the Linux case.

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 Should we just change the wording to be the following?

Windows: runtimes MUST support ro, mounting the filesystem read-only when ro is given.

If ro is not a great option, is there a better replacement we should consider?

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just change the wording to be the following?

Windows: runtimes MUST support ro, mounting the filesystem read-only when ro is given.

I'd suggested backticks around the literal ro, but other than that your line looks like my suggestion. So yes, I think that's what you should change the wording to.

If ro is not a great option, is there a better replacement we should consider?

I have no opinion on the value. ro is what Linux uses for this concept, but I'm fine with Windows using whatever it likes.

@wking
Copy link
Contributor

wking commented May 31, 2017

PullApprove doesn't like the mismatch between author and signer (previous instance of this due to git-duet here, see also git-duet/git-duet#51).

$ git show origin/pr/868 | grep '<'
Author: Mark DeLillo <[email protected]>
    Signed-off-by: Amin Jamali <[email protected]>

@aminjam
Copy link
Contributor Author

aminjam commented May 31, 2017

@wking We have made the changes as suggested.

@crosbymichael
Copy link
Member

@aminjam Why is this option so special that it needs to be called out specifically for windows? It seems kinda weird that we would make a big deal about it.

@sunjayBhatia
Copy link
Contributor

@crosbymichael Windows containers are enabled by the Host Compute Service. It only makes a few options available for mounts, one of which is read only.

This PR enables the end user to set that flag which gets passed through to HCS. Without a set of defined values that are supposed to produce well defined behavior on the mount, an implementation of the spec won't be able to take the values provided and translate them into settings on the mount.

@crosbymichael
Copy link
Member

@sunjayBhatia do you have a list of the supported options somewhere?

@sunjayBhatia
Copy link
Contributor

@crosbymichael the only current possible/relevant options are here: https://github.com/Microsoft/hcsshim/blob/master/interface.go#L29-L33

We chose to supply ro because it is the only option that is comparable to the Linux/Solaris options

@wking
Copy link
Contributor

wking commented Jun 1, 2017 via email

@sunjayBhatia
Copy link
Contributor

@wking

With only one Windows runtime in the works

We are working on a runtime implementation separate from docker

I am similarly confused about why credentialSpec is "implementation defined" as that doesn't make this feel like a "standard"

@crosbymichael
Copy link
Member

So windows only supports the ro options and we can consider the other bandwidth options as "mount data"?

@wking
Copy link
Contributor

wking commented Jun 1, 2017 via email

@sunjayBhatia
Copy link
Contributor

@crosbymichael not sure how to treat those, makes sense that the spec should support them at some level and they could be things any windows runtime could support because they will be built on HCS, so they could be options that have the MUST be supported label as well

@sunjayBhatia
Copy link
Contributor

@wking Docker could use our implementation just like it uses runc, not really up to us now of course

While these projects are not connected, it would be nice to have a runtime agnostic config as you say because any runtime built for Windows will for at least now be built with the same libraries/subsystem.

This field is just like other Windows fields where we have said "you have to support what HCS/hcsshim provides as configurable options"

@tianon
Copy link
Member

tianon commented Jun 21, 2017

This looks like it needs a rebase (although seems fine/sane to me).

Signed-off-by: Amin Jamali <[email protected]>
Signed-off-by: Mark DeLillo <[email protected]>
@sunjayBhatia
Copy link
Contributor

@tianon rebased the commit on top of master

@tianon
Copy link
Member

tianon commented Jun 23, 2017

LGTM

Approved with PullApprove

1 similar comment
@crosbymichael
Copy link
Member

crosbymichael commented Jun 23, 2017

LGTM

Approved with PullApprove

@crosbymichael crosbymichael merged commit 0b38a4c into opencontainers:master Jun 23, 2017
@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants