Commit Graph

10081 Commits

Author SHA1 Message Date
Sören Tempel
adee2c7974 seccomp: add support for "swapcontext" syscall in default policy
This system call is only available on 32- and 64-bit PowerPC, it is used
by modern programming language implementations to implement coroutine
features through userspace context switches.

moby [1] and systemd nspawn [2] already whitelist this system call so it
makes sense to whitelist it in containerd as well.

[1]: https://github.com/moby/moby/pull/43092
[2]: https://github.com/systemd/systemd/pull/9487

Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
2022-01-07 18:05:59 +01:00
Derek McGowan
3ccd43c8f6
Merge pull request #6396 from AkihiroSuda/refresh-token
remotes/docker: allow fetching "refresh token" (aka "identity token", "offline token")
2022-01-06 11:34:38 -08:00
Derek McGowan
857b35de6c
Merge pull request #6407 from dmcgowan/prepare-1.6.0-beta.5
Prepare release notes for v1.6.0-beta.5
2022-01-06 09:16:54 -08:00
Derek McGowan
8d5af6be80
Prepare release notes for v1.6.0-beta.5
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-01-05 12:05:49 -08:00
Phil Estes
1b8af3752d
Merge pull request #6292 from aznashwan/windows-integration-conditional-artefact-upload
Integration: Check GCP secrets on Windows CI artifact upload.
2022-01-05 12:37:40 -05:00
Derek McGowan
644a01e13b
Merge pull request from GHSA-mvff-h3cj-wj9c
only relabel cri managed host mounts
2022-01-05 09:30:58 -08:00
Derek McGowan
8937012208
Merge pull request #5439 from marquiz/devel/rdt
Add support for Intel RDT
2022-01-04 10:15:25 -08:00
Markus Lehtonen
9c2e3835fa cri: add ignore_rdt_not_enabled_errors config option
Enabling this option effectively causes RDT class of a container to be a
soft requirement. If RDT support has not been enabled the RDT class
setting will not have any effect.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2022-01-04 09:27:54 +02:00
Markus Lehtonen
eba1048163 Update dependencies
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2022-01-04 09:27:54 +02:00
Markus Lehtonen
f4a191917b cri: annotations for controlling RDT class
Use goresctrl for parsing container and pod annotations related to RDT.

In practice, from the users' point of view, this patchs adds support for
a container annotation and two separate pod annotations for controlling
the RDT class of containers.

Container annotation can be used by a CRI client:
  "io.kubernetes.cri.rdt-class"

Pod annotations for specifying the RDT class in the K8s pod spec level:
  "rdt.resources.beta.kubernetes.io/pod"
  (pod-wide default for all containers within)

  "rdt.resources.beta.kubernetes.io/container.<container_name>"
  (container-specific overrides)

Annotations are intended as an intermediate step before the CRI API
supports RDT.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2022-01-04 09:27:54 +02:00
Markus Lehtonen
eae14688c6 tasks: add Linux rdt support
Add support for configuring the Linux resctrl pseudo-filesystem with
goresctrl library. The functionality is integrated in the
"io.containerd.service.v1.tasks-service" plugin.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2022-01-04 09:27:54 +02:00
Markus Lehtonen
9e755d12e2 cmd: add --rdt-class command line option
A new option for setting the RDT class (or CLOS) from the command line.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2022-01-04 09:27:54 +02:00
Markus Lehtonen
2946db8903 oci: implement WithRdt
Helper for setting the (Linux) container's RDT parameters.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2022-01-04 09:27:54 +02:00
Fu Wei
4045b7ce86
Merge pull request #6391 from jonyhy96/fix-placeholder 2022-01-04 15:23:52 +08:00
Fu Wei
fcf956a9e1
Merge pull request #6403 from tklauser/timespec-unix 2022-01-04 15:23:13 +08:00
Derek McGowan
07aa42f427
Merge pull request #6207 from marquiz/devel/docs
docs: improve plugin documentation
2022-01-03 13:20:29 -08:00
Derek McGowan
bf60e2d174
Merge pull request #6304 from lippertmarkus/fix-ctr-cni-windows
fix(ctr): enable networking for Windows containers
2022-01-03 10:47:44 -08:00
Tobias Klauser
df21828d27
content/local: use syscall.Timespec.Unix
Use the syscall method instead of repeating the type conversions for
the syscall.Stat_t Atim/Atimespec members. This also allows to drop the
//nolint: unconvert comments.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2022-01-03 12:37:25 +01:00
Fu Wei
ff7fd4eb2e
Merge pull request #6394 from dcantah/fix-makefile 2021-12-30 09:17:21 +08:00
Fu Wei
3ab676ce22
Merge pull request #6395 from jonyhy96/fix-abstract 2021-12-28 18:13:34 +08:00
haoyun
85326d76f4 fix: only test abstract unix socket on linux
Signed-off-by: haoyun <yun.hao@daocloud.io>
2021-12-28 17:07:19 +08:00
Nashwan Azhari
90426378e3 Integration: Check GCP secrets on Windows CI artifact upload.
This patch makes the Windows Integration GitHub workflow conditionally
execute the CI artifact upload to GCP on successful runs iff the GitHub
secrets containing the GCP access info are defined.

Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
2021-12-27 19:15:46 +02:00
Akihiro Suda
97623ab0cd
remotes/docker: allow fetching "refresh token" (aka "identity token")
The new AuthorizerOpt `WithFetchRefreshToken` allows fetching "refresh token"
(aka "identity token", "offline token").

