Commit graph

44698 commits

Author SHA1 Message Date
Tianon Gravi
8d9d5a3bb5
Merge pull request #43844 from Abirdcfly/master
fix minor code unreachability error
2022-08-12 17:12:15 -07:00
Tianon Gravi
9162840c1e
Merge pull request #43906 from thaJeztah/api_volume_list_options_part1
api: add types/volume.ListOptions for a more consistent API
2022-08-12 17:08:39 -07:00
Sebastiaan van Stijn
8925f735a1
daemon/config: fix GoDoc for StockRuntimeName
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-11 18:16:50 +02:00
Tianon Gravi
3a7fda78a2
Merge pull request #43942 from thaJeztah/rundaemon_windows_nit
cmd/dockerd: fix some minor issues in Windows implementation
2022-08-11 08:30:44 -07:00
Tianon Gravi
4d708225bd
Merge pull request #43945 from thaJeztah/libcontainer_supervisor_cleanups
libcontainerd/supervisor: refactoring and cleanup in preparation of custom containerd.toml
2022-08-11 08:28:54 -07:00
Sebastiaan van Stijn
226e07144e
cmd/dockerd: initContainerd() use early return
- return early if we're expecting a system-containerd
- rename `initContainerD` to `initContainerd` ':)
- remove .Config to reduce verbosity

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-11 14:11:10 +02:00
Sebastiaan van Stijn
6560e0b136
cmd/dockerd: initContainerD(): clean-up some logs
Change the log-level for messages about starting the managed containerd instance
to be the same as for the main API. And remove a redundant debug-log.

With this patch:

    dockerd
    INFO[2022-08-11T11:46:32.573299176Z] Starting up
    INFO[2022-08-11T11:46:32.574304409Z] containerd not running, starting managed containerd
    INFO[2022-08-11T11:46:32.575289181Z] started new containerd process                address=/var/run/docker/containerd/containerd.sock module=libcontainerd pid=5370
cmd/dockerd: initContainerD(): clean-up some logs

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-11 14:11:08 +02:00
Sebastiaan van Stijn
b6b0b0a05f
libcontainerd/supervisor: don't write log-level to config file
the `--log-level` flag overrides whatever is in the containerd configuration file;
f033f6ff85/cmd/containerd/command/main.go (L339-L352)

Given that we set that flag when we start the containerd binary, there is no need
to write it both to the generated config-file and pass it as flag.

This patch also slightly changes the behavior; as both dockerd and containerd use
"info" as default log-level, don't set the log-level if it's the default.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-11 14:11:06 +02:00
Sebastiaan van Stijn
bff3e85625
libcontainerd/supervisor: store location of config-file
Adding a remote.configFile to store the location instead of re-constructing its
location each time. Also fixing a minor inconsistency in the error formats.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-11 14:11:05 +02:00
Sebastiaan van Stijn
7a9791f096
libcontainerd/supervisor: store location of pidFile
Adding a remote.pidFile to store the location instead of re-constructing its
location each time. Also performing a small refactor to use `strconv.Itoa`
instead of `fmt.Sprintf`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-11 14:11:03 +02:00
Sebastiaan van Stijn
89ab14a115
libcontainerd/supervisor: make supervisor adjust OOM score for containerd
Containerd, like dockerd has a OOMScore configuration option to adjust its own
OOM score. In dockerd, this option was added when default installations were not
yet running the daemon as a systemd unit, which made it more complicated to set
the score, and adding a daemon option was convenient.

A binary adjusting its own score has been frowned upon, as it's more logical to
make that the responsibility of the process manager _starting_ the daemon, which
is what we did for dockerd in 21578530d7.

There have been discussions on deprecating the daemon flag for dockerd, and
similar discussions have been happening for containerd.

This patch changes how we set the OOM score for the containerd child process,
and to have dockerd (supervisor) set the OOM score, as it's acting as process
manager in this case (performing a role similar to systemd otherwise).

With this patch, the score is still adjusted as usual, but not written to the
containerd configuration file;

    dockerd --oom-score-adjust=-123
    cat /proc/$(pidof containerd)/oom_score_adj
    -123

