Commit Graph

12660 Commits

Author SHA1 Message Date
Marat Radchenko
51a1e7f0b2 Fix example shim to actually use its task service
In commit 4b35c3829d, example shim erroneously started to depend on runc, fix that back.

Also, build example shim on all supported platforms to prevent such situations in the future.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
2023-07-03 20:40:20 +03:00
Phil Estes
330273d236
Merge pull request #8763 from slonopotamus/GetTopic
Move GetTopic function out of runc shim
2023-07-03 09:39:00 -04:00
Derek McGowan
d89882ae92
Merge pull request #8768 from akhilerm/fix-nightly 2023-07-03 00:19:43 -07:00
Akhil Mohan
a9cb6090e2
ci: remove libseccomp-dev installation for nightly
since libseccomp is required only for building runc and we are only
building containerd binaries in nightly, the libseccomp-dev dependency
is removed. Foreign arch repositories are now removed since
crossbuild-essential-* packages are {arm64, ppc64el,..} cross compiler
packages for amd64 and arch specific repositories are not required.

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
2023-07-01 09:43:09 +05:30
Marat Radchenko
0607e73263 Move GetTopic function out of runc shim
Every shim implementation needs to select a correct publisher topic when posting events, so move it out of Linux-only runc code to the place where other shims can also use it

Otherwise, shims have to copy-paste this code. For example, see runj: 8158e558a3/containerd/shim.go (L144-L172)

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
2023-06-30 10:29:21 +03:00
Derek McGowan
5d1ab0129e
Merge pull request #8764 from AkihiroSuda/zero-whiteout-timestamp 2023-06-29 21:51:26 -07:00
Akihiro Suda
5dedb6d0d2
archive: use 1970-01-01 as the whiteout timestamp
The whiteout timestamps are no longer set to the source date epoch.
The source date epoch still applies to non-whiteout files.

Discussion happened in moby/buildkit PR 3560.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-06-30 11:30:01 +09:00
Akihiro Suda
a542a57b2e
Merge pull request #8762 from dcantah/upgrade-cgroups-3.0.2
go.mod: Update cgroups to 3.0.2
2023-06-30 09:26:45 +09:00
Danny Canter
d6dbc4040b go.mod: Update cgroups to 3.0.2
This brings in a ton of great improvements, most notably for the containerd
daemon is performance improvements for cgroups1 and 2 for gathering stats,
as well as some fixes for enabling controllers and deleting v1 cgroups.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-06-29 12:14:59 -07:00
Danny Canter
f3b7436b61 Platforms: Add From/ToProto helpers for types
Helpers to convert from a slice of platforms to our protobuf representation
and vice-versa appear a couple times. It seems sane to just expose this facility
in the platforms pkg.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-06-28 19:54:56 -07:00
Danny Canter
b3ab1f26c4 Snapshots: Add From/ToProto helpers for types
Helpers to convert from snapshot types to their protobuf structures and
vice-versa appear three times. It seems sane to just expose this facility
in the snapshots pkg. From/ToKind weren't used anywhere but doesn't hurt to
round out the types by exposing them.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-06-28 12:17:52 -07:00
Danny Canter
0a6b8f0ee0 OCI: Add From/ToProto helpers for Descriptor
Helpers to convert from the OCI image specs [Descriptor] to its protobuf
structure for Descriptor and vice-versa appear three times. It seems sane
to just expose this facility in /oci.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-06-28 12:16:20 -07:00
Kazuyoshi Kato
81bc6ce6e9
Merge pull request #8740 from djdongjin/platform-parseall
Add a platform.ParseAll helper
2023-06-28 08:01:12 -07:00
Kazuyoshi Kato
5d4504c196
Merge pull request #8758 from djdongjin/ginkgo
Update ginkgo to match cri-tools' version
2023-06-28 07:58:34 -07:00
Kazuyoshi Kato
a3c9ed7092
Merge pull request #8752 from neersighted/name_to_handle_at
seccomp: always allow name_to_handle_at
2023-06-28 07:58:07 -07:00
Jin Dong
4df27fd774 Update ginkgo to match cri-tools' version
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2023-06-28 13:14:22 +00:00
Bjorn Neergaard
9a202e342b
seccomp: always allow name_to_handle_at
This syscall is used by systemd to request unique internal names for
paths in the cgroup hierarchy from the kernel, and is overall innocuous.

