Commit Graph

12543 Commits

Author SHA1 Message Date
Nashwan Azhari
c883410c96
CI: Explicitly upgrade MinGW on Windows 2019 GitHub runners.
The default version of MinGW and GCC on the GitHub-hosted Windows 2019
runners compile fine but lead to linker errors during runtime.

Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
2023-08-17 16:52:51 +09:00
Akihiro Suda
0f043ae434
seccomp, apparmor: add go:noinline
Tests in pkg/cri/[sb]server/container_create_linux_test.go depends on go:noinline
since Go 1.21.

e.g.,
> ```
> === FAIL: pkg/cri/sbserver TestGenerateSeccompSecurityProfileSpecOpts/should_set_default_seccomp_when_seccomp_is_runtime/default (0.00s)
>     container_create_linux_test.go:1013:
>         	Error Trace:	/home/runner/work/containerd/containerd/pkg/cri/sbserver/container_create_linux_test.go:1013
>         	Error:      	Not equal:
>         	            	expected: 0x263d880
>         	            	actual  : 0x263cbc0
>         	Test:       	TestGenerateSeccompSecurityProfileSpecOpts/should_set_default_seccomp_when_seccomp_is_runtime/default
> ```

See comments in PR 8957.

Thanks to Wei Fu for analyzing this.

Co-authored-by: Wei Fu <fuweid89@gmail.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-17 16:52:51 +09:00
Akihiro Suda
5d9bf7d139
CI: temporarily disable ci_fuzz due to incompatibility with recent Go
> github.com/containerd/containerd/contrib/apparmor
> github.com/containerd/containerd/contrib/apparmor
> Running go-fuzz -tags gofuzz -func FuzzLoadDefaultProfile -o fuzz_FuzzLoadDefaultProfile.a github.com/containerd/containerd/contrib/apparmor
> /usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
> fuzz_FuzzLoadDefaultProfile.a(000021.o): in function `_cgo_9c8efe9babca_C2func_res_search':
> cgo_unix_cgo_res.cgo2.c:(.text+0x32): undefined reference to `__res_search'
> /usr/bin/ld: fuzz_FuzzLoadDefaultProfile.a(000021.o): in function `_cgo_9c8efe9babca_Cfunc_res_search':
> cgo_unix_cgo_res.cgo2.c:(.text+0x81): undefined reference to `__res_search'
> clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
> 2023-08-11 14:25:45,433 - root - ERROR - Building fuzzers failed.
> 2023-08-11 14:25:45,433 - root - ERROR - Error building fuzzers for (commit: 432d86b87f75cc8ddf8f8101a5540eb206ffc894, pr_ref: refs/pull/8957/merge).

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-17 16:52:48 +09:00
Samuel Karp
3b32d3c6f2
Merge pull request #8922 from lengrongfu/feat/sync-image-action
feat: replace mcr.microsoft.com registry to ghcr.io/containerd registry
2023-08-17 00:59:46 -07:00
Fu Wei
ba852faf41
Merge pull request #8954 from fuweid/fix-shim-leak 2023-08-17 08:16:20 +08:00
Fu Wei
a3c68d161f
Merge pull request #8778 from kiashok/stableABI_WindowsMatcher
Invoke stable ABI compliant platform check in windows matcher
2023-08-16 19:14:22 +08:00
Kirtana Ashok
823e0420eb Fix transfer service dependencies:
- Fill OSVersion field of ocispec.Platform for windows OS in
transfer service plugin init()
- Do not return error from transfer service ReceiveStream if
stream.Recv() returned context.Canceled error

Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2023-08-15 15:32:51 -07:00
Kirtana Ashok
cfb30a31a8 Invoke Stable ABI compatibility function in windows platform matcher
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2023-08-15 12:52:11 -07:00
Fu Wei
36b871955c
Merge pull request #8930 from AkihiroSuda/rocky8.8 2023-08-14 20:44:20 +08:00
Akihiro Suda
5e051f5c6c
Merge pull request #8955 from AkihiroSuda/runc-1.1.9
update runc to v1.1.9
2023-08-14 20:30:23 +09:00
Akihiro Suda
f8edd5555f
update runc binary to v1.1.9
https://github.com/opencontainers/runc/releases/tag/v1.1.9

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-11 21:25:56 +09:00
Akihiro Suda
f35d1f08ec
go.mod: github.com/opencontainers/runc v1.1.9
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-11 21:25:29 +09:00
Wei Fu
00ef8ba99b Vagrantfile: add strace tool
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-08-11 18:22:44 +08:00
Wei Fu
601699a184 integration: add ShouldRetryShutdown case based on #7496
Since the moby/moby can't handle duplicate exit event well, it's hard
for containerd to retry shutdown if there is error, like context
canceled.

