Commit Graph

12660 Commits

Author SHA1 Message Date
Fu Wei
e2bf34feaf
Merge pull request #9033 from dcantah/sberror-include-id
CRI: Include sandbox ID in failed to recover error
2023-09-02 10:48:34 +08:00
Akihiro Suda
74705ae4f4
Merge pull request #9045 from thaJeztah/less_libcontainer
remove uses of github.com/runc/libcontainer/cgroups
2023-09-02 07:56:41 +09:00
Akihiro Suda
5a6c32da38
Merge pull request #9041 from fuweid/enable-fuzz-build
.github: enable fuzz build
2023-09-02 07:47:32 +09:00
Phil Estes
6f2855ef0f
Merge pull request #9036 from kiashok/updateRunhcsVersion 2023-09-01 14:00:28 -04:00
Derek McGowan
dc8b0d80b9
Merge pull request #9042 from dcantah/darwin-blockfile-copyfile
Blockfile: Enlighten blockfile copy on Darwin
2023-09-01 07:18:44 -07:00
Sebastiaan van Stijn
5d31e93787
pkg/systemd: use sync.Once for systemd detection
This brings over the enhancement from a506630e57.

We don't expect the systemd state to change while containerd is running,
so we can use a `sync.Once` for this, to prevent stat'ing each time.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-01 12:14:56 +02:00
Sebastiaan van Stijn
7d0ab4fc2c
remove uses of github.com/runc/libcontainer/cgroups
runc considers libcontainer to be "unstable" (not for external use),
so we try not to use it. Commit ed47d6ba76
brought back the dependency on other parts of libcontainer, but looks to
be only depending on a single utility, which in itself was borrowed from
github.com/coreos/go-systemd to not introduce CGO code in the same package.

This patch copies the version from github.com/coreos/go-systemd (adding
proper attribution, although the function is pretty trivial).

runc is in process of moving the libcontainer/user package to an external
module, which means we can remove the dependency on libcontainer entirely
in the near future. There is one more use of `libcontainer` in our vendor
tree; it looks like CDI is depending on one utility (devices.DeviceFromPath);
a943033a8b/vendor/github.com/container-orchestrated-devices/container-device-interface/pkg/cdi/container-edits_unix.go (L38)

We should remove the dependency on that utility, and add a CI check to
prevent bringing it back.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-01 12:10:55 +02:00
Danny Canter
13ff185ba0 Blockfile: Enlighten blockfile copy on Darwin
The Go stdlib does not seem to have an efficient os.File.ReadFrom
routine for other platforms like it does on Linux with
copy_file_range. For Darwin at least we can use clonefile
in its place, otherwise if we have a sparse file we'd have
a fun surprise with the io.Copy approach..

We should see if there's other platforms that we can enhance here.
I've forgotten what's the right route on Windows.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-08-31 20:18:48 -07:00
Wei Fu
a3e8503ed2 .github: enable fuzz build
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-01 10:36:54 +08:00
Kazuyoshi Kato
a943033a8b
Merge pull request #9013 from fish98/main
fuzzing: fix ossfuzz building error
2023-08-31 16:10:43 -07:00
Kazuyoshi Kato
a617005750
Merge pull request #9028 from hinshun/fix/import-unpack-wait
Add missing unpacker.Wait for image import
2023-08-31 16:09:42 -07:00
Kirtana Ashok
02d519ad64 Update hcsshim tag in runhcs-version script
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2023-08-31 10:07:14 -07:00
Danny Canter
a2817ca16d CRI: Include sandbox ID in failed to load error
The failed to recover state message didn't include the ID making this
not as useful as it could be..

This additionally moves some of the other logs to include the id for
the sandbox/container as a field instead of part of a format string.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-08-31 10:07:07 -07:00
Derek McGowan
b2f46463b5
Merge pull request #9031 from thaJeztah/revert_log_var
Revert "log: define G() as a function instead of a variable"
2023-08-31 06:55:41 -07:00
TTFISH
26dcae2f6b fix ossfuzz building error
Signed-off-by: TTFISH <jiongchiyu@gmail.com>
2023-08-31 20:07:05 +08:00
Derek McGowan
f9608c0027
Merge pull request #9030 from kiashok/updateShimTag-main
Update hcsshim tag to v0.12.0-rc.0
2023-08-30 16:13:15 -07:00
Sebastiaan van Stijn
19d6c37a3f
Revert "log: define G() as a function instead of a variable"
This reverts commit 778ac302b2.

(slightly modified, due to changes that were merged after that).

The reverted commit had two elements;

- Make `G` an actual function to improve the documentation
- Prevent `G` from being overwritten externally

From the commit that's reverted:

> 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

While it's unclear if the ability to replace the implementation was
_intentional_, it's this part that some external consumers were (ab)using.

We should look into that part in a follow-up, and design for this, for
example by providing a utility to replace the logger, and properly document
that.

In the meantime, let's revert the change.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-30 21:46:21 +02:00
Kirtana Ashok
fd5d92a7f5 Update hcsshim tag versioning to v0.12.0-rc.0
hcsshim tags v0.10.* is deprecated, so using the new
v0.12.0-rc.* versioning for hcsshim tags on containerd/main

Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2023-08-29 17:41:20 -07:00
Edgar Lee
779875a057 Add missing unpacker.Wait for image import
- For remote snapshotters, the unpack phase serves as an important step for
  preparing the remote snapshot. With the missing unpacker.Wait, the
  snapshotter `Prepare` context is always canceled.
- This patch allows remote snapshotter based archives to be imported via
  the transfer service or `ctr image import`

Signed-off-by: Edgar Lee <edgarhinshunlee@gmail.com>
2023-08-29 15:34:20 -07:00
Samuel Karp
b0a7f08aa7
Merge pull request #9021 from akhilerm/make-configurable-dependencies
make repositories of install dependencies configurable
2023-08-28 23:55:48 -07:00
Samuel Karp
cb532a87ef
Merge pull request #9019 from dcantah/hcsshim-version
Windows: Supply windows shim version via file
2023-08-28 23:48:32 -07:00
Danny Canter
15b13fb3ea Windows: Supply windows shim version via file
Somewhat similar to how we supply the version of runc to grab for testing via
a file in script/, this change supplies the Windows shim version to build off
of via a file in the same directory. This seems like a decent home given it now
lives next to the script that pulls and builds the shim to include in our build
artifacts/locally.

The motivation behind this change is:

Cut down on unneccessary hcsshim vendorings if no library code for containerd
changed. It was some what clunky how the Windows builds work today. The Windows
shim is developed out of tree at github.com/microsoft/hcsshim. To let containerd know
what tag to build the shim off of we'd vendor hcsshim into containerd, and then
parse the version string from go.mod, fetch this tag, and then build the shim and
include it in our artifacts. As mentioned, often times the vendoring would bring in
no actual changes that would affect containerd's usage of hcsshim as a library, and
would just serve as a means to bump the version of the containerd shim we should build.

Now this process can be a one line change and we can avoid the possible headaches that come
with bumping go.mod (bumping other unrelated deps etc.)

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-08-28 11:55:55 -07:00
Derek McGowan
c0111909a7
Merge pull request #9009 from dcantah/block-file-recreate
Blockfile: Expose RecreateScratch option
2023-08-28 11:53:56 -07:00
Derek McGowan
2a806c710a
Merge pull request #9017 from Juneezee/refactor/redundant-nil-check
Remove redundant nil check
2023-08-28 06:55:10 -07:00
Akhil Mohan
7a0ad09a0d
make repositories of install dependencies configurable
make repositories of dependencies like runc, crun, cni and critools configurable

Signed-off-by: Akhil Mohan <makhil@vmware.com>
2023-08-28 18:43:41 +05:30
Eng Zer Jun
34def8b33b
Remove redundant nil check
From the Go docs:

  "For a nil slice, the number of iterations is 0." [1]

Both `info.RootFS` and `host.clientPairs` are slices. Therefore, an
additional nil check for before the loop is unnecessary.