Due to [previous][1] [mistakes][2] in moby/moby, it ended up attached to
`CAP_SYS_ADMIN`; however, it should not be filtered at all.

An in-depth analysis is available [at moby/moby][3].

  [1]: a01c4dc8f8 (diff-6c0d906dbef148d2060ed71a7461907e5601fea78866e4183835c60e5d2ff01aR1627-R1639)
  [2]: c1ca124682
  [3]: https://github.com/moby/moby/pull/45766#pullrequestreview-1493908145

Co-authored-by: Vitor Anjos <bartier@users.noreply.github.com>
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2023-06-28 05:50:24 -06:00
Danny Canter
55a8102ec1 mount: Add From/ToProto helpers
Helpers to convert from containerd's [Mount] to its protobuf structure for
[Mount] and vice-versa appear three times. It seems sane to just expose
this facility in /mount.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-06-28 04:03:18 -07:00
Danny Canter
e85352183e integration/client: Rework withBytesBuffers
All of the tests using this didn't need stdin/err (one of them not even
stdout), so we can just leave them "empty" and change to a withStdout
naming to make it more obvious.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-06-27 23:47:14 -07:00
Jin Dong
54a93c6c52 Make ptypes.Empty a var in contentserver
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2023-06-27 11:32:59 +00:00
Jin Dong
cdc90c8381 Remove duplicated code in content Copy
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2023-06-27 11:32:59 +00:00
Cardy.Tang
50376ec9ff remotes: allow FetchByDigest client to pass mediatype as header
accept mediatype header is required for some layers, add additional field for client.

Signed-off-by: Cardy.Tang <zuniorone@gmail.com>
2023-06-27 16:36:01 +08:00
Jin Dong
0a92661e69 Add a platform.ParseAll helper
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2023-06-26 20:34:37 +00:00
Kazuyoshi Kato
9b4ed8acc2
Merge pull request #8696 from fuweid/deflaky-blockfile
chore: deflake the blockfile testsuite
2023-06-26 09:54:33 -07:00
Fu Wei
b6abda73b8
Merge pull request #8728 from dcantah/rm-hcsshim-todo
Makefile: Remove hcsshim related TODO
2023-06-25 15:18:36 +08:00
Fu Wei
43ae9c26b8
Merge pull request #8729 from dcantah/integration-empty-windows
Integration: Align empty IO func on Windows
2023-06-25 15:17:23 +08:00
Fu Wei
e350c8ca94
Merge pull request #8711 from djdongjin/sb-metadata
Minor changes to sandbox metadata
2023-06-25 15:16:43 +08:00
Fu Wei
ef61125871
Merge pull request #8719 from alexcb/log-expired-leases
log when a lease expires
2023-06-25 14:09:04 +08:00
Phil Estes
1a5eaa9ad0
Merge pull request #8732 from thaJeztah/epoch_export_parse
pkg/epoch: extract parsing SOURCE_DATE_EPOCH to a function
2023-06-23 17:06:21 -04:00
Phil Estes
753e6d2f8e
Merge pull request #8731 from dcantah/rm-windows-file-todo
Reword Windows file related TODO
2023-06-23 16:59:27 -04:00
helen
e89d7204eb MergeStringSlices use sets
Signed-off-by: helen <haitao.zhang@daocloud.io>
2023-06-24 03:04:24 +08:00
Sebastiaan van Stijn
8760b87174
pkg/epoch: extract parsing SOURCE_DATE_EPOCH to a function
This introduces a ParseSourceDateEpoch function, which can be used
to parse "SOURCE_DATE_EPOCH" values for situations where those
values are not passed through an env-var (or the env-var has been
read through other means).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-23 17:32:02 +02:00
Sebastiaan van Stijn
9924e56f42
pkg/epoch: fix tests on macOS
These tests were failing on my macOS; could be the precision issue (like on
Windows), or just because they're "too fast".

    === RUN   TestSourceDateEpoch/WithoutSourceDateEpoch
        epoch_test.go:51:
                Error Trace:	/Users/thajeztah/go/src/github.com/containerd/containerd/pkg/epoch/epoch_test.go:51
                Error:      	Should be true
                Test:       	TestSourceDateEpoch/WithoutSourceDateEpoch
                Messages:   	now: 2023-06-23 11:47:09.93118 +0000 UTC, v: 2023-06-23 11:47:09.93118 +0000 UTC

