Commit Graph

526 Commits

Author SHA1 Message Date
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
Phil Estes
8e7a25856b
Merge pull request #8998 from dmcgowan/image-inspect
ctr: images inspect
2023-08-23 14:12:56 -04: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
55c877297a
Merge pull request #8556 from Wang99998/main
Update default platform matcher when ctr import
2023-08-22 16:53:42 -07:00
Enrico Weigelt, metux IT consult
1571a5aa07 ctr: metrics: drop unused retval from printWindowsStats()
The error return value is always nil, so we don't need it at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2023-08-19 15:33:40 +02:00
Kirtana Ashok
a645ff2e68 Update dependencies after protobuf update in hcsshim
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
(cherry picked from commit d129b6f890bceb56b050bbb23ad330bb5699f78c)
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
2023-08-09 11:56:45 -07:00
Wang Xinwen
710d987d29
Fix default platform matcher when ctr import
Signed-off-by: Wang Xinwen <wxw0504@outlook.com>
2023-07-31 22:17:25 +08:00
Fu Wei
6eb90a63e0
Merge pull request #8837 from anmaxvl/fix-ctr-images-check-quiet
fix: `ctr images check -q` outputs not unpacked images
2023-07-24 10:39:43 +08:00
Akihiro Suda
0498acefb9
go.mod: github.com/.../container-device-interface v0.6.0
https://github.com/container-orchestrated-devices/container-device-interface/compare/v0.5.4...v0.6.0

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-07-23 03:07:59 +09:00
Maksim An
90ecb8104e fix: ctr images check outputs not unpacked images in quite mode
`ctr images check -q` shouldn't output images which were not
unpacked.

Signed-off-by: Maksim An <maksiman@microsoft.com>
2023-07-18 10:16:54 -07:00
Fu Wei
e7276fe35a
Merge pull request #8744 from cardyok/bugfix_remote_fetch_mediatype 2023-07-04 21:58:35 +08: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
Samuel Karp
f92e576f6b
Merge pull request #8609 from samuelkarp/issue-8607 2023-06-05 10:31:45 -07:00
Samuel Karp
ab53652228
ctr: update WritePidFile to use atomicfile
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2023-06-02 16:56:34 -07:00
Kazuyoshi Kato
659a41fd85
Merge pull request #8174 from Iceber/fix_ctr_run
ctr: fix the cleanup of task
2023-05-31 10:01:12 -07:00
Evan Lezar
d3887b2e62 Support CDI devices in ctr --device flag
This change adds support for CDI devices to the ctr --device flag.
If a fully-qualified CDI device name is specified, this is injected
into the OCI specification before creating the container.

Note that the CDI specifications and the devices that they represent
are local and mirror the behaviour of linux devices in the ctr command.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2023-05-31 16:14:01 +02:00
Peteris Rudzusiks
f2bc737825 Add cpuset-mems flag to 'ctr run' command
This flag allows cpuset.mems to be specified when running a container. If
provided, the container will use only the defined memory nodes.

Signed-off-by: Peteris Rudzusiks <rye@stripe.com>
2023-05-30 17:56:18 +02:00
Peteris Rudzusiks
f642c0a5f5 ctr: add cpuset-cpus flag to 'ctr run' command
This flag allows cpuset.cpus to be specified when starting a container. If
provided, the container will use only the defined CPU cores.

Signed-off-by: Peteris Rudzusiks <rye@stripe.com>
2023-05-30 17:50:33 +02:00
Samuel Karp
3d7522b7f2
ctr: allow run to override mounts
If a mount destination is specified both in the default spec and in a
--mount option, remove the default mount before adding new mounts.  This
allows overriding the default sysfs mount, for example.

Signed-off-by: Samuel Karp <samuelkarp@google.com>
2023-05-24 13:54:40 -07:00
mstmdev
cdaa4025e9 Fix some typos
Signed-off-by: Pan Yibo <mstmdev@gmail.com>
2023-05-16 10:12:50 +08:00
Iceber Gu
3d9dd2022d ctr: fix the cleanup of task
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2023-05-12 18:28:47 +08:00
Maksym Pavlenko
6f34da5f80 Cleanup logrus imports
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-05-05 11:54:14 -07:00
Danny Canter
519457e3e0 ctr: Add sandbox flag to ctr run
Add a flag to be able to run a container in a given sandbox.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-04-19 19:40:59 -07:00
Fu Wei
f7f2be7321
Merge pull request #8302 from Iceber/fix_ctr_task_metrics
ctr/tasks: fix unmarshal the task metrics for cgroup v1
2023-03-24 20:26:05 +08:00
Iceber Gu
1be08b10f7 ctr/tasks: fix unmarshal the task metrics for cgroups v1
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2023-03-23 14:42:24 +08:00
Fu Wei
e208c24256
Merge pull request #8175 from Iceber/fix_cni_metadata
adding cni metadata to the container in the `ctr run --config`
2023-03-16 23:29:48 +08:00
Iceber Gu
5fdca538d0 adding cni metadata to the container in the ctr run --config
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2023-03-16 18:01:53 +08:00
Maksym Pavlenko
07c2ae12e1 Remove v1 runctypes
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-03-15 09:18:16 -07:00
panguicai008
5c9c630c33 use uppercase letters for flag usage
Signed-off-by: panguicai008 <guicai.pan@daocloud.io>
2023-03-08 14:28:06 +08:00
Jian Zeng
f706576500
feat: tag image using Transfer api
Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>
2023-03-05 23:22:17 +08:00