For HTTP GET mode (`FetchToken`), `offline_token=true` is set in the request.
https://docs.docker.com/registry/spec/auth/token/#requesting-a-token

For HTTP POST mode (`FetchTokenWithOAuth`), `access_type=offline` is set in the request.
https://docs.docker.com/registry/spec/auth/oauth/#getting-a-token

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-12-27 15:19:45 +09:00
Akihiro Suda
1a078e6893
Merge pull request #6390 from gabriel-samfira/fix-restart-container-test
Fix restart container test
2021-12-24 18:29:57 +09:00
Akihiro Suda
8094f50dd0
remotes/docker/config: allow setting custom AuthorizerOpts
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-12-24 18:17:40 +09:00
Daniel Canter
8e6afaa207 Fix $(PWD) issue for Windows makefile
Seems $(PWD) if the shell is powershell may not be inherited properly
as it ends up being an empty string. The result of this is that using
mingw's make with powershell is that $(PWD)/bin ends up being /bin and the
windows shim will get placed there. make install afterwards will try to find
the shim at $pwd/bin and fail.

Changing to CURDIR https://www.gnu.org/software/make/manual/make.html#index-CURDIR
seems to be a solution here as it's not inherited by the environment and
is set by make itself so should work across any type of shell.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-12-21 09:02:30 -05:00
Gabriel Adrian Samfira
653b8b02ad
Expect ErrorNotFound on Windows after Kill()
The "notready-sandbox" array will only have a CONTAINER_CREATED
and a CONTAINER_EXITED in the sandbox. So there will be no running
task to send a Kill() to. This means that on Windows, it will always
return an ErrorNotFound.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-21 11:17:49 +02:00
haoyun
ac81297065 fix: use _ for consistency
Signed-off-by: haoyun <yun.hao@daocloud.io>
2021-12-21 14:28:47 +08:00
Markus Lippert
f39b3ac7ea fix(ctr): enable networking for Windows containers
Signed-off-by: Markus Lippert <lippertmarkus@gmx.de>
2021-12-21 07:13:39 +01:00
Michael Crosby
653f2f1ce4
Merge pull request #6291 from ningmingxiao/dev1
fix when kernel version < 4.13rc1 by using index=off cause test error
2021-12-20 14:24:54 -05:00
Michael Crosby
3ae95e78a1
Merge pull request #6384 from dcantah/fix-nodaemon
Fix no-daemon flag for integration/client tests
2021-12-20 13:26:57 -05:00
Gabriel Adrian Samfira
0ff87a8929
Replace tskill with taskkill
This offers a more reliable way of killing a process. The /IM flag
allows us to specify the "image name" of the process we're killing.
This means we can use wildcards, foce kill a process and all the child
processes it may have spawned.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-20 18:33:36 +02:00
Maksym Pavlenko
fd07b03689
Merge pull request #6122 from alakesh/ext4_lazy 2021-12-18 11:13:59 -08:00
Derek McGowan
f41e5c7e1f
Merge pull request #6385 from gabriel-samfira/fix-list-stats-flake
Fix flakiness on Windows for list stats
2021-12-17 17:58:38 -08:00
Kevin Parsons
e0a433abfb
Merge pull request #6347 from gabriel-samfira/fix-windows-test-setup
cri-integration: Add Windows defaults and fix spaces issue
2021-12-17 11:49:03 -08:00
Gabriel Adrian Samfira
aadae6d50b
Fix flakiness on Windows for list stats
This change fixes flakiness on Windows for TestContainerListStatsWithSandboxIdFilter

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-17 17:38:37 +02:00
Daniel Canter
d53c431334 Fix no-daemon flag for integration/client tests
The global &daemon{} object only gets an address assigned if you call
start() on it, which only gets called if you don't pass no-daemon. The
aftermath of this is that running the integration tests with no-daemon
just has them fail trying to create a client for containerd.
This change just assigns whatever address is passed to the binary even in
the no-daemon case so you can run the integration tests against an already
running containerd instance.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-12-17 08:58:39 -05:00
Akihiro Suda
b93119501f
Merge pull request #6383 from kzys/otel-upgrade
Upgrade OpenTelemetry dependencies
2021-12-17 14:15:46 +09:00
Kazuyoshi Kato
5c2edeffbc Upgrade k8s.io/klog/v2 from 2.9.0 to 2.20.0
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-12-16 23:10:06 +00:00
Kazuyoshi Kato
2ee3ce510c Use insecure.NewCredentials instead of grpc.WithInsecure
grpc.WithInsecure is being deprecated.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-12-16 23:10:06 +00:00
Kazuyoshi Kato
2fb739aa21 Upgrade OpenTelemetry dependencies
This commit upgrades the packages under go.opentelemetry.io/.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-12-16 22:35:57 +00:00
Phil Estes
28ffedd06b
Merge pull request #6322 from dcantah/fix-makefile-windows
Fix default makefile target for windows
2021-12-16 16:39:17 -05:00
Daniel Canter
34c4abc341 Fix default makefile target for windows
A recent change altered the default target that would get run for the makefile.
This ended up making a standalone 'make' invocation only build the Windows
shim and nothing else. This was affecting the CI of some other projects that
relied on 'make' building containerd, ctr, and friends.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-12-16 06:08:04 -05:00
Phil Estes
e6dd97d9db
Merge pull request #6379 from dcantah/disable-TestContainerHook-Windows
Disable TestContainerHook on Windows
2021-12-15 23:18:09 -05:00
Derek McGowan
2c9d80aba5
Merge pull request #6372 from fidencio/wip/seutil-fix-container_kvm_t-type-detection
seutil: Fix setting the "container_kvm_t" label
2021-12-15 10:35:04 -08:00
Gabriel Adrian Samfira
78ad7a2d3a
cri-integration: Add Windows default paths
This change adds the following:

  * Default paths to REPORT_DIR, CONTAINERD_STATE and