This patch:

- updates the rightAfter utility to allow the timestamps to be "equal"
- updates the asserts to provide some details about the timestamps
- uses UTC for the value we're comparing to, to match the timestamps
  that are generated.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-23 17:29:55 +02:00
Danny Canter
dfd7ad8b37 Reword Windows file related TODO
https://github.com/golang/go/issues/32088 was never accepted or implemented
in 1.14.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-06-23 05:42:44 -07:00
Sebastiaan van Stijn
44e2b26a87
pkg/epoch: 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-06-23 13:10:58 +02:00
Danny Canter
f82d9b7991 Integration: Align empty IO func on Windows
I think NullIO is fine on Windows now. We have it as an option in ctr
and it's used for the pod sandbox container in CRI. Lets see if CI agrees..

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-06-22 20:05:34 -07:00
Phil Estes
13498a3258
Merge pull request #8726 from djdongjin/write-content
Remove duplicated `writeIndex` func
2023-06-22 21:33:22 -04:00
Danny Canter
f3124d5693 Makefile: Remove hcsshim related TODO
There was a todo for the windows variant of dependency installation that
hinted at making an install-hcsshim.sh script, however Windows today doesn't
rely on a standalone OCI runtime binary that gets invoked by the shim. Rather,
container creation/management is all handled by the shim itself in-proc. Due to
this, `make` or `make binaries` basically fulfills that purpose as it
clones hcsshim and builds the shim along with containerd.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-06-22 17:53:09 -07:00
Jin Dong
2aeac9a8f6 Remove duplicated writeIndex func
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2023-06-22 22:48:24 +00:00
Phil Estes
2353574aa9
Merge pull request #8708 from marquiz/devel/cri-cleanup
cri: drop unused arg from generateRuntimeOptions
2023-06-22 15:12:48 -04:00
Phil Estes
733070b96a
Merge pull request #8717 from djdongjin/dedup-manifest-platform
Dedup config platform helper
2023-06-22 15:12:22 -04:00
Jin Dong
7601dd9a9e Dedup manifest config platform helper
It also removes a duplicated digest validate call

Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2023-06-22 01:36:58 +00:00
Alex Couture-Beil
f3df7f7391
log when a lease expires
This makes it easier to debug GC-related issues, where a reference is
unexpectedly released.

Signed-off-by: Alex Couture-Beil <alex@mofo.ca>
2023-06-21 16:00:02 -07:00
Jin Dong
a01118bbed Minor changes to sandbox metadata
1. Reduce one bucket.Bucket call.
2. Use update helper instead of db.Update as in other functions.

Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2023-06-20 20:41:17 +00:00
Kazuyoshi Kato
ad9d1a82f1
Merge pull request #8701 from djdongjin/gc
Remove unnecessary label bucket loop
2023-06-20 11:20:20 -07:00
Markus Lehtonen
f60a4a2718 cri: drop unused arg from generateRuntimeOptions
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2023-06-19 16:11:36 +03:00
Jin Dong
1fb835f042 Remove unnecessary label bucket loop
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2023-06-17 19:26:29 +00:00
Wei Fu
a207b430e3 snapshots/blockfile: fix lint issue
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-06-17 08:42:02 +08:00
Wei Fu
59b0b39af0 vendor: update github.com/containerd/continuity
Pin it with 1e0d26eb2381594984ee80989c9c229dbd930d9f

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-06-17 08:36:45 +08:00
Phil Estes
96de54db43
Merge pull request #8667 from djdongjin/premarshal-empty-resp
Save marshalled empty response in streaming service
2023-06-16 17:05:24 -04:00