Commit Graph

1583 Commits

Author SHA1 Message Date
ningmingxiao
e7be076d48 ctr:make sure containerd socket exist before create client
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2025-05-08 14:40:03 +00:00
Danny Canter
33ee060a35 Use Go 1.19 atomic wrappers everywhere
We've long been able to use these and they have a couple
great benefits:

1. Forces you to always access them atomically. With the pointer
variants it's completely valid to access the regular ol' int64/uint32
etc. without using the atomic.* methods. These wrappers don't provide
access to the underlying value so it forces correct usage always.

2. Conveys intent much better. Seeing the type be atomic.Int32 immediately
lets the reader know that this var will be used in a concurrent context,
and we no longer need comments like "this MUST be accessed atomically"
or similar.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2025-05-03 03:46:20 -07:00
Samuel Karp
20fc2cf8ec Merge pull request #11748 from vinayakankugoyal/dump
fix: update containerd config dump to reflect plugin config migrations.
2025-04-29 18:05:40 +00:00
Samuel Karp
6d4c30b2ce Merge pull request #11728 from samuelkarp/ctr-shim-address
ctr shim: allow override to computed shim address
2025-04-28 20:48:55 +00:00
Fu Wei
ef7bdf18a1 Merge pull request #10177 from azr/azr/parallel-layer-fetch
Multipart layer fetch
2025-04-24 20:35:00 +00:00
Adrien Delorme
024775dab1 set dl options on resolver
Signed-off-by: Adrien Delorme <azr@users.noreply.github.com>
2025-04-24 11:41:33 +02:00
Adrien Delorme
88116b1911 remove max_dl_operations setting
Signed-off-by: Adrien Delorme <azr@users.noreply.github.com>
2025-04-24 11:39:42 +02:00
Adrien Delorme
f9af08820b perf(pull): multipart layer fetch
Signed-off-by: Adrien Delorme <azr@users.noreply.github.com>
Co-Authored-By: Corentin REGAL <143578+co42@users.noreply.github.com>
2025-04-24 11:39:42 +02:00
Maksym Pavlenko
17b6e1ef85 Allow streaming to client
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2025-04-23 18:03:29 -07:00
Maksym Pavlenko
bd8e6c727d Enable http debug and tracing for non local puller
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2025-04-23 17:39:57 -07:00
Maksym Pavlenko
27e6c117d9 Move HTTP debug code to pkg
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2025-04-23 17:38:47 -07:00
Vinayak Goyal
d16ad8f5c5 fix: update containerd config dump to reflect plugin config migrations.
Signed-off-by: Vinayak Goyal <vinaygo@google.com>
2025-04-23 22:08:13 +00:00
Samuel Karp
f512e31743 ctr shim: allow override to computed shim address
The default computed address follows the format used by the
io.containerd.runc.v2 shim, but there is no requirement that third-party
shims follow the same format.  The new --shim-address option allows
debugging of third-party shims with a different address format.

Signed-off-by: Samuel Karp <samuelkarp@google.com>
2025-04-22 11:25:23 -07:00
Akihiro Suda
499238a52a Remove deprecated dynamic library plugins
Dynamic library plugins have been deprecated since v2.0 (PR 9238)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-04-17 09:12:46 +09:00
Akihiro Suda
d9c889568e Remove the support for Schema 1 images
Schema 1 (`application/vnd.docker.distribution.manifest.v1+prettyjws`) has been
officially deprecated since containerd v1.7 (PR 6884), and disabled since v2.0 (PR 9765).

Users who have been seeing warnings like `conversion from schema 1 images is deprecated`
now have to rebuild the image with Schema 2 or OCI.

