Commit Graph

591 Commits

Author SHA1 Message Date
Derek McGowan
3d53430fe1
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>
(cherry picked from commit e20f7f4a2425c005d85855abfd4556d7b4ccbf87)
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-01-14 14:16:18 -08:00
Akihiro Suda
c4270430db 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-09 02:26:18 +00:00
Jin Dong
44cdca68b5 ctr pull unpack for default platform using transfer service
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2024-12-11 16:50:34 +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
Fu Wei
dd2a24cf0e
Merge pull request #10557 from tariq1890/cli-ctx-add
use ctx object from cliContext instead of a creating a new one
2024-08-13 01:13:48 +00:00
Samuel Karp
7d4da0cb28
ctr: shim state query for old shims
Old shims do not implement containerd.task.v3.Task, but it can be
useful to use a new ctr with an older shim especially during upgrade
scenarios.

Signed-off-by: Samuel Karp <samuelkarp@google.com>
2024-08-07 16:48:14 -07:00
Samuel Karp
d59e8a8404
ctr: shim state for secondary tasks
The v2 shim interface supports grouping, so a single shim can manage
multiple tasks.  Prior to this change, the `shim state` command could
only query the state of the primary task (task that shares the same ID
as the shim).

Signed-off-by: Samuel Karp <samuelkarp@google.com>
2024-08-07 16:48:08 -07:00
Tariq Ibrahim
32c2d14932
use ctx object from cliContext instead of a creating a new one
Signed-off-by: Tariq Ibrahim <tibrahim@nvidia.com>
2024-08-06 13:42:22 -07:00
Danny Canter
b41bb6df73 Avoid potential reallocs by pre-sizing some slices
There's a couple spots where we know exactly how large
the destination buffer should be, so pre-size these to
avoid any reallocs to a higher capacity.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2024-07-19 13:05:49 -07:00
Henry Wang
243b803a19 Add pprof to runc-shim
Signed-off-by: Henry Wang <henwang@amazon.com>
2024-06-20 23:12:31 +00:00
Sebastiaan van Stijn
dd0542f7c1
cmd: don't alias context package, and use cliContext for cli.Context
Unfortunately, this is a rather large diff, but perhaps worth a one-time
"rip off the bandaid" for v2. This patch removes the use of "gocontext"
as alias for stdLib's "context", and uses "cliContext" for uses of
cli.context.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-20 02:15:13 +02:00
Kohei Tokunaga
df7f6ba5b9
ctr: return explicit errors for flags unsupported by transfer service
ctr currently silently ignores several flags by default (without --local) and
the user can't know which flags are supported until they see the code.
This commit fixes ctr to return an explicit error when it finds an unsupported
flag.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2024-06-11 12:08:47 +09:00
Maksym Pavlenko
34d3c17ae2
Merge pull request #10291 from ktock/push-platform-conf
Transfer: Push: Enable to specify platforms
2024-06-05 21:28:09 +00:00
Kohei Tokunaga
cde2527fce
ctr: pull: Do not ignore labels when transfer service is used
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2024-06-05 12:26:00 +09:00
Kohei Tokunaga
5611fdd4af
Transfer: Push: Enable to specify platforms
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2024-06-04 10:02:13 +09:00
Derek McGowan
2788604e49
Update ctr image pull all platforms
Allows supporting fetching of all platforms while unpacking for a subset
of platforms.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-09 20:48:38 -07:00
Henry Wang
b8060d641d Update ctr shim subcommand to task v3
Signed-off-by: Henry Wang <henwang@amazon.com>
2024-05-03 15:25:48 +00:00
Derek McGowan
2ac2b9c909
Make api a Go sub-module
Allow the api to stay at the same v1 go package name and keep using a
1.x version number. This indicates the API is still at 1.x and allows
sharing proto types with containerd 1.6 and 1.7 releases.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-02 11:03:00 -07:00
Derek McGowan
e1b94c0e7d
Move protobuf package under pkg
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-02 10:52:03 -07:00
Derek McGowan
3e9cace720
Move runtimeoptions to api directory
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-02 10:52:02 -07:00
Derek McGowan
4a45507772
Move runc options to api directory
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-02 10:52:00 -07:00
Maksym Pavlenko
444679c883
Merge pull request #10109 from dmcgowan/fix-fallback-explicit-tls
Update HTTP fallback to better account for TLS timeout and previous attempts
2024-04-23 04:10:39 +00:00
ChengenH
4a31bd606d chore: use errors.New to replace fmt.Errorf with no parameters will much better
Signed-off-by: ChengenH <hce19970702@gmail.com>
2024-04-21 21:49:31 +08:00
Evan Lezar
1b62224181 Bump tags.cncf.io/container-device-interface to v0.7.1
This includes migrating from cdi.GetRegistry() to cdi.Configure() and
using top-level cdi Refresh and InjectDevices functions as applicable.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2024-04-10 15:25:11 +02:00
Derek McGowan
7c50784591
Remove empty default tls configuration in ctr
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-04-09 15:40:09 -07:00
Kohei Tokunaga
4332794384
Transfer: Registry: Enable plain HTTP
Currenlty transfer service doesn't handle plain HTTP connection.
This commit fixes this issue by propagating
`(core/remotes/docker/config).HostOptions.DefaultScheme` from client to the
transfer service.
This commit also fixes ctr to use this feature for "--plain-http" flag.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2024-04-03 10:46:10 +09:00
Derek McGowan
3a8c27dff8
Merge pull request #9908 from ktock/transfer-host-dir
Transfer: Registry: Enable to use registry configuration diretory
2024-04-02 18:59:43 +00:00
Maksym Pavlenko
6a96e45012
Move shim package to pkg
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-03-07 10:05:26 -08:00
Kohei Tokunaga
7a3b7fba59
Transfer: Registry: Enable to use registry configuration diretory
Currently transfer service isn't aware of configurations of hosts directory and
ctr's `--hosts-dir` doesn't work.
This commit fixes this issue by using `config.ConfigureHosts` instead of
`docker.ConfigureDefaultRegistries`.
This commit also fixes ctr to use this feature for "--hosts-dir" flag.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2024-03-04 15:43:30 +09:00
Derek McGowan
1bf781d8eb
Cleanup introspection interface
Split service proxy from service plugin.
Make introspection service easier for clients to use.
Update service proxy to support grpc and ttrpc.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-03-01 23:07:42 -08:00
Derek McGowan
72f21833b1
Move events to plugins and core
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-02-27 22:09:20 -08:00
Phil Estes
1641c7571f
Merge pull request #9809 from dereknola/urfave_v2
Migrate Urfave CLI from v1 to v2
2024-02-16 16:13:37 +00:00
Derek Nola
132485adb0
Convert CLI to urfave v2
Followed the Migration Guide at https://cli.urfave.org/migrate-v1-to-v2/
The major changes not pointed out in the migration guide are:
- context.Args() no longer produces a []slice, so context.Args().Slice()
  in substitued
- All cli.Global***** are deprecated (the migration guide is somewhat
  unclear on this)

Signed-off-by: Derek Nola <derek.nola@suse.com>

Vendor in urfave cli/v2

Signed-off-by: Derek Nola <derek.nola@suse.com>

Fix NewStringSlice calls

Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-02-15 09:48:04 -08:00
Akihiro Suda
468bee9a79
ctr: print deprecation warnings on every invocation
Print deprecation warnings on any ctr command, as users won't notice the
deprecations until we actually remove the deprecated features.

The warnings can be suppressed by setting
`CONTAINERD_SUPPRESS_DEPRECATION_WARNINGS=1`.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-02-13 02:51:02 +09:00
Derek McGowan
f46aea6187
Move transfer and unpack packages
Packages related to transfer and unpacking provide core interfaces which
use other core interfaces and part of common functionality.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-02-07 22:40:15 -08:00
Zechun Chen
5cbe92e88e Clean up repeated package import
Signed-off-by: Zechun Chen <zechun.chen@daocloud.io>
2024-02-06 11:06:33 +08:00
Derek McGowan
fb9b59a843
Switch to new errdefs package
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-25 22:18:45 -08:00
Maksym Pavlenko
7516bb915c
Merge pull request #9442 from AkihiroSuda/runtime-info2
api/services/instrospection: add PluginInfo
2024-01-25 17:50:42 +00:00
Maksym Pavlenko
8d417cbca0
Merge pull request #8890 from AkihiroSuda/follow-up-8744
remotes: FetchByDigest: propagate media type from config to desc
2024-01-25 17:00:14 +00:00
Akihiro Suda
22d586e515
api/services/instrospection: add PluginInfo
The new `PlunginInfo()` call can be used for instrospecting the details
of the runtime plugin.

```console
$ ctr plugins inspect-runtime --runtime=io.containerd.runc.v2 --runc-binary=runc
{
    "Name": "io.containerd.runc.v2",
    "Version": {
        "Version": "v2.0.0-beta.0-XX-gXXXXXXXXX.m",
        "Revision": "v2.0.0-beta.0-XX-gXXXXXXXXX.m"
    },
    "Options": {
        "binary_name": "runc"
    },
    "Features": {
        "ociVersionMin": "1.0.0",
        "ociVersionMax": "1.1.0-rc.2",
        ...,
    },
    "Annotations": null
}
```

The shim binary has to support `-info` flag, see `runtime/v2/README.md`

Replaces PR 8509 (`api/services/task: add RuntimeInfo()`)

Co-authored-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-01-25 10:00:30 +09:00
Derek McGowan
f2765617c5
Merge pull request #9662 from dmcgowan/replace-platform-package
Use github.com/containerd/platforms package
2024-01-23 19:50:25 +00:00
Derek McGowan
e79ec7a095
Remove deprecated platforms package
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-23 09:14:03 -08:00
Evan Lezar
9dd29b3cf7 Update container-device-interface to v0.6.2
This includes migrating from the github.com/container-orchestrated-devices
repo to tags.cncf.io.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2024-01-23 11:36:34 +01:00
Akihiro Suda
e9f2bba1f2
remotes: FetchByDigest: propagate media type from config to desc
A media type string passed via `WithMediaType()` was not propagated
to a descriptor returned by `FetchByDigest()`.

Follow-up to PR 8744

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-01-18 23:50:21 +09:00
Akihiro Suda
eb123db5fb
ctr: use transfer service by default
Prior to this commit, `--local=false` had to be explicitly specified to
opt-in to the transfer service

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-01-18 23:42:29 +09:00
Derek McGowan
dbc74db6a1
Move runtime to core/runtime
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:58:04 -08:00
Derek McGowan
de606680b0
Move rootfs to pkg/rootfs
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:56:07 -08:00
Derek McGowan
e59f64792b
Move oci to pkg/oci
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:55:48 -08:00
Derek McGowan
fa8cae99d1
Move namespaces to pkg/namespaces
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:55:39 -08:00
Derek McGowan
b76236bb45
Move labels to pkg/labels
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:55:30 -08:00