Commit Graph

12912 Commits

Author SHA1 Message Date
Artem Khramov
1fd3a46526
archive/tarheader: fix FreeBSD hdr for regular files
This update addresses an issue where the stat call on FreeBSD could
return -1 for regular files. This led to incorrect Devmajor and
Devminor values, which should be zero in such cases. Refer to the
discussion on this bug in the following PR:
https://github.com/containerd/containerd/pull/5991.

The code change now handles this scenario appropriately.

Signed-off-by: Artem Khramov <akhramov@pm.me>
2023-08-11 23:50:08 +03: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
rongfu.leng
b451fa96a6 bump client-go v0.26.4
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
2023-08-11 00:30:03 +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
rongfu.leng
54baf766e5 add metrics for discarding events
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
2023-08-09 09:56:26 +08:00
root
189a1599c0 archive/compression: update out of date RFC draft link
Signed-off-by: William Chen <willchen.005@gmail.com>
2023-08-08 13:08:02 -07:00
Enrico Weigelt, metux IT consult
cac8b6f4bd Makefile: allow overriding the binary executable target dir
Distros tend to change this to specific locations (eg. on MVCC installs),
therefore introduce a generic environment variable that's a common practise
since 30+ years and thus already well known and supported by distros.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2023-08-08 14:11:03 +02: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
Wei Fu
d41c62a556 .github/workflows: add dmesg step for integration-linux
It will be easy to debug flaky testcase if we can provide kernel log by
`dmesg -T -f kern`.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-08-06 18:13:17 +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
Wang Xinwen
710d987d29
Fix default platform matcher when ctr import
Signed-off-by: Wang Xinwen <wxw0504@outlook.com>
2023-07-31 22:17:25 +08: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
Sebastiaan van Stijn
85a2c9a01b
log: swap logrus functions with their equivalent on default logger
[`logrus.SetLevel()`][1], [`logrus.GetLevel()`][2] and [`logrus.SetFormatter()`][3]
are all convenience functions to configure logrus' standardlogger, which is the
logger to which we hold a reference in the Entry configured on [`log.L`][4].

This patch:

- swaps calls to `logrus.SetLevel`, `logrus.GetLevel` and `logrus.SetFormatter`
  for their equivalents on `log.L`. This makes it clearer what `SetLevel` does,
  and makes sure that we set the log-level of the logger / entry we define in
  our package (even if that would be swapped with a different instance).
- removes the use of `logrus.NewEntry` with directly constructing a `Entry`,
  using the local `Entry` alias (anticipating we can swap that type in future).

[1]: dd1b4c2e81/exported.go (L34C1-L37)
[2]: dd1b4c2e81/exported.go (L39-L42)
[3]: dd1b4c2e81/exported.go (L23-L26)
[4]: dd1b4c2e81/exported.go (L9-L16)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-30 23:21:33 +02:00
Sebastiaan van Stijn
6baff1694f
log: add package documentation and summary of package's purpose
Add a package doc to (try to) describe the purpose of this package, and
to describe the purpose (and expectations) of aliases provided by the
package.

> Package log provides types and functions related to logging, passing
> loggers through a context, and attaching context to the logger.
>
> # Transitional types
>
> This package contains various types that are aliases for types in [logrus].
> These aliases are intended for transitioning away from hard-coding logrus
> as logging implementation. Consumers of this package are encouraged to use
> the type-aliases from this package instead of directly using their logrus
> equivalent.
>
> The intent is to replace these aliases with locally defined types and
> interfaces once all consumers are no longer directly importing logrus
> types.
>
> IMPORTANT: due to the transitional purpose of this package, it is not
> guaranteed for the full logrus API to be provided in the future. As
> outlined, these aliases are provided as a step to transition away from
> a specific implementation which, as a result, exposes the full logrus API.
> While no decisions have been made on the ultimate design and interface
> provided by this package, we do not expect carrying "less common" features.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-30 22:55:37 +02:00
Sebastiaan van Stijn
238da2c525
log: make Fields type a generic map[string]any
Decouple it from logrus, but with the same type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-30 22:55:37 +02:00
Sebastiaan van Stijn
634a4a1bbf
log: add log.Entry type
Don't return logrus types from exported functions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-30 22:55:30 +02:00
Sebastiaan van Stijn
dd67240f1b
log: define OutputFormat type
Strong-type the format.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-30 22:36:00 +02:00
Sebastiaan van Stijn
778ac302b2
log: define G() as a function instead of a variable
The `G` variable is exported, and not expected to be overwritten
externally. Defining it as a function also documents it as a function
on https://pkg.go.dev, instead of a variable; https://pkg.go.dev/github.com/containerd/containerd@v1.6.22/log#pkg-variables

Note that (while the godoc suggests otherwise) I made `GetLogger` an alias
for `G`, as `G` is the most commonly used function (not the other way round),
although I don't think there's a performance gain in doing so.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-30 22:35:59 +02:00
Sebastiaan van Stijn
81ac648d91
log: add all log-levels that are accepted
While other log-levels are not currently used in containerd itself,
they can be returned by `GetLevel()`, and are accepted (no error) by
`SetLevel()`. We should either accept those values, or produce an
error (in `SetLevel()`), but given that there's other ways to set the
log-level, we should probably acknowledge that this package is a transitional
package, and still closely tied to logrus (for the time being).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-30 22:35:59 +02:00
Sebastiaan van Stijn
0b6333a412
log: group "enum" consts and touch-up docs
Also updated the level descriptions with their documentation from
logrus.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-30 22:35:59 +02:00