Schema 2 was introduced in Docker 1.10 (Feb 2016), so most users should have been already
using Schema 2 or OCI.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-04-11 09:03:26 +09:00
ningmingxiao
531adbf065 config:fix config migrate lost timeout config
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2025-03-12 23:34:58 +08:00
Derek McGowan
59c8cf6ea5 Merge pull request #10705 from erofs/erofs-snapshotter
[Feat] erofs snapshotter and differ
2025-02-05 15:21:33 +00:00
Phil Estes
98af40b752 Merge pull request #10722 from henry118/uidmap2
Support multiple uid/gid mappings [2/2]
2025-01-17 18:34:40 +00:00
Akihiro Suda
04bac22dfc Merge pull request #11262 from dmcgowan/fix-cdi-oci-opt
Move CDI device spec out of the OCI package
2025-01-14 07:27:22 +00:00
Derek McGowan
e20f7f4a24 Move CDI device spec out of the OCI package
The CDI device injection spec opt was mistakenly added to the OCI
package which brought in an unintended dependency on CDI and its
transitive dependencies.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-01-13 21:59:59 -08:00
luchenhan
740c5d4284 docs: fix some function names in comment
Signed-off-by: luchenhan <hanluchen@aliyun.com>
2025-01-14 11:36:35 +08:00
Gao Xiang
2486d542a5 Introduce EROFS Snapshotter
It allows us to mount each EROFS blob layer (generated by the EROFS
differ) independently, or use the "unpacked" fs/ directories (if
some other differ is used.)

Currently, it's somewhat like the overlay snapshotter, but I tend
to separate the new EROFS logic into a self-contained component,
rather than keeping it tangled in the very beginning.

Existing users who use the overlay snapshotter won't be impacted
at all but they have a chance to use this new snapshotter to
leverage the EROFS filesystem.

Signed-off-by: cardy.tang <zuniorone@gmail.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2025-01-13 16:31:11 +08:00
Gao Xiang
c73c8e5d52 Introduce EROFS differ
The EROFS differ only applies to EROFS layers which are marked by
a special file `.erofslayer` generated by the EROFS snapshotter.

Why it's needed?  Since we'd like to parse []mount.Mount directly
without actual mounting and convert OCI layers into EROFS blobs,
`.erofslayer` gives a hint that the active snapshotter supports
the output blob generated by the EROFS differ.

I'd suggest it could be read together with the next commit.

Signed-off-by: cardy.tang <zuniorone@gmail.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2025-01-13 16:16:54 +08:00
Kazuyoshi Kato
feeef24713 Merge pull request #11161 from henry118/ttyleak
make sure console master tty is closed on task exit
2025-01-10 01:28:11 +00:00
Akihiro Suda
79a42eedc7 ctr: ctr images import --all-platforms: fix unpack
Fix issue 11228

`ctr images import --all-platforms` w/o `--local` was failing due to
`unable to initialize unpacker: no unpack platforms defined` error.

W/ `--local`, it unpacks the layers for the strict-default platform.