[1]: https://go.dev/ref/spec#For_range

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-08-27 17:56:27 +08:00
Derek McGowan
03e4f1e363
Merge pull request #9006 from bart0sh/PR010-update-LTS-doc
Update LTS description
2023-08-25 10:22:18 -07:00
Maksym Pavlenko
871a94a465
Merge pull request #8565 from samuelkarp/ctr-override-mounts
ctr: allow run to override mounts
2023-08-25 10:01:11 -07:00
Phil Estes
adbc13c3e2
Merge pull request #9011 from AkihiroSuda/continuity-v0.4.2
go.mod: github.com/containerd/continuity v0.4.2
2023-08-25 09:25:55 -04:00
Akihiro Suda
490905be6f
go.mod: github.com/containerd/continuity v0.4.2
https://github.com/containerd/continuity/compare/1e0d26eb2381...v0.4.2

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-08-25 16:39:55 +09:00
Ed Bartosh
03abceac56 Update LTS description
Explicitly mentioned a possibility to take feature backports
to support new Kubernetes releases.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2023-08-25 10:33:32 +03:00
Danny Canter
34f32043bc Blockfile: Expose RecreateScratch option
This was the only option not configurable from the toml for the plugin.
This is useful if you want to restart containerd and try a different
blockfile/size for the snapshotter.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-08-24 13:28:22 -07:00
Derek McGowan
db5fc4ab45
Merge pull request #9008 from mxpv/stale
Add stale bot
2023-08-24 13:21:59 -07:00
Phil Estes
ba56b1fb3b
Merge pull request #9007 from champtar/critools-1.28.0
Update critools to 1.28.0
2023-08-24 15:56:53 -04:00
Maksym Pavlenko
b4f487ce9d
Apply suggestions from code review
Co-authored-by: Samuel Karp <me@samuelkarp.com>
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-08-24 09:56:17 -07:00
Maksym Pavlenko
1e3540e110 Add stale bot
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-08-24 09:28:40 -07:00
Etienne Champetier
4e236962fe Update critools to 1.28.0
https://github.com/kubernetes-sigs/cri-tools/releases/tag/v1.28.0

Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
2023-08-24 11:15:24 -04:00
Akihiro Suda
f48bbef193
Merge pull request #8994 from mxpv/cri
Use sandboxed CRI by default
2023-08-24 13:42:58 +09:00
Phil Estes
8e7a25856b
Merge pull request #8998 from dmcgowan/image-inspect
ctr: images inspect
2023-08-23 14:12:56 -04:00
Phil Estes
1ffe80c7f6
Merge pull request #8730 from thaJeztah/sprint_less
replace some fmt.Sprintfs with strconv
2023-08-23 12:02:09 -04:00
Maksym Pavlenko
c92f4a160e
Update RELEASES
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-08-23 08:50:42 -07:00
Maksym Pavlenko
c3f3cad287
Use sandboxed CRI by default
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-08-23 08:50:40 -07:00
Maksym Pavlenko
e7dee269d6
Merge pull request #8960 from dcantah/sandbox-annotations
Sandbox: Add annotations to CreateSandbox surface
2023-08-23 08:42:46 -07:00
Sebastiaan van Stijn
b76cd4d9fd
replace some fmt.Sprintfs with strconv
Teeny-tiny optimizations:

    BenchmarkSprintf-10       37735996    32.31  ns/op  0 B/op  0 allocs/op
    BenchmarkItoa-10         591945836     2.031 ns/op  0 B/op  0 allocs/op
    BenchmarkFormatUint-10   593701444     2.014 ns/op  0 B/op  0 allocs/op

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-23 16:43:02 +02:00
Derek McGowan
bbdbf7ab6c
Add inspect image commands
Outputs the image structure as a tree with an option to show content
and related labels for the image.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-08-23 06:52:35 -07:00
Derek McGowan
78308b4a44
Add manifest printer library
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-08-23 06:52:35 -07:00
Sebastiaan van Stijn
11a5dd8265
snapshots: replace some fmt.Sprintfs with strconv
Teeny-tiny optimizations:

    BenchmarkSprintf-10       37735996    32.31  ns/op  0 B/op  0 allocs/op
    BenchmarkItoa-10         591945836     2.031 ns/op  0 B/op  0 allocs/op
    BenchmarkFormatUint-10   593701444     2.014 ns/op  0 B/op  0 allocs/op

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-23 10:10:59 +02:00
Sebastiaan van Stijn
06765c9ef5
oci: replace some fmt.Sprintfs with strconv
Teeny-tiny optimizations:

    BenchmarkSprintf-10       37735996    32.31  ns/op  0 B/op  0 allocs/op
    BenchmarkItoa-10         591945836     2.031 ns/op  0 B/op  0 allocs/op
    BenchmarkFormatUint-10   593701444     2.014 ns/op  0 B/op  0 allocs/op

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-23 10:10:59 +02:00
Sebastiaan van Stijn
710d22366d
removes/docker: replace some fmt.Sprintfs with strconv
Teeny-tiny optimizations:

    BenchmarkSprintf-10       37735996    32.31  ns/op  0 B/op  0 allocs/op
    BenchmarkItoa-10         591945836     2.031 ns/op  0 B/op  0 allocs/op
    BenchmarkFormatUint-10   593701444     2.014 ns/op  0 B/op  0 allocs/op

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-23 10:10:59 +02:00
Sebastiaan van Stijn
d7bc8694be
pkg/cri: replace some fmt.Sprintfs with strconv
Teeny-tiny optimizations:

    BenchmarkSprintf-10       37735996    32.31  ns/op  0 B/op  0 allocs/op
    BenchmarkItoa-10         591945836     2.031 ns/op  0 B/op  0 allocs/op
    BenchmarkFormatUint-10   593701444     2.014 ns/op  0 B/op  0 allocs/op

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-23 10:10:56 +02:00