CONTAINERD_ROOT for Windows
  * Removes the need for nssm on Windows. The nssm service
has issues dealing with paths that contain spaces. Also, the
containerd binary is perfectly capable of registering itself
as a service in Windows, and Windows itself can take care of
any failure handling of the service. NSSM is useful for binaries
that do not have any kind of Windows service logic built into
them. That is not the case of containerd.
  * Use wrapper functions that run containerd, ctr and criclt
with properly quoted paths to pipes, sockets, state and root dirs.
Currently, if the state and root dirs contain spaces in them, the
command line flags on both Windows and Linux are not properly set.
The wrapper functions will allow us to use the readiness_check
and keepalive functions to retry the commands, while properly
quoting the paths and avoiding eval.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-15 14:11:58 +02:00
Daniel Canter
abcf7c2f6a Disable TestContainerHook on Windows
OCI hooks aren't implemented on Windows. The test will, and has been,
actuallyrunning fine on Windows because the Github runners seem to have
a 'ps' binary in the users PATH, but there's not any actual hook
functionality being tested as any of the OCI fields are ignored for
Windows containers.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-12-14 17:35:02 -08:00
Kevin Parsons
3c3486f91b
Merge pull request #6350 from aznashwan/windows-integration-disable-2004
Remove Windows integration testing for 2004.
2021-12-14 13:17:35 -08:00
Michael Crosby
89437597ac
Merge pull request #6308 from thaJeztah/rootless_devices
OCI: Mount (accessible) host devices in privileged rootless containers
2021-12-14 15:21:31 -05:00
Phil Estes
949db57213
Merge pull request #6320 from endocrimes/dani/cri-swap
cri: add support for configuring swap
2021-12-14 15:02:28 -05:00