Commit Graph

32784 Commits

Author SHA1 Message Date
6623004cd4 integration/TestContainerShmNoLeak: use --iptables=false
As mentioned in commit 9e31938, test cases that use t.Parallel()
and start a docker daemon might step on each other toes as they
try to configure iptables during startup, resulting in flaky tests.

To avoid this, --iptables=false should be used while starting daemon.

Fixes: eaa5192856c1 ("Make container resource mounts unbindable")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: c125e10a0486623ba3badebf974ea6e582373151
Component: engine
2018-03-12 14:49:15 -07:00
09262890a9 Merge pull request #36523 from yolken-stripe/36521-configurable-logfile-perms
Make LogFile perms configurable
Upstream-commit: 241c904e6f5fff020890a7641558e83a209c0bbd
Component: engine
2018-03-12 15:07:23 +01:00
4afacfb791 Merge pull request #36489 from thaJeztah/fix-errdef-is
Change return for errdefs.getImplementer()
Upstream-commit: c74cd60473479bc4b857a1b97e4116fd5f0bfdb0
Component: engine
2018-03-12 10:04:41 -04:00
3179450003 Merge pull request #36546 from arm64b/multi-arch-support4Dockerfiles
Unify arch-specific Dockerfiles into multi-arch one
Upstream-commit: 1790ce52e96fd66621b5d8eb2e203203874a7921
Component: engine
2018-03-12 12:36:58 +01:00
d24c1e8528 Remove arch-suffix detection of Dockerfile
Since now we have only one Dockerfile, so the arch-specific suffix
of the Dockerfile is not needed anymore.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 8eb7ed673b687ae17e2c7df5dd40f8081c299bc2
Component: engine
2018-03-12 02:05:37 +00:00
e19b73b949 Arch-specific Dockerfile removal
Removing all the existing arch-specific Dockerfiles since we already
have a new multi-arch supported one as the replacement.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 162f9aee476bd204c2b0146c0128949182e8bd5e
Component: engine
2018-03-12 02:05:37 +00:00
56843d4319 Multiarch support for Dockerfile
This PR consolidates the existing arch-specific Dockerfiles into only
one file `Dockefile` to ease the code maintenance effort.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: f1701a741d77a92d28138944193e23aabfc74abe
Component: engine
2018-03-12 02:05:01 +00:00
de73b08b59 Merge pull request #36550 from dnephin/fix-diff-tests
Remove unnecessary diff tests
Upstream-commit: a575b0b1384b2ba89b79cbd7e770fbeb616758b3
Component: engine
2018-03-11 11:26:50 +09:00
02493cad47 Merge pull request #36526 from kolyshkin/ipc-ro
daemon/setMounts(): do not make /dev/shm ro
Upstream-commit: cda90892aaa03aab59848a79a701fd09b663c3cc
Component: engine
2018-03-10 10:30:22 -08:00
ef5c3d2c0a Merge pull request #36504 from dmcgowan/layer-store-remove-metastore-interface
layer: remove metadata store interface
Upstream-commit: b9cc5cba6964b565e8b2cf1ff50c3e946a924fc8
Component: engine
2018-03-10 12:22:08 +01:00
e11a0c3a06 Merge pull request #36519 from stevvooe/resilient-cpu-sampling
daemon/stats: more resilient cpu sampling
Upstream-commit: 623b1a5c3c7d6b4d6d5943b64bd9ae6a7813786e
Component: engine
2018-03-09 14:34:45 -08:00
1eac9f0c3c Remove unnecessary diff tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 038f3add5191240058c7a4154556553c5493ea44
Component: engine
2018-03-09 12:32:50 -05:00
0d25ace2cb Merge pull request #36539 from tophj-ibm/skip-oom-tests-ppc64le
[integration] skip ppc64le oom tests temporarily
Upstream-commit: c8f9e14b500b1b2e23e79c52ded0aee05579d9bc
Component: engine
2018-03-09 09:53:00 +01:00
e31b1923c7 Merge pull request #36506 from kolyshkin/pkg-mount-slice
pkg/mount: use sort.Slice
Upstream-commit: a21d5bf669571ffc7ad31b8df3c0a632dc207b78
Component: engine
2018-03-09 09:46:53 +01:00
671826c75d [integration] skip ppc64le oom tests for now
These tests were enabled by changing a config option on the ci
machines, instead of from a patch, so let me disable them
for now on ppc64le and open up another patch to enable them, where I can find
out what the issues are with them.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 620ddc78a1437feaa42f40853ef586d268991620
Component: engine
2018-03-08 17:51:37 -06:00
11d01cef44 daemon/setMounts(): do not make /dev/shm ro
It has been pointed out that if --read-only flag is given, /dev/shm
also becomes read-only in case of --ipc private.

