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

Remove --read-only restriction when user ns enabled #25540

Merged
merged 1 commit into from Sep 14, 2016

Conversation

estesp
Copy link
Contributor

@estesp estesp commented Aug 9, 2016

The restriction is no longer necessary given changes at the runc layer
related to mount options of the rootfs. Also cleaned up the docs on
restrictions left for userns enabled mode. Re-enabled tests related to
--read-only when testing a userns-enabled daemon in integration-cli.

Docker-DCO-1.1-Signed-off-by: Phil Estes estesp@linux.vnet.ibm.com (github: estesp)

Changelog entry: Use of --read-only is no longer restricted from use when user namespaces are enabled in the Docker engine. Requires modern kernel which does not restrict remount as read-only in a user namespace.

func testReadOnlyFile(c *check.C, filenames ...string) {
// Not applicable on Windows which does not support --read-only
testRequires(c, DaemonIsLinux, NotUserNamespace)
func testReadOnlyFile(c *check.C, testPriv bool, filenames ...string) {
touch := "touch " + strings.Join(filenames, " ")
Copy link
Contributor

Choose a reason for hiding this comment

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

doesnt this still want testRequires(c, DaemonIsLinux)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's only called from a function that already has that testRequires on Linux, so seemed reasonable to remove it. Actually felt lazy, because maybe this function is not necessary as it is only called from the one test.. don't know the history...

@justincormack
Copy link
Contributor

The userns failure looks real... (if odd)

@estesp
Copy link
Contributor Author

estesp commented Aug 9, 2016

Oh yuck.. looks like there may be environmental issues that make this not a home run across all distros/setups? :( Definitely not having the dev remount error on Ubuntu 16.04 LTS

@estesp
Copy link
Contributor Author

estesp commented Aug 9, 2016

Hey @mrunalp, do you have any thoughts on this re: kernel and/or distro peculiarities?

@mrunalp
Copy link
Contributor

mrunalp commented Aug 9, 2016

@estesp No, I don't really have a matrix :/ I can try on few Fedoras and RHELs and get back.

@mrunalp
Copy link
Contributor

mrunalp commented Aug 9, 2016

@estesp I think we'll have to figure out the minimum supported kernel to do this.

@thaJeztah thaJeztah added the status/failing-ci Indicates that the PR in its current state fails the test suite label Aug 9, 2016
@estesp
Copy link
Contributor Author

estesp commented Aug 9, 2016

@mrunalp: I wonder if it is 3.19? Given this specific change around dev remount? torvalds/linux@87c31b3#diff-3fbed1fd4d15699b74b30cabf5be8133L2100

@estesp
Copy link
Contributor Author

estesp commented Aug 23, 2016

I feel like it would be good to get rid of the restriction with a note that, like other Docker capabilities, may rely on a specific kernel level for proper operation. Should I break out the test re-enable into a separate PR and have a discussion about whether some CI systems should be testing more modern kernels + features enabled by those kernels? ping @docker/core-engine-maintainers

@mrunalp
Copy link
Contributor

mrunalp commented Aug 23, 2016

I like that idea as it can be used where possible.

Sent from my iPhone

On Aug 22, 2016, at 6:59 PM, Phil Estes notifications@github.com wrote:

I feel like it would be good to get rid of the restriction with a note that, like other Docker capabilities, may rely on a specific kernel level for proper operation. Should I break out the test re-enable into a separate PR and have a discussion about whether some CI systems should be testing more modern kernels + features enabled by those kernels? ping @docker/core-engine-maintainers


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@cpuguy83
Copy link
Member

cpuguy83 commented Sep 8, 2016

Any update?

@estesp
Copy link
Contributor Author

estesp commented Sep 8, 2016

@cpuguy83 I'm happy to update the PR to remove the test enablement until we figure out CI strategy for more modern kernel testing.. but was hoping for more than just @mrunalp's opinion, although I value it highly :) :)

@estesp estesp force-pushed the ro-plus-userns branch 2 times, most recently from 7010266 to 1e781fa Compare September 9, 2016 16:02
@estesp
Copy link
Contributor Author

estesp commented Sep 9, 2016

Ok, updated with a compromise--added a integration-cli requirement that checks for RO mount capability when user namespaces enabled. This way the tests run on as many platforms as will support it and are only skipped if the kernel is too old to deal with RO mounts + userns.

if os.Getenv("DOCKER_REMAP_ROOT") == "" {
return true
}
if _, _, err := dockerCmdWithError("run", "--read-only", "busybox", "date"); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm guessing you also need to run this with --rm or make sure its cleaned up correctly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

argh. yup

@estesp estesp removed the status/failing-ci Indicates that the PR in its current state fails the test suite label Sep 9, 2016
The restriction is no longer necessary given changes at the runc layer
related to mount options of the rootfs. Also cleaned up the docs on
restrictions left for userns enabled mode. Re-enabled tests related to
--read-only when testing a userns-enabled daemon in integration-cli.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
@crosbymichael
Copy link
Contributor

LGTM

@vdemeester
Copy link
Member

LGTM 🐸
Moving to docs-review
/cc @thaJeztah @SvenDowideit @sfsmithcha

@SvenDowideit
Copy link
Contributor

Docs LGTM - though it needs a release note

@thaJeztah
Copy link
Member

LGTM

@estesp can you write a short line for the changelog, and add it to your top description?

@thaJeztah thaJeztah merged commit 8ac2000 into moby:master Sep 14, 2016
@estesp estesp deleted the ro-plus-userns branch September 14, 2016 18:32
@estesp
Copy link
Contributor Author

estesp commented Sep 14, 2016

@thaJeztah added, thx!

@thaJeztah
Copy link
Member

Thanks @estesp 😃

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.

None yet

9 participants