Commit graph

44587 commits

Author SHA1 Message Date
Sebastiaan van Stijn
6cef06b940
validate: add yamllint validation
validate other YAML files, such as the ones used in the documentation,
and GitHub actions workflows, to prevent issues such as;

- 30295c1750
- 8e8d9a3650

With this patch:

    hack/validate/yamllint
    Congratulations! yamllint config file formatted correctly
    Congratulations! YAML files are formatted correctly

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-29 19:52:56 +02:00
Sebastiaan van Stijn
91bb776bb8
validate: yamllint: ignore "truthy value should be one of" warnings
Suppresses warnings like:

    LANG=C.UTF-8 yamllint -c hack/validate/yamllint.yaml -f parsable .github/workflows/*.yml
    .github/workflows/ci.yml:7:1: [warning] truthy value should be one of [false, true] (truthy)
    .github/workflows/windows.yml:7:1: [warning] truthy value should be one of [false, true] (truthy)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-29 19:51:43 +02:00
Sebastiaan van Stijn
cc2134ea83
validate: yamllint: set locale in config file
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-29 19:51:41 +02:00
Sebastiaan van Stijn
f679d8c821
validate: yamllint: use "parsable" output
Before:

    10030:81  error    line too long (89 > 80 characters)  (line-length)

After:

    api/swagger.yaml:10030:81: [error] line too long (89 > 80 characters) (line-length)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-29 19:51:39 +02:00
Sebastiaan van Stijn
5f114b65b4
validate: yamllint rename config-file
Don't make the file hidden, and add .yaml extension, so that editors
pick up the right formatting :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-29 19:51:38 +02:00
Sebastiaan van Stijn
1d7cd76ee9
Dockerfile: update yamllint to v1.27.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-29 19:51:35 +02:00
Sebastiaan van Stijn
939451554f
Merge pull request #44035 from crazy-max/ci-rm-win-2019
ci(windows): move windows-2019 to another workflow
2022-08-29 18:18:33 +02:00
Sebastiaan van Stijn
5e0599cb6e
pkg/jsonmessage: export "Stream" interface
This interface is used as part of an exported function's signature,
so exporting the interface as well for callers to know what the argument
must have implemented.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-29 16:15:37 +02:00
Sebastiaan van Stijn
2640aec0d7
pkg/system: make IsAbs() platform-agnostic
filepath.IsAbs() will short-circuit on Linux/Unix, so having a single
implementation should not affect those platforms.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-27 15:11:27 +02:00
CrazyMax
65fdd10d4e
ci(windows): move windows-2019 to another workflow
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-08-26 14:25:09 +02:00
Sebastiaan van Stijn
3e8573a85a
Merge pull request #44040 from thaJeztah/containerd_binary_1.6.8
update containerd binary to v1.6.8
2022-08-26 13:06:29 +02:00
Sebastiaan van Stijn
cefc89e5a5
Merge pull request #44037 from thaJeztah/update_runc_1.1.4
update runc to v1.1.4
2022-08-26 13:05:17 +02:00
Sebastiaan van Stijn
80e0fc4901
Merge pull request #44045 from crazy-max/fix-ci-workflow
ci: fix broken workflow
2022-08-26 08:27:40 +02:00
CrazyMax
8e8d9a3650
ci: fix broken workflow
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-08-26 04:30:04 +02:00
Sebastiaan van Stijn
6373de3304
Merge pull request #44036 from benlangfeld/patch-1
Upgrades buildx to 0.9.1
2022-08-26 02:23:23 +02:00
Cory Snider
8b748bd326 daemon: stop health checks before deleting task
Prevent new health check probes from racing the task deletion. This may
have been a root cause of containers taking so long to stop on Windows.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-08-25 20:03:42 -04:00
Cory Snider
d0731af939 Unskip TestHealthCheckProcessKilled on Windows
Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-08-25 19:51:41 -04:00
Sebastiaan van Stijn
f7277806c8
vendor: github.com/klauspost/compress v1.15.9
various fixes in zstd compression

- https://github.com/klauspost/compress/releases/tag/v1.15.9
- https://github.com/klauspost/compress/releases/tag/v1.15.8
- https://github.com/klauspost/compress/releases/tag/v1.15.7
- https://github.com/klauspost/compress/releases/tag/v1.15.6
- https://github.com/klauspost/compress/releases/tag/v1.15.5
- https://github.com/klauspost/compress/releases/tag/v1.15.4
- https://github.com/klauspost/compress/releases/tag/v1.15.3
- https://github.com/klauspost/compress/releases/tag/v1.15.2

full diff: https://github.com/klauspost/compress/compare/v1.15.1...v1.15.9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-26 01:46:28 +02:00
Sebastiaan van Stijn
d52ffce38f
update containerd binary to v1.6.8
release notes: https://github.com/containerd/containerd/releases/tag/v1.6.8

full diff: https://github.com/containerd/containerd/compare/v1.6.7...v1.6.8

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-26 00:31:43 +02:00
Akihiro Suda
bd98bf38e9
update runc to v1.1.4
release notes: https://github.com/opencontainers/runc/releases/tag/v1.1.4

full diff: https://github.com/opencontainers/runc/compare/v1.1.3...v1.1.4

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-26 00:21:24 +02:00
Ben Langfeld
5dcaad0dd3
Upgrades buildx to 0.9.1
v0.9.0 included regressions. Release notes: https://github.com/docker/buildx/releases/tag/v0.9.1

Signed-off-by: Ben Langfeld <blangfeld@powerhrg.com>
2022-08-25 19:14:16 -03:00
Sebastiaan van Stijn
1808c67d53
Merge pull request #44028 from thaJeztah/bump_buildkit
vendor: github.com/moby/buildkit v0.10.4
2022-08-26 00:12:32 +02:00
Sebastiaan van Stijn
c500d8824d
vendor: github.com/moby/buildkit v0.10.4
release notes: https://github.com/moby/buildkit/releases/tag/v0.10.4

full diff: https://github.com/moby/buildkit/compare/8e2d9b9006ca...v0.10.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-25 21:33:08 +02:00
Sebastiaan van Stijn
6217f8001e
gha: temporarily pin BuildKit integration test version
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-25 21:32:05 +02:00
Tianon Gravi
0ec426a57b
Merge pull request #43564 from corhere/libcontainerd-overhaul
Refactor libcontainerd to minimize containerd RPCs
2022-08-25 11:51:42 -07:00
Samuel Karp
5f698d1121
Merge pull request #44020 from thaJeztah/client_remove_withdialer 2022-08-25 10:34:16 -07:00
Cory Snider
a09f8dbe6e daemon: Maintain container exec-inspect invariant
We have integration tests which assert the invariant that a
GET /containers/{id}/json response lists only IDs of execs which are in
the Running state, according to GET /exec/{id}/json. The invariant could
be violated if those requests were to race the handling of the exec's
task-exit event. The coarse-grained locking of the container ExecStore
when starting an exec task was accidentally synchronizing
(*Daemon).ProcessEvent and (*Daemon).ContainerExecInspect to it just
enough to make it improbable for the integration tests to catch the
invariant violation on execs which exit immediately. Removing the
unnecessary locking made the underlying race condition more likely for
the tests to hit.

Maintain the invariant by deleting the exec from its container's
ExecCommands before clearing its Running flag. Additionally, fix other
potential data races with execs by ensuring that the ExecConfig lock is
held whenever a mutable field is read from or written to.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-08-24 19:35:07 -04:00
Sebastiaan van Stijn
fa2799804c
Merge pull request #44030 from thaJeztah/fix_inspect
daemon: getInspectData(): skip graphdriver data for snapshotters
2022-08-24 21:30:25 +02:00
Cory Snider
15b8e4a490 integration: synchronize TestWaitConditions
Modifying the builtin Windows runtime to send the exited event
immediately upon the container's init process exiting, without first
waiting for the Compute System to shut down, perturbed the timings
enough to make TestWaitConditions flaky on that platform. Make
TestWaitConditions timing-independent by having the container wait
for input on STDIN before exiting.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-08-24 14:59:08 -04:00
Cory Snider
18e322bc7c Lock container when deleting its root directory
Attempting to delete the directory while another goroutine is
concurrently executing a CheckpointTo() can fail on Windows due to file
locking. As all callers of CheckpointTo() are required to hold the
container lock, holding the lock while deleting the directory ensures
that there will be no interference.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-08-24 14:59:08 -04:00
Cory Snider
6a2f385aea Share logic to create-or-replace a container
The existing logic to handle container ID conflicts when attempting to
create a plugin container is not nearly as robust as the implementation
in daemon for user containers. Extract and refine the logic from daemon
and use it in the plugin executor.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-08-24 14:59:08 -04:00
Cory Snider
4bafaa00aa Refactor libcontainerd to minimize c8d RPCs
The containerd client is very chatty at the best of times. Because the
libcontained API is stateless and references containers and processes by
string ID for every method call, the implementation is essentially
forced to use the containerd client in a way which amplifies the number
of redundant RPCs invoked to perform any operation. The libcontainerd
remote implementation has to reload the containerd container, task
and/or process metadata for nearly every operation. This in turn
amplifies the number of context switches between dockerd and containerd
to perform any container operation or handle a containerd event,
increasing the load on the system which could otherwise be allocated to
workloads.

Overhaul the libcontainerd interface to reduce the impedance mismatch
with the containerd client so that the containerd client can be used
more efficiently. Split the API out into container, task and process
interfaces which the consumer is expected to retain so that
libcontainerd can retain state---especially the analogous containerd
client objects---without having to manage any state-store inside the
libcontainerd client.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-08-24 14:59:08 -04:00
Cory Snider
57d2d6ef62 Update container OOMKilled flag immediately
The OOMKilled flag on a container's state has historically behaved
rather unintuitively: it is updated on container exit to reflect whether
or not any process within the container has been OOM-killed during the
preceding run of the container. The OOMKilled flag would be set to true
when the container exits if any process within the container---including
execs---was OOM-killed at any time while the container was running,
whether or not the OOM-kill was the cause of the container exiting. The
flag is "sticky," persisting through the next start of the container;
only being cleared once the container exits without any processes having
been OOM-killed that run.

Alter the behavior of the OOMKilled flag such that it signals whether
any process in the container had been OOM-killed since the most recent
start of the container. Set the flag immediately upon any process being
OOM-killed, and clear it when the container transitions to the "running"
state.

There is an ulterior motive for this change. It reduces the amount of
state the libcontainerd client needs to keep track of and clean up on
container exit. It's one less place the client could leak memory if a
container was to be deleted without going through libcontainerd.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-08-24 14:59:07 -04:00
Cory Snider
b75246202a Stop locking container exec store while starting
The daemon.containerd.Exec call does not access or mutate the
container's ExecCommands store in any way, and locking the exec config
is sufficient to synchronize with the event-processing loop. Locking
the ExecCommands store while starting the exec process only serves to
block unrelated operations on the container for an extended period of
time.

Convert the Store struct's mutex to an unexported field to prevent this
from regressing in the future.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-08-24 14:59:07 -04:00
Sebastiaan van Stijn
ce550fa9c2
Merge pull request #43968 from thaJeztah/implement_GetImageOpts
introduce GetImageOpts to manage image inspect data in backend
2022-08-24 19:07:30 +02:00
Sebastiaan van Stijn
92d2e12a4d
daemon: getInspectData(): reduce cyclomatic complexity
Use an early return if looking up metadata fails.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-24 18:20:29 +02:00
Djordje Lukic
313a7d716d
daemon: getInspectData(): skip graphdriver data for snapshotters
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-24 18:07:49 +02:00
Sebastiaan van Stijn
68d7736e9e
Merge pull request #44011 from thaJeztah/test_detect_snapshotter
integration-cli: add utility to check if snapshotters are enabled
2022-08-24 17:03:42 +02:00
Sebastiaan van Stijn
74b84d00b3
integration-cli: add utility to check if snapshotters are enabled
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-24 14:03:15 +02:00
Sebastiaan van Stijn
500c026818
Merge pull request #43983 from thaJeztah/daemon_configurable_snapshotter
daemon: make the snapshotter configurable
2022-08-24 14:02:27 +02:00
Cory Snider
0cbb92bcc5
daemon: capture output of killed health checks
Add an integration test to verify that health checks are killed on
timeout and that the output is captured.

Co-authored-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Cory Snider <csnider@mirantis.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-24 13:59:34 +02:00
Sebastiaan van Stijn
c7d74a2366
Merge pull request #44026 from zhangyoufu/libnetwork-ipvlan-fix
libnetwork/drivers/ipvlan: fix missing IpvlanFlag field in config JSON
2022-08-24 13:45:09 +02:00
Youfu Zhang
549d24b437 libnetwork/drivers/ipvlan: fix missing IpvlanFlag field in config JSON
Fixes #42542

Signed-off-by: Youfu Zhang <zhangyoufu@gmail.com>
2022-08-24 16:23:32 +08:00
Sebastiaan van Stijn
ab37723fa2
Merge pull request #44017 from corhere/timestamp-daemon-etw-logs
ci: print Windows daemon event log timestamps
2022-08-24 01:16:25 +02:00
Sebastiaan van Stijn
e14924570c
client: remove deprecated WithDialer() option
It was deprecated in edac92409a, which
was part of 18.09 and up, so should be safe by now to remove this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-23 23:27:35 +02:00
Sebastiaan van Stijn
7f0cf432e9
client: remove redundant pluginPermissionDenied
It was only used in a single location, and only a "convenience" type,
not used to detect a specific error.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-23 23:21:21 +02:00
Sebastiaan van Stijn
c3f0cd7457
client: remove deprecated IsErrUnauthorized, IsErrNotImplemented
These were deprecated in ee230d8fdd,
which is in the 22.06 branch, so we can safely remove it from
master to have them removed in the release after that.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-23 23:21:19 +02:00
Sebastiaan van Stijn
6b7974cf16
Merge pull request #43739 from ndeloof/healthcheck_timeout
don't use canceled context to send KILL signal to healthcheck process
2022-08-23 22:00:54 +02:00
Cory Snider
23b8fcc74d ci: print Windows daemon event log timestamps
Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-08-23 14:16:21 -04:00
Cory Snider
4b84a33217
daemon: kill exec process on ctx cancel
Terminating the exec process when the context is canceled has been
broken since Docker v17.11 so nobody has been able to depend upon that
behaviour in five years of releases. We are thus free from backwards-
compatibility constraints.

Co-authored-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Cory Snider <csnider@mirantis.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-23 15:35:30 +02:00