This happens because in this case the mount comes from OCI spec
(since commit 7120976d74195), and is a regression caused by that
commit.

The meaning of --read-only flag is to only have a "main" container
filesystem read-only, not the auxiliary stuff (that includes /dev/shm,
other mounts and volumes, --tmpfs, /proc, /dev and so on).

So, let's make sure /dev/shm that comes from OCI spec is not made
read-only.

Fixes: 7120976d74195 ("Implement none, private, and shareable ipc modes")

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: cad74056c09f6276b0f4a996a1511553177cd3d7
Component: engine
2018-03-08 14:04:03 -08:00
d36dd1e792 daemon/oci_linux_test: add TestIpcPrivateVsReadonly
The test case checks that in case of IpcMode: private and
ReadonlyRootfs: true (as in "docker run --ipc private --read-only")
the resulting /dev/shm mount is NOT made read-only.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 33dd562e3acff71ee18a2543d14fcbecf9bf0e62
Component: engine
2018-03-08 14:04:03 -08:00
d56f856549 Merge pull request #36518 from seemethere/fix_static_builds
Build containerd, runc, and proxy statically
Upstream-commit: 0c01629e17752749b32422e327d47764ce23baac
Component: engine
2018-03-08 13:59:34 +01:00
7856345e7b Merge pull request #36505 from kolyshkin/pkg-mount-tests
pkg/mount unit tests: skip some test under non-root
Upstream-commit: 4a1d35c546c4a5df3353f5984d86671f702a315a
Component: engine
2018-03-08 17:27:31 +09:00
882fe67e01 Make logfile perms configurable
Signed-off-by: Benjamin Yolken <yolken@stripe.com>
Upstream-commit: d0c1287a8d3aa0391b4e8bfbe867ec8f0e639a51
Component: engine
2018-03-07 15:18:51 -08:00
3398cf7be9 buildmod => buildmode
There was a typo with the buildmode flag for containerd

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 5e4885b9afb1de30133627ce751af2c0e7b72a4e
Component: engine
2018-03-07 21:36:23 +00:00
b6d64a77d2 Build containerd, runc, and proxy statically
These were originally static binaries in the first place, this changes
them back to that.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 63c7bb24637fdbfd905096ecc75b435ecefd31e9
Component: engine
2018-03-07 21:29:10 +00:00
aa0ca25049 daemon/stats: more resilient cpu sampling
To avoid noise in sampling CPU usage metrics, we now sample the system
usage closer to the actual response from the underlying runtime. Because
the response from the runtime may be delayed, this makes the sampling
more resilient in loaded conditions. In addition to this, we also
replace the tick with a sleep to avoid situations where ticks can backup
under loaded conditions.

The trade off here is slightly more load reading the system CPU usage
for each container. There may be an optimization required for large
amounts of containers but the cost is on the order of 15 ms per 1000
containers. If this becomes a problem, we can time slot the sampling,
but the complexity may not be worth it unless we can test further.

