Skip to content

containers/create: use shareable ipc by default for older clients#38700

Closed
kolyshkin wants to merge 1 commit intomoby:masterfrom
kolyshkin:fix-older-clients-wrt-ipc
Closed

containers/create: use shareable ipc by default for older clients#38700
kolyshkin wants to merge 1 commit intomoby:masterfrom
kolyshkin:fix-older-clients-wrt-ipc

Conversation

@kolyshkin
Copy link
Contributor

Older (API < 1.32) clients are not aware of new IPC modes
(shareable, private, and none, introduced in commit 7120976 (PR #34087)
and expect a new container to be created with IPC mode that
is now known as shareable.

Since the above commit, daemon default can be set to private,
essentially locking out such older clients from being able to
share IPC between containers (i.e. using --ipc container:NNN).

So, with this patch, a client which does not set any value
for IPC mode, defaults to:

  • for API < 1.32: shareable;
  • for API >= 1.32: daemon's default-ipc-mode

@AkihiroSuda
Copy link
Member

CLI test failing

02:44:37 ----------------------------------------------------------------------
02:44:37 FAIL: docker_cli_daemon_test.go:2973: DockerDaemonSuite.TestDaemonRestartIpcMode
02:44:37 
02:44:37 [d6050514c6c8f] waiting for daemon to start
02:44:37 [d6050514c6c8f] daemon started
02:44:37 
02:44:37 docker_cli_daemon_test.go:2990:
02:44:37     c.Assert(m, checker.Equals, "private")
02:44:37 ... obtained string = "shareable"
02:44:37 ... expected string = "private"
02:44:37 
02:44:37 [d6050514c6c8f] exiting daemon

@cpuguy83
Copy link
Member

Let's take a step back here. I don't see why we should modify the client, are we doing something similar for other options?

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@cpuguy83
Copy link
Member

19:03:28 FAIL: docker_cli_daemon_test.go:2973: DockerDaemonSuite.TestDaemonRestartIpcMode
19:03:28 
19:03:28 [d77aa0cf0b918] waiting for daemon to start
19:03:28 [d77aa0cf0b918] daemon started
19:03:28 
19:03:28 docker_cli_daemon_test.go:2990:
19:03:28     c.Assert(m, checker.Equals, "private")
19:03:28 ... obtained string = "shareable"
19:03:28 ... expected string = "private"
19:03:28 
19:03:28 [d77aa0cf0b918] exiting daemon
19:03:29 

@kolyshkin
Copy link
Contributor Author

19:03:28 FAIL: docker_cli_daemon_test.go:2973: DockerDaemonSuite.TestDaemonRestartIpcMode

This test is failing as the API used is < 1.32 (basically confirming the patch works). Fix is coming :)

@kolyshkin kolyshkin force-pushed the fix-older-clients-wrt-ipc branch from 41fc1be to b472526 Compare February 19, 2019 03:17
@codecov
Copy link

codecov bot commented Feb 19, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@54dddad). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master   #38700   +/-   ##
=========================================
  Coverage          ?   36.55%           
=========================================
  Files             ?      610           
  Lines             ?    45394           
  Branches          ?        0           
=========================================
  Hits              ?    16593           
  Misses            ?    26507           
  Partials          ?     2294

@kolyshkin kolyshkin force-pushed the fix-older-clients-wrt-ipc branch from b472526 to 3237c17 Compare February 19, 2019 03:20
@kolyshkin
Copy link
Contributor Author

OK here's the test fix; please see individual commits description.

@kolyshkin
Copy link
Contributor Author

  1. exp ci failure in

01:05:06.642 FAIL: docker_api_swarm_test.go:297: DockerSwarmSuite.TestAPISwarmLeaderElection

is a known flaky test

  1. janky ci failure in

01:19:34.071 FAIL: docker_cli_daemon_test.go:118: DockerDaemonSuite.TestDaemonRestartUnlessStopped

is a recent flaky test (#38720)

Restarting both

@kolyshkin
Copy link
Contributor Author

kolyshkin commented Feb 19, 2019

(reserved for Derek commands)

@thaJeztah
Copy link
Member

Was the last commit only moving the test to the new test-suite, or were changes made as well related to this PR?

Perhaps it's better to move the general test-changes to a separate PR

@kolyshkin
Copy link
Contributor Author

Was the last commit only moving the test to the new test-suite, or were changes made as well related to this PR?

TL;DR: this change is needed here and can't be separated out (unless we merge it first).

Perhaps I was too brief in my commit description:

Move the test case from integration-cli to integration.
This makes it use the current API version.

The test logic itself has not changed, except these two things:

  • the new test sets default-ipc-mode via command line rather than via daemon.json (it doesn't matter);
  • the new test uses current API version.

The problem this move solves is, old integration-cli tests use old API version, and so the following code stopped working (see #38700 (comment)) after the changes in this PR:

  1. start a daemon with "private" default-ipc-mode;
  2. create a container without explicitly specifying its ipc mode;
  3. check its mode is shareable.

When old API is used, check in (3) fails.

@thaJeztah I can split the last commit to a separate PR if you want

@thaJeztah
Copy link
Member

My thinking was; do the general modernization of TestDaemonRestartIpcMode in a separate PR, and (in this PR) add the new test-case to the test

Older (API < 1.32) clients are not aware of new IPC modes
(`shareable`, `private`, and `none`, introduced in commit 7120976)
and expect a new container to be created with IPC mode that
is now known as `shareable`.

Since the above commit, daemon default can be set to `private`,
essentially locking out such older clients from being able to
share IPC between containers (i.e. using `--ipc container:NNN`).

So, with this patch, a client which does not set any value
for IPC mode, defaults to:

 * for API < 1.32: 'shareable';

 * for API >= 1.32: daemon's default-ipc-mode

An integration test is added to check this works as intended.

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin kolyshkin force-pushed the fix-older-clients-wrt-ipc branch from 3237c17 to 9f939ed Compare March 8, 2019 18:24
@kolyshkin
Copy link
Contributor Author

do the general modernization of TestDaemonRestartIpcMode in a separate PR, and (in this PR) add the new test-case to the test

Done, test move separated out to #38843, so this one is simple to review. The only catch is #38843 need to be merged first for this PR to pass CI.

@kolyshkin
Copy link
Contributor Author

Closing this in favor of last version of #35621

@kolyshkin kolyshkin closed this Mar 9, 2019
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.

6 participants