Commit Graph

557 Commits

Author SHA1 Message Date
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
Derek McGowan
44a836c9b5
Move errdefs to pkg/errdefs
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:54:45 -08:00
Derek McGowan
70ed2696fa
Move events to pkg/events
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:54:36 -08:00
Derek McGowan
b0c3d00e98
Move cio to pkg/cio
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:54:27 -08:00
Derek McGowan
fcd39ccc53
Move snapshots to core/snapshots
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:54:09 -08:00
Derek McGowan
0dabf6f154
Move remotes to core/remotes
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:52:21 -08:00
Derek McGowan
6e5408dcec
Move mount to core/mount
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:52:12 -08:00
Derek McGowan
f80760f9ff
Move leases to core/leases
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:51:45 -08:00
Derek McGowan
57ea8aef3d
Move images to core/images
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:51:26 -08:00
Derek McGowan
913edcd489
Move diff to core/diff
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:51:17 -08:00
Derek McGowan
9456048f46
Move containers to core/containers
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:50:40 -08:00
Derek McGowan
21b4f3f0aa
Move content to core/content
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:50:32 -08:00
James Jenkins
8aa2551ce0 Move DefaultSnapshotter constants
Move the DefaultSnapshotter constants to the defaults package.
Fixes issue #8226.

Signed-off-by: James Jenkins <James.Jenkins@ibm.com>
2024-01-12 13:28:46 -05:00
Akihiro Suda
a2472c0b5a
transfer: add OCI descriptors to Progress structure
The index media type and the digest are now shown in `ctr images pull --local=false`

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-01-11 23:56:13 +09:00
Kirtana Ashok
f261969507 Move certain debug logs to trace logs
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2024-01-10 14:43:54 -08:00
roman-kiselenko
a3c62e698d add label flags to ctr import, add integration tests
Signed-off-by: roman-kiselenko <roman.kiselenko.dev@gmail.com>
2024-01-06 11:11:10 +03:00
Sebastiaan van Stijn
2af6db672e
switch back from golang.org/x/sys/execabs to os/exec (go1.19)
This is effectively a revert of 2ac9968401, which
switched from os/exec to the golang.org/x/sys/execabs package to mitigate
security issues (mainly on Windows) with lookups resolving to binaries in the
current directory.

from the go1.19 release notes https://go.dev/doc/go1.19#os-exec-path

> ## PATH lookups
>
> Command and LookPath no longer allow results from a PATH search to be found
> relative to the current directory. This removes a common source of security
> problems but may also break existing programs that depend on using, say,
> exec.Command("prog") to run a binary named prog (or, on Windows, prog.exe) in
> the current directory. See the os/exec package documentation for information
> about how best to update such programs.
>
> On Windows, Command and LookPath now respect the NoDefaultCurrentDirectoryInExePath
> environment variable, making it possible to disable the default implicit search
> of “.” in PATH lookups on Windows systems.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-11-02 21:15:40 +01:00
Derek McGowan
9db21401c4
Switch to github.com/containerd/plugin
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-11-01 23:01:42 -07:00
Derek McGowan
b85df264ef
Rename opt to avoid stutter
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-11-01 10:39:54 -07:00
Derek McGowan
261e01c2ac
Move client to subpackage
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-11-01 10:37:00 -07:00
Derek McGowan
5fdf55e493
Update go module to github.com/containerd/containerd/v2
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-10-29 20:52:21 -07:00
Samuel Karp
3fff8b4f62
ctr: new deprecations command
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2023-10-24 22:38:33 -07:00
Samuel Karp
8ed0255f1b
Merge pull request #9205 from lengrongfu/feat/add-cpu-burst 2023-10-12 23:55:00 -07:00
Samuel Karp
420503072e
Merge pull request #9027 from akhilerm/fix-ctr-forbidden-characters 2023-10-11 17:29:55 -07:00
rongfu.leng
8f3d1c9d9b add cpu-burst param to ctr command
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
2023-10-09 21:51:24 +08:00
Akhil Mohan
4b59d67dd4
add a new flag "skip-reference-check" to skip reference name check
Signed-off-by: Akhil Mohan <makhil@vmware.com>
2023-10-06 17:57:04 +05:30
Derek McGowan
508aa3a1ef
Move to use github.com/containerd/log
Add github.com/containerd/log to go.mod

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-09-22 07:53:23 -07:00
Sebastiaan van Stijn
f7089ba225
leases: add WithLabel
This adds a new WithLabel function, which allows to set a single label on
a lease, without having to first construct an intermediate map[string]string.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-11 21:03:40 +02:00
Maksym Pavlenko
c13f47a3ae
Merge pull request #9029 from dmcgowan/push-inherit-distribution-sources
push: inherit distribution sources from parent
2023-09-07 12:46:18 -07:00
Akhil Mohan
6ec0d4a3ad
prevent ctr from creating tags with forbidden characters
check if the target tag that is to be created using ctr image tag
is valid and does not contain any forbidden characters.

Signed-off-by: Akhil Mohan <makhil@vmware.com>
2023-09-06 15:47:52 +05:30
Akihiro Suda
0ee2433c94
Merge pull request #5890 from artqzn/idmapped_mounts
RFC: Initial support of idmapped mount points
2023-09-05 20:41:05 +09:00
Ilya Hanov
1555a31bf6 mount: support idmapped mount points
This patch introduces idmapped mounts support for
container rootfs.

The idmapped mounts support was merged in Linux kernel 5.12
torvalds/linux@7d6beb7.
This functionality allows to address chown overhead for containers that
use user namespace.

The changes are based on experimental patchset published by
Mauricio Vásquez #4734.
Current version reiplements support of idmapped mounts using Golang.

Performance measurement results:
Image           idmapped mount  recursive chown
BusyBox         00.135          04.964
Ubuntu          00.171          15.713
Fedora          00.143          38.799

Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>
Signed-off-by: Artem Kuzin <artem.kuzin@huawei.com>
Signed-off-by: Alexey Perevalov <alexey.perevalov@huawei.com>
Signed-off-by: Ilya Hanov <ilya.hanov@huawei-partners.com>
2023-09-05 01:23:30 +03:00
Derek McGowan
b32638e21b
ctr: pull or fetch image metadata by default
The metadata is small and useful for viewing all platforms
for an image and enabling push back to the same registry.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-08-31 11:07:52 -07:00
Jin Dong
fc45365fa1 Remove most logrus
Signed-off-by: Jin Dong <jin.dong@databricks.com>
2023-08-26 14:31:53 -04: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