Unfortunately, there aren't really any good tests for this condition.
Triggering this behavior is highly system dependent. As a matter of
course, we should qualify the fix with the users that are affected.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: fd0e24b7189374e0fe7c55b6d26ee916d3ee1655
Component: engine
2018-03-07 13:20:21 -08:00
1158d96fc9 Merge pull request #36307 from kolyshkin/dm-misc
devmapper cleanup improvements
Upstream-commit: bc7424b4434443b036604277bfcdee3fa34a268a
Component: engine
2018-03-07 12:57:21 -08:00
2c2dcf7989 Merge pull request #36451 from Microsoft/jjh/ubr
Windows: Report Version and UBR
Upstream-commit: 8cf8fe9cf80a07d4e68829f619ea2c71fbb5af0c
Component: engine
2018-03-07 06:27:01 -08:00
9e6eb16d6f Merge pull request #36502 from thaJeztah/remove-duplicate-test
Remove duplicate TestServiceUpdatePort
Upstream-commit: f3a3778808dae0da82f2acf300875b5da931c000
Component: engine
2018-03-06 15:18:30 -08:00
c617524866 pkg/mount: use sort.Slice
Sorting by mount point length can be implemented in a more
straightforward fashion since Go 1.8 introduced sort.Slice()
with an ability to provide a less() function in place.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: a00310b54c0cdcafb402aeea92feca865da9fdf3
Component: engine
2018-03-06 12:46:58 -08:00
db90a864e8 pkg/mount unit tests: skip some test under non-root
This makes `go test .` to pass if run as non-root user, skipping
those tests that require superuser privileges (for `mount`).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 4aae77602a7540b4f977572f3fbdc0891ac57cab
Component: engine
2018-03-06 12:37:27 -08:00
18ad0fab61 Merge pull request #36494 from stevvooe/remove-unnecessary-types-file
daemon/stats: remove obnoxious types file
Upstream-commit: 4db41f1a69fc38337baaee9edb763a3672fa047c
Component: engine
2018-03-06 11:52:56 -08:00
b6580d6c65 Remove metadata store interface
Layer metadata storage has not been implemented outside of the layer
store and will be deprecated by containerd metadata storage. To prepare
for this and freeze the current metadata storage, remove the exported
interface and make it internal to the layer store.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 0aebcbc32dc6a7b35982a2bfc44335562cbb68ec
Component: engine
2018-03-06 10:42:00 -08:00
f51e800a06 Remove duplicate TestServiceUpdatePort
The TestAPIServiceUpdatePort test performs exactly
the same steps.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 36e1646e4f010ea033643c6df3d9c3dccc166ed2
Component: engine
2018-03-06 16:17:13 +01:00
0aaffbe844 Merge pull request #36417 from NobodyOnSE/patch-2
Whitelist statx syscall
Upstream-commit: f0694e968fe600efdf24ab0d3a1b0e887267aea2
Component: engine
2018-03-06 14:33:56 +01:00
062463b48b Merge pull request #36316 from selansen/36247
Fix to address regression caused by PR 30897
Upstream-commit: 0b0af855ae28698f8e3dc97cdc2a46e714ce6b6a
Component: engine
2018-03-06 13:40:29 +01:00
46b936e807 Merge pull request #36493 from cpuguy83/add_plugin_timeout_test
Adds a unit test for plugin request timeout
Upstream-commit: 390b74cb6376e70f9376b96a8a82557124e67a9b
Component: engine
2018-03-06 12:45:17 +01:00
c527ffbfcc Whitelist statx syscall for libseccomp-2.3.3 onward
Older seccomp versions will ignore this.

Signed-off-by: NobodyOnSE <ich@sektor.selfip.com>
Upstream-commit: b2a907c8cab64830c9e424eb1ec71e0429d326ff
Component: engine
2018-03-06 08:42:12 +01:00
cb84ae24c4 Merge pull request #36444 from yongtang/02142018-events-tests
Migrate events tests to api tests
Upstream-commit: 2f7a76a6a0959109e4438952c88c824078cea074
Component: engine
2018-03-06 08:36:30 +01:00
847ef0d3fb Merge pull request #36490 from yongtang/03052018-expected-actual
Address `expected` vs `actual` in integration tests
Upstream-commit: e02fa4a679c670d0745a1f828274297feb5a193c
Component: engine
2018-03-05 19:40:53 -08:00
ca48b9593b Merge pull request #36437 from kolyshkin/dm-unused
devmapper.Mounted: remove
Upstream-commit: a6b1d2ea297827d763de9e4b1940434e00a37883
Component: engine
2018-03-05 18:14:36 -08:00
0faba84bd7 Merge pull request #36474 from yongtang/03022018-rm-test
Migrate docker rm tests to api tests
Upstream-commit: da559d01d140978123c37f0f359c4aa5b022adb4
Component: engine
2018-03-05 17:15:26 -08:00
483e590861 Fix to address regression caused by PR 30897
With the inclusion of PR 30897, creating service for host network
    fails in 18.02. Modified IsPreDefinedNetwork check and return
    NetworkNameError instead of errdefs.Forbidden to address this issue