As a follow-up, we may consider to adjust the containerd OOM score based on the
daemon's own score instead of on the `cli.OOMScoreAdjust` configuration so that
we will also adjust the score in situations where dockerd's OOM score was set
through other ways (systemd or manually adjusting the cgroup). A TODO was added
for this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-11 14:11:01 +02:00
Sebastiaan van Stijn
1d2a669445
libcontainerd/supervisor: use correct logger
Don't call logrus directly, but use the logger that was set.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-11 14:10:59 +02:00
Sebastiaan van Stijn
2d511f28f2
libcontainerd/supervisor: platformCleanup(): use canonical socket address
Consider Address() (Config.GRPC.Addres) to be the source of truth for
the location of the containerd socket.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-11 14:09:36 +02:00
Sebastiaan van Stijn
7b0bd43a27
libcontainerd/supervisor: remove unused remote.rootDir
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-10 23:14:39 +02:00
Sebastiaan van Stijn
6b7e19ff42
libcontainerd/supervisor: remove unused RWMutex
This RWMutex was added in 9c4570a958, and used in
the `remote.Client()` method. Commit dd2e19ebd5
split the code for client and daemon, but did not remove the mutex.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-10 23:14:35 +02:00
Sebastiaan van Stijn
44626eaf81
Merge pull request #43907 from thaJeztah/bump_swarmkit3
vendor: github.com/moby/swarmkit/v2 v2.0.0-20220721174824-48dd89375d0a, change "csi" to "cluster"
2022-08-10 12:01:30 +02:00
Brian Goff
4f08f8df1e
Merge pull request #43941 from thaJeztah/idtools_remove_deprecated
pkg/idtools: remove deprecated NewIdentityMapping, UIDS() and GIDS()
2022-08-09 17:47:32 -07:00
Sebastiaan van Stijn
37a241768d
cmd/dockerd: fix some minor issues in Windows implementation
- properly use filepath.Join() for Windows paths
- use getDaemonConfDir() to get the path for storing daemon.json
- return error instead of logrus.Fatal(). The logrus.Fatal() was a left-over
  from when Cobra was not used, and appears to have been missed in commit
  fb83394714, which did the conversion to Cobra.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-09 22:50:41 +02:00
Brian Goff
c8fc98937d
Merge pull request #43901 from thaJeztah/libcontainerd_cleanup_supervisor
libcontainerd/supervisor: clean up (dead) code
2022-08-09 12:02:17 -07:00
Sebastiaan van Stijn
df965f51bf
pkg/idtools: remove deprecated NewIdentityMapping, UIDS() and GIDS()
These were deprecated in 098a44c07f, which is
in the 22.06 branch, and no longer in use since e05f614267
so we can remove them from the master branch.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-09 18:03:29 +02:00
Sebastiaan van Stijn
9861dd069b
vendor: github.com/moby/swarmkit/v2 v2.0.0-20220721174824-48dd89375d0a
full diff: 6068d1894d...48dd89375d

Finishes off the work to change references to cluster volumes in the API
from using "csi" as the magic word to "cluster". This reflects that the
volumes are "cluster volumes", not "csi volumes".

Notably, there is no change to the plugin definitions being "csinode"
and "csicontroller". This terminology is appropriate with regards to
plugins because it accurates reflects what the plugin is.

Signed-off-by: Drew Erny <derny@mirantis.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-09 14:03:50 +02:00
Brian Goff
ad8d255bb9
Merge pull request #43922 from crazy-max/vendor-buildkit-2
vendor buildkit 8e2d9b9 (v0.10 branch)
2022-08-08 09:55:33 -07:00
Brian Goff
88d9ab1af5
Merge pull request #43934 from thaJeztah/rename_colliding_vars
daemon: rename variables that collided with imports
2022-08-08 09:17:09 -07:00
Sebastiaan van Stijn
7797480eb0
daemon, builder: rename variables that collided with imports
rename some variables that collided with imports or (upcoming)
changes, e.g. `ctx`, which is commonly used for `context.Context`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-08 13:16:10 +02:00
Sebastiaan van Stijn
acd0aa7d38
api/server/router/image: address some linter warnings
My IDE was complaining about some things;

- fix inconsistent receiver name (i vs s)
- fix some variables that collided with imports

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-08 13:07:50 +02:00
Sebastiaan van Stijn
f0680670d2
Merge pull request #43708 from thaJeztah/update_runc_binary
update runc binary to v1.1.3
2022-08-08 11:47:23 +02:00
Sebastiaan van Stijn
33b27e2cca
Merge pull request #43917 from thaJeztah/bump_containerd_1.6.7_binary
update containerd binary to v1.6.7
2022-08-08 09:50:20 +02:00
Tianon Gravi
7e44b7cddd
Merge pull request #43916 from thaJeztah/bump_containerd_1.6.7_vendor
vendor: github.com/containerd/containerd v1.6.7
2022-08-05 15:08:42 -07:00
CrazyMax
e05f614267
vendor buildkit 8e2d9b9 (v0.10 branch)
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-08-05 14:40:46 +02:00
Sebastiaan van Stijn
4e46d9f963
update containerd binary to v1.6.7
full diff: https://github.com/containerd/containerd/v1.6.6...v1.6.7

Welcome to the v1.6.7 release of containerd!

The seventh patch release for containerd 1.6 contains various fixes,
includes a new version of runc and adds support for ppc64le and riscv64
(requires unreleased runc 1.2) builds.

Notable Updates

- Update runc to v1.1.3
- Seccomp: Allow clock_settime64 with CAP_SYS_TIME
- Fix WWW-Authenticate parsing
- Support RISC-V 64 and ppc64le builds
- Windows: Update hcsshim to v0.9.4 to fix regression with HostProcess stats
- Windows: Fix shim logs going to panic.log file
- Allow ptrace(2) by default for kernels >= 4.8