Now `ctr images import --all-platforms` w/o `--local` unpacks the layers
for the non-strict default platform.
This behavior still differs from `--local`.
i.e., on an arm64 host, arm/v{5,6,7} layers are unpacked too.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-01-08 10:30:49 +09:00
Henry Wang
aedb079bf1 fix master tty leak due to leaking init container object
Signed-off-by: Henry Wang <henwang@amazon.com>
2024-12-20 06:05:52 +00:00
Maksym Pavlenko
ff4f5cbff0 Merge pull request #11118 from tboevil/ctr-syncfs
cmd/ctr: allow user to syncfs during unpacking image locally
2024-12-11 19:16:06 +00:00
Henry Wang
ec231cdcf2 Update ctr to support remapper labels with multiple uid/gid mapping entries
Signed-off-by: Henry Wang <henwang@amazon.com>
2024-12-11 18:04:11 +00:00
Fu Wei
edfa911a0c Merge pull request #11086 from djdongjin/ctr-pull-transfer-service
ctr pull should unpack for default platform when transfer service is used
2024-12-11 15:54:24 +00:00
Qiyuan Liang
11b78255de cmd: add syncfs option to ctr command
Signed-off-by: Qiyuan Liang <qiyuan.liang@smartx.com>
2024-12-09 13:14:28 +08:00
Akihiro Suda
5855c4dae0 Merge pull request #11069 from djdongjin/fix-panic-nil-cgroups
Fix panic due to nil dereference cgroups v2
2024-12-05 01:11:28 +00:00
Maksym Pavlenko
cbb8cf408b Merge pull request #11043 from fengwei0328/dev2
The task_dir successfully cleans when the file is absent.
2024-12-04 23:58:06 +00:00
fengwei0328
4a664772ef The task_dir successfully cleans when the file is absent.
Signed-off-by: fengwei0328 <feng.wei8@zte.com.cn>
2024-12-04 09:43:12 +08:00
Jin Dong
4c11d753ca ctr pull unpack for default platform using transfer service
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2024-12-03 06:35:22 +00:00
Jin Dong
0903f203fb fix panic due to nil dereference cgroups v2
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2024-11-29 03:55:34 +00:00
Marat Radchenko
9c7a403a22 [containerd-stress] Use platform-specific default address
Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
2024-11-17 18:35:18 +03:00
Samuel Karp
b6f435835d Merge pull request #10907 from AkihiroSuda/fix-10905
config: v1Migrate: support DisabledPlugins and RequiredPlugins
2024-10-31 23:20:10 +00:00
Akihiro Suda
9ed6e05b23 config: v1Migrate: support DisabledPlugins and RequiredPlugins
Fix issue 10905

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-10-29 06:51:55 +09:00
Akihiro Suda
4b2bca00b8 config: migrate version before merging
Prior to this commit, `/etc/containerd/config.toml` with no version
was parsed as version 3.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-10-29 06:51:55 +09:00
Akihiro Suda
778defa31f Add back ZFS snapshotter
Fix issue 10889

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-10-25 00:10:20 +09:00
Akihiro Suda
deccefc8cf Merge pull request #9982 from rayburgemeestre/merge-toml-configurations-for-plugins
Allow sections of Plugins to be merged, and not overwritten as entire sections.
2024-10-23 04:32:49 +00:00
Ray Burgemeestre
530db2e8d1 Introduce two additional unit tests for two runtimes and pod annotations.
Signed-off-by: Ray Burgemeestre <rayb@nvidia.com>
2024-10-21 16:25:41 +02:00
Ray Burgemeestre
a21e379b69 Allow sections of Plugins to be merged, and not overwritten as entire sections.
See for rationale the Pull Request description. Added unit test to
demonstrate the difference of this change.

Signed-off-by: Ray Burgemeestre <rayb@nvidia.com>
2024-10-21 16:25:41 +02:00
Derek McGowan
2f24aa00a5 Update errdefs to 0.3.0
Uses the new github.com/containerd/errdefs/pkg module which is intended
to hold less stable utility functions separately from the stable
github.com/containerd/errdefs error types.

Includes temporary update to hcsshim until a release is cut there

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-10-18 16:04:54 -07:00
Abel Feng
e4df672ab8 sandbox: add sandbox controller v2
Signed-off-by: Abel Feng <fshb1988@gmail.com>
2024-10-16 17:37:05 +08:00
Brian Goff
b85909cd4c shim: Move pprof server to plugin
Makes the pprof server a plugin and also gates by the `shim_tracing`
build tag (like otel is).
With this change, `net/http` is no longer a dependency in the shim.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-10-03 00:12:50 +00:00
Brian Goff
2123855eeb Add build tag to omit grpc
This is needed so we can build the runc shim without grpc as a
transative dependency.
With this change the runc shim binary went from 14MB to 11MB.
The RSS from an idle shim went from about 17MB to 14MB (back around
where it was in in 1.7).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-10-02 01:50:48 +00:00
Brian Goff
11ffba3dc4 shim: Do not depend on pkg/oci
pkg/oci is a general utility package with dependency chains that are
uneccessary for the shim.
The shim only actually used it for a convenience function for reading
an oci spec file.
Instead of pulling in those deps just re-implement that internally in
the shim command.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-10-01 21:04:58 +00:00
Brian Goff
17d4a1357e Propagate trace contexts to shims
This adds trace context propagation over the grpc/ttrpc calls to a shim.

It also adds the otlp plugin to the runc shim so that it will send
traces to the configured tracer (which is inherited from containerd's
config).
It doesn't look like this is adding any real overhead to the runc shim's
memory usage, however it does add 2MB to the binary size.
As such this is gated by a build tag `shim_tracing`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-09-30 21:44:16 +00:00
Henry Wang
83aaa89b61 update ctr run to support multiple uid/gid mappings
Signed-off-by: Henry Wang <henwang@amazon.com>
2024-09-10 17:06:27 +00:00