Signed-off-by: selansen <elango.siva@docker.com>
Upstream-commit: 7cf8b20762cc9491f52ff3f3d94c880378183696
Component: engine
2018-03-05 19:10:39 -05:00
804775ddc9 daemon/stats: remove obnoxious types file
While a `types.go` file is handly when there are a lot of record types,
it is completely obnoxious when used for concrete, utility types with a
struct, new function and method set in the same file. This change
removes the `types.go` file in favor of the simpler approach.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 244e59e94f153af82e6c3bd8a6c200a48d3cea60
Component: engine
2018-03-05 15:59:04 -08:00
666369f138 Merge pull request #36327 from Microsoft/jjh/block-pulling-uplevel
Windows: Block pulling uplevel images
Upstream-commit: 3e1505e3e671d35636f7818dc1f41e4a4d429620
Component: engine
2018-03-05 15:12:52 -08:00
04d932c6ce Fix definition of ErrSystem type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: d48392a35b157612d28c48eb8e4fad1272fa1442
Component: engine
2018-03-05 23:42:23 +01:00
a83b855a07 Change return for errdefs.getImplementer()
The types defined in the errdefs package do not
satisfy the `error` interface, because they do not
implement `Error()`.

Instead of returning the matched interface, return
the original error.

When matching _multiple_ interfaces/types, Golang doesn't complain:

    func getImplementer(err error) error {
        switch e := err.(type) {
        case
            ErrNotFound,
            ErrInvalidParameter:
            return e
        default:
            return err
        }
    }

But matching a single interface/type:

    func getImplementer(err error) error {
        switch e := err.(type) {
        case
            ErrNotFound:
            return e
        default:
            return err
        }
    }

Produces an error:

    cannot use e (type ErrNotFound) as type error in return argument: ErrNotFound does not implement error (missing Error method)

Return the original `err` instead of the matched interface/type instead.

Also added some additional tests

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 59854e407d1541d644a7d814e8e0096dc477dd82
Component: engine
2018-03-05 23:41:58 +01:00
391894bb6c Address expected vs actual in integration tests
This fix addresses `expected` vs `actual` in integration tests
so that they match `assert.Equal(t, expected, actual)`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 8a854e933b3dbb26cfce28b920cff61909412c6f
Component: engine
2018-03-05 20:39:42 +00:00
61babf754e Adds a unit test for plugin request timeout
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 7ca971fb495e4de4aa4455964625974464d86920
Component: engine
2018-03-05 15:38:56 -05:00
02ba73152d Migrate docker rm tests to api tests
This fix migrates docker rm test in integration-cli
to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: ed58ba99fb28ceac56063b7f003f38b597ddef80
Component: engine
2018-03-05 20:35:14 +00:00
fd6608a9da Merge pull request #36468 from vdemeester/e2e-container-run
Fixes some integration/container tests to run on remote daemon
Upstream-commit: 4b2fb7e394e8ee631394d6c12f8267065f39766b
Component: engine
2018-03-05 12:23:24 -08:00
8b5e7a334b devmapper.shutdown: optimize
Move the "unmount and deactivate" code into a separate method, and
optimize it a bit:

1. Do not use filepath.Walk() as there's no requirement to recursively
   go into every directory under home/mnt; a list of directories in mnt
   is sufficient. With filepath.Walk(), in case some container will fail
   to unmount, it'll go through the whole container filesystem which is
   excessive and useless.

2. Do not use GetMounts() and check if a directory is mounted; just
   unmount it and ignore "not mounted" error. Note the same error
   is returned in case of wrong flags set, but as flags are hardcoded
   we can safely ignore such case.

While at it, promote "can't unmount" log level from debug to warning.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: f1a459229724f5e8e440b49f058167c2eeeb2dc6
Component: engine
2018-03-05 10:08:56 -08:00
8f7dd9a1c4 devmapper cleanup: improve error msg
1. Make sure it's clear the error is from unmount.

2. Simplify the code a bit to make it more readable.

[v2: use errors.Wrap]
[v3: use errors.Wrapf]
[v4: lowercase the error message]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 9d00aedebc25507042c5afd4ab8fc6b333ca7c53
Component: engine
2018-03-05 10:08:56 -08:00