See the changelog for complete list of changes

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-05 00:15:21 +02:00
Sebastiaan van Stijn
7376bf948b
vendor: github.com/containerd/containerd v1.6.7
full diff: https://github.com/containerd/containerd/v1.6.6...v1.6.7

Welcome to the v1.6.7 release of containerd!

The seventh patch release for containerd 1.6 contains various fixes,
includes a new version of runc and adds support for ppc64le and riscv64
(requires unreleased runc 1.2) builds.

Notable Updates

- Update runc to v1.1.3
- Seccomp: Allow clock_settime64 with CAP_SYS_TIME
- Fix WWW-Authenticate parsing
- Support RISC-V 64 and ppc64le builds
- Windows: Update hcsshim to v0.9.4 to fix regression with HostProcess stats
- Windows: Fix shim logs going to panic.log file
- Allow ptrace(2) by default for kernels >= 4.8

See the changelog for complete list of changes

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-05 00:12:38 +02:00
Sebastiaan van Stijn
1192b468e9
Merge pull request #43913 from thaJeztah/fix_api_swagger
api: swagger: fix invalid example value (API v1.39-v1.41)
2022-08-04 21:02:23 +02:00
Sebastiaan van Stijn
30295c1750
api: swagger: fix invalid example value (API v1.39-v1.41)
This was introduced in 43956c1bfc

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-04 17:49:07 +02:00
Abirdcfly
9031de6a9b fix minor code unreachability error
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-08-04 22:32:59 +08:00
Sebastiaan van Stijn
2279803c8c
Merge pull request #43822 from thaJeztah/image_load_save
containerd integration: Implement load/save
2022-08-04 13:45:27 +02:00
Sebastiaan van Stijn
a263241ea1
Merge pull request #43631 from thaJeztah/deprecate_buildcache_parent
api: deprecate BuildCache.Parent, add BuildCache.Parents in API >= v1.42
2022-08-04 13:19:02 +02:00
Sebastiaan van Stijn
68f27cdfc2
Merge pull request #43903 from thaJeztah/bump_go_1.18.5
Update golang to 1.18.5
2022-08-04 11:26:33 +02:00
Paweł Gronowski
5c96365c94
containerd: Unpack loaded images
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-04 11:07:12 +02:00
Nicolas De Loof
50fb999bb1
add image load/save support
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2022-08-04 09:41:19 +02:00
Sebastiaan van Stijn
43956c1bfc
api: swagger: document BuildCache fields (API v1.39-v1.41)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-04 09:30:19 +02:00
Sebastiaan van Stijn
5371c889a8
api: swagger: document BuildCache fields (API v1.42)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-04 09:30:17 +02:00
Sebastiaan van Stijn
e0db8207f3
api: add BuildCache.Parents for API >= v1.42
This field was added to replace the deprecated "Parent" field.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-04 09:30:06 +02:00
Sebastiaan van Stijn
ebf339628a
api: deprecate BuildCache.Parent in API >= v1.42
This field has been deprecated in BuildKit, so this follows the deprecation
in the Engine API.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-04 09:27:34 +02:00
Sebastiaan van Stijn
e0286d7f4e
api/types: add missing GoDoc for BuildCache fields.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-04 09:27:32 +02:00
Sebastiaan van Stijn
dc2b34af6a
api: swagger: document BuildCache fields.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-04 09:27:30 +02:00
Paweł Gronowski
d4579a983e
containerd/pull: Use authorization
- containerd/pull: Use authorization
- containerd/auth: Check if registry hostname matches

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2022-08-04 01:05:41 +02:00
Brian Goff
7e8df0e2c9
Merge pull request #43820 from thaJeztah/image_delete
containerd integration: Implement ImageDelete for containerd
2022-08-03 15:47:07 -07:00
Sebastiaan van Stijn
340711db3d
api: add types/volume.ListOptions for a more consistent API
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-03 23:30:28 +02:00
Tianon Gravi
e60bddcc60
Merge pull request #43885 from thaJeztah/auth_header_refactor
Move AuthConfig to types/registry, and implement utilities for encoding/decoding
2022-08-03 11:31:26 -07:00
Sebastiaan van Stijn
f1d71f7cc3
Update golang to 1.18.5
Update Go runtime to 1.18.5 to address CVE-2022-32189.

Full diff: https://github.com/golang/go/compare/go1.18.4...go1.18.5

--------------------------------------------------------

From the security announcement:
https://groups.google.com/g/golang-announce/c/YqYYG87xB10

We have just released Go versions 1.18.5 and 1.17.13, minor point
releases.

These minor releases include 1 security fixes following the security
policy:

encoding/gob & math/big: decoding big.Float and big.Rat can panic

Decoding big.Float and big.Rat types can panic if the encoded message is
too short.

This is CVE-2022-32189 and Go issue https://go.dev/issue/53871.

View the release notes for more information:
https://go.dev/doc/devel/release#go1.18.5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-08-03 20:08:21 +02:00