In order to prevent from regression like #4769, I add skipped
integration case as TODO item and we should rethink about how to handle
the task/shim lifecycle.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-08-11 17:43:51 +08:00
Wei Fu
8dcb2a6e6d pkg/cri/sbserver: fix leaked shim issue for podsandbox mode
Fixes: #7496 #8931

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-08-11 17:43:51 +08:00
Wei Fu
72bc63d83d pkg/cri/server: fix leaked shim issue
Fixes: #7496 #8931

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-08-11 17:43:51 +08:00
Wei Fu
5bdd9ca938 integration: add case to reproduce #7496
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-08-11 17:41:04 +08:00
Akihiro Suda
70a2c95ae8
Merge pull request #8940 from kiashok/updateShimTag-main
Update hcsshim tag to v0.10.0
2023-08-10 10:38:25 +09:00
Kirtana Ashok
a645ff2e68 Update dependencies after protobuf update in hcsshim
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
(cherry picked from commit d129b6f890bceb56b050bbb23ad330bb5699f78c)
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2023-08-09 11:56:45 -07:00
Kirtana Ashok
e7e5619fed Update hcsshim tag to v0.10.0
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2023-08-09 11:55:54 -07:00
Akihiro Suda
90443f038d
CI: update Rocky Linux to 8.8
- UEFI now has to be enabled
- The root device is now `/dev/mapper/rocky-root`

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-08 18:58:24 +09:00
Fu Wei
165f8e414e
Merge pull request #8928 from oss-qm/submit/makefile-fix-go-command 2023-08-08 05:31:48 +08:00
Derek McGowan
720e027a97
Merge pull request #8917 from amghazanfari/main
delete checkout branch in doc
2023-08-07 14:09:09 -07:00
Phil Estes
649f356656
Merge pull request #8427 from AkihiroSuda/fedora38
CI: update Fedora to 38
2023-08-07 15:41:49 -04:00
Akihiro Suda
0a57dc2a02
CI: update Fedora to 38
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-08 03:15:44 +09:00
Akihiro Suda
30dd0a17f2
CI: install Vagrant from Hashicorp
Canonical's Vagrant 2.2.19 dpkg cannot download Fedora 38 image:
https://bugs.launchpad.net/vagrant/+bug/2017828

So we have to install Vagrant >= 2.3.1 from the upstream:
https://github.com/opencontainers/runc/blob/v1.1.8/.cirrus.yml#L41-L49

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-08 03:15:44 +09:00
Phil Estes
7688c4d008
Merge pull request #8929 from oss-qm/submit/makefile-override-revision
Makefile: allow REVISION be overwritten by environment
2023-08-07 14:07:43 -04:00
Akihiro Suda
ce22387b8f
Merge pull request #8919 from AkihiroSuda/vagrant-on-gha-larger
CI: move Vagrant tests to GitHub Actions (larger runners)
2023-08-08 01:07:12 +09:00
Enrico Weigelt, metux IT consult
965641dbc1 Makefile: allow REVISION be overwritten by environment
Required for distros that wanna use their local version and
can't have some (possibly failing) git commands being run here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2023-08-07 17:23:00 +02:00
Enrico Weigelt, metux IT consult
fc32197d43 Makefile: fix overriding go command
There still was one place that's calling the `go` command directly
instead of using the $(GO) variable.

Fixes: 9ea25634bd
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2023-08-07 17:21:47 +02:00
Akihiro Suda
2d3360ec71
CI: move Vagrant tests to GitHub Actions (larger runners)
We have been using Cirrus CI for running vagrant workloads
as the standard runners of GHA lacks nested virtualization,
but it looks like GHA with the "larger" runners support nested
virtualization.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-07 01:24:55 +09:00
rongfu.leng
4f3c8c4687 replace mcr.microsoft.com registry to ghcr.io/containerd registry
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
2023-08-06 21:14:07 +08:00
Amir M. Ghazanfari
fd8778fba3
delete checkout branch in doc
branch "pr/proto/draft" in NRI doesn't exist anymore it's better to delete this line 

Signed-off-by: Amir M. Ghazanfari <a.m.ghazanfari76@gmail.com>
2023-08-04 22:46:33 +03:30
Fu Wei
2b2195c36b
Merge pull request #8722 from marquiz/devel/cgroup-driver-autoconfig
cri: implement RuntimeConfig rpc
2023-08-04 16:09:34 +08:00
Markus Lehtonen
c62abcb146 docs: document CRI cgroup driver auto detection
Document the user visible changes related to the new RuntimeConfig RPC.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2023-08-04 09:48:29 +03:00
Phil Estes
40c85d6c09
Merge pull request #8897 from kinvolk/rata/userns-use-platform
cri/sbserver: Use platform instead of GOOS for userns detection
2023-08-02 16:12:02 -04:00
Maksym Pavlenko
e12128cebc
Merge pull request #8899 from tonistiigi/arm64-norm-docs
platforms: clarify docs for amd64/arm64 variant normalization
2023-08-02 12:02:43 -07:00
Rodrigo Campos
c80a3ecafd cri/sbserver: Use platform instead of GOOS for userns detection
In the sbserver we should not use the GOOS, as windows hosts can run
linux containers. On the sbserver we should use the platform param.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-08-02 12:32:05 +02:00
Phil Estes
e0912c068b
Merge pull request #8904 from thaJeztah/update_go1.20.7
update to go1.20.7, go1.19.12
2023-08-01 21:38:09 -04:00
Sebastiaan van Stijn
157dff2812
update to go1.20.7, go1.19.12
Includes a fix for CVE-2023-29409

go1.20.7 (released 2023-08-01) includes a security fix to the crypto/tls
package, as well as bug fixes to the assembler and the compiler. See the
Go 1.20.7 milestone on our issue tracker for details:

- https://github.com/golang/go/issues?q=milestone%3AGo1.20.7+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.20.6...go1.20.7

go1.19.12 (released 2023-08-01) includes a security fix to the crypto/tls
package, as well as bug fixes to the assembler and the compiler. See the
Go 1.19.12 milestone on our issue tracker for details.

- https://github.com/golang/go/issues?q=milestone%3AGo1.19.12+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.19.11...go1.19.12

From the mailing list announcement:

[security] Go 1.20.7 and Go 1.19.12 are released

Hello gophers,

We have just released Go versions 1.20.7 and 1.19.12, minor point releases.

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

- crypto/tls: restrict RSA keys in certificates to <= 8192 bits

  Extremely large RSA keys in certificate chains can cause a client/server
  to expend significant CPU time verifying signatures. Limit this by
  restricting the size of RSA keys transmitted during handshakes to <=
  8192 bits.

  Based on a survey of publicly trusted RSA keys, there are currently only
  three certificates in circulation with keys larger than this, and all
  three appear to be test certificates that are not actively deployed. It
  is possible there are larger keys in use in private PKIs, but we target
  the web PKI, so causing breakage here in the interests of increasing the
  default safety of users of crypto/tls seems reasonable.

  Thanks to Mateusz Poliwczak for reporting this issue.

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

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-01 23:57:32 +02:00
Phil Estes
9214c6403e
Merge pull request #8316 from davidhsingyuchen/partial-attach
fix: allow attaching to any combination of stdin/stdout/stderr
2023-08-01 14:47:53 -04:00
Hsing-Yu (David) Chen
687a5f51a8 fix: allow attaching to any combination of stdin/stdout/stderr
Before this PR, if a stdin/stdout/stderr stream is nil,
and the corresponding FIFO is not an empty string,
a panic will occur when Read/Write of the nil stream is invoked in io.CopyBuffer.

Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
2023-08-01 09:56:04 -07:00
Tonis Tiigi
aa8b094ab1
platforms: clarify docs for amd64/arm64 variant normalization
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-08-01 11:25:58 +03:00
Fu Wei
40f26543bd
Merge pull request #8885 from kinvolk/rata/runc-abs-path
cri: Don't use rel path for image volumes
2023-07-31 21:10:20 +08:00
Rodrigo Campos
2d64ab8d79 cri: Don't use rel path for image volumes
Runc 1.1 throws a warning when using rel destination paths, and runc 1.2
is planning to thow an error (i.e. won't start the container).

Let's just make this an abs path in the only place it might not be: the
mounts created due to `VOLUME` directives in the Dockerfile.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-07-31 12:33:54 +02:00
Markus Lehtonen
ed47d6ba76 cri: implement RuntimeConfig rpc
The rpc only reports one field, i.e. the cgroup driver, to kubelet.
Containerd determines the effective cgroup driver by looking at all
runtime handlers, starting from the default runtime handler (the rest in
alphabetical order), and returning the cgroup driver setting of the
first runtime handler that supports one. If no runtime handler supports
cgroup driver (i.e. has a config option for it) containerd falls back to
auto-detection, returning systemd if systemd is running and cgroupfs
otherwise.

This patch implements the CRI server side of Kubernetes KEP-4033:
https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/4033-group-driver-detection-over-cri

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2023-07-28 13:50:43 +03:00
Phil Estes
81895d22c9
Merge pull request #8867 from Iceber/pinned_image_label
cri: fix using the labels to pin image
2023-07-27 09:51:23 -04:00
Fu Wei
bdbcf96267
Merge pull request #8868 from AkihiroSuda/epoch-y2038
pkg/epoch: fix Y2038 on 32-bit hosts
2023-07-26 13:43:53 +08:00
Iceber Gu
7f7ba31b64 cri: fix using the pinned label to pin image
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2023-07-26 12:26:00 +08:00
Akihiro Suda
4807571352
pkg/epoch: fix Y2038 on 32-bit hosts
`strconv.Itoa(int(tm.Unix()))` rounds the time to 32-bit int on 32-bit hosts

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-07-26 13:17:39 +09:00