Commit Graph

645 Commits

Author SHA1 Message Date
Derek McGowan
6f027e38a8
Remove redundant build tags
Remove build tags which are already implied by the name of the file.
Ensures build tags are used consistently

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-08-05 22:27:46 -07:00
Kazuyoshi Kato
1d3d08026d Support SIGRTMIN+n signals
systemd uses SIGRTMIN+n signals, but containerd didn't support the signals
since Go's sys/unix doesn't support them.

This change introduces SIGRTMIN+n handling by utilizing moby/sys/signal.

Fixes #5402.

https://www.freedesktop.org/software/systemd/man/systemd.html#Signals

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-07-26 09:36:43 -07:00
Yifan Yuan
bda7b58666 feat: Add snapshotter label to the new snapshot for container.
add '--snapshotter-labels' in ctr run and ctr c create
which can pass labels to snappshotter on preparing new
snapshot.

Pass command label to snapshotter can help it determine
which kind of writable snapshots should be provide.

For some snapshotter, such as overlaybd:
  ( https://github.com/alibaba/accelerated-container-image ),
it can provide 2 kind of writable snapshot (overlayfs dir or
 blockdevice) by command label values.

Signed-off-by: Yifan Yuan <tuji.yyf@alibaba-inc.com>
2021-06-28 20:08:01 +08:00
Fu Wei
1daea57ab5
Merge pull request #5636 from crosbymichael/multi-gpus
allow multi gpu to be specified via ctr
2021-06-23 00:08:48 +08:00
Michael Crosby
09d78bb6b9 allow multi gpu to be specified via ctr
Signed-off-by: Michael Crosby <michael@thepasture.io>
2021-06-21 23:49:43 -04:00
kh
05e51539a9 command line flags of setting container rootfs propagation
Signed-off-by: Kitt Hsu <kitt.hsu@gmail.com>
2021-06-17 10:03:37 +08:00
Derek McGowan
96df20cf77
Merge pull request #5531 from samuelkarp/freebsd-ctr-run-mounts
ctr: parse mount options with embedded = character
2021-05-25 13:38:54 -07:00
Samuel Karp
535d9cc59f
ctr: parse mount options with embedded = character
FreeBSD mount options may have embedded = characters.  For example,
devfs(5) supports the `ruleset` option which can be passed as
`ruleset=4` to indicate that ruleset 4 should be used.

Signed-off-by: Samuel Karp <me@samuelkarp.com>
2021-05-25 00:21:37 -07:00
Samuel Karp
5dec27b6f1
ctr: exec handle pty resize after Start
Handle initial pty resize after the exec process has started and the pty
is available, consistent with the behavior of ctr run.

Signed-off-by: Samuel Karp <me@samuelkarp.com>
2021-05-25 00:12:21 -07:00
Samuel Karp
b9378b4529
ctr: exec setup IO with console
Use cio.WithStreams with explicit console device when --tty is passed,
consistent with how ctr run behaves.

Signed-off-by: Samuel Karp <me@samuelkarp.com>
2021-05-22 23:19:46 -07:00
Shiming Zhang
b890f056e8 Fix content.ReaderAt close
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2021-05-08 12:39:09 +08:00
Mike Brown
391b123a5e adds quiet option for ref
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-04-20 09:20:14 -05:00
Mike Brown
00f8d32ef5 add not found debug out for check cmd; update usage
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-04-19 19:36:10 -05:00
Phil Estes
4f7d1d74fb
Merge pull request #5260 from fuweid/limit-concurent-uploads-when-push
remotes/ctr: allow to limit max concurrent uploads like downloads
2021-03-25 09:22:44 -04:00
acetang
5e94745f26 ctr: add --user for task exec
set user in exec container

$ ctr t exec --exec-id e1 --user admin container id
uid=500(admin) gid=500(admin) groups=500(admin)

Signed-off-by: chuangxue <chenglong.lcl@alibaba-inc.com>
Signed-off-by: acetang <aceapril@126.com>
2021-03-25 19:29:30 +08:00
Wei Fu
f8c2f04756 remotes/ctr: allow to limit max concurrent uploads like downloads
Also add flags for push/pull subcommand to limit max concurrent
uploads/downloads.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2021-03-25 14:37:02 +08:00
Maksym Pavlenko
22ef69d77d Support HTTP debug in ctr
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-03-22 09:32:34 -07:00
Michael Crosby
969b3d638b
Merge pull request #5202 from wzshiming/fix/dgst-debug
Change dgst to digest in debug
2021-03-18 11:54:44 -04:00
Phil Estes
32a08f1a6a
Merge pull request #4847 from cpuguy83/devices_by_dir
Support adding devices by dir
2021-03-17 09:41:02 -04:00
Michael Crosby
1a28c2f7ec
Merge pull request #5200 from pacoxu/skip-error-check
ctr plugin ls: plugin status should be skip, not error
2021-03-16 11:48:56 -04:00
Brian Goff
7776e5ef2a Support adding devices by dir
This enables cases where devices exist in a subdirectory of /dev,
particularly where those device names are not portable across machines,
which makes it problematic to specify from a runtime such as cri.

Added this to `ctr` as well so I could test that the code at least
works.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-03-15 16:42:23 +00:00
Phil Estes
a1138182d5
Merge pull request #5180 from dmcgowan/lint-enforce-comments
Fix exported comments enforcer in CI
2021-03-15 10:50:06 -04:00
pacoxu
a76cefd124 plugin status should be skip, not error
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-03-15 18:04:37 +08:00
Shiming Zhang
766e7953ab Change dgst to digest in debug
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2021-03-15 16:46:19 +08:00
Fu, Wei
6b410ba41f
Merge pull request #5197 from Iceber/fix-ctr-command
cmd/ctr: fix export command
2021-03-15 15:41:14 +08:00
Iceber Gu
d3ad7f3908
cmd/ctr: use e.g. in the command usage
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2021-03-15 13:48:25 +08:00
Iceber Gu
231bbdc379
cmd/ctr: fix export command
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2021-03-15 13:22:56 +08:00
Derek McGowan
35eeb24a17
Fix exported comments enforcer in CI
Add comments where missing and fix incorrect comments

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-03-12 08:47:05 -08:00
Alakesh Haloi
9f5244f410 Print elapsed time for image unpack
The provides additional insight into how much time is being spent in
unpacking and is helpful in performance comparison for just this stage
without resorting to running under time command in linux for example.

Signed-off-by: Alakesh Haloi <alakeshh@amazon.com>
2021-03-09 06:40:49 +00:00
Phil Estes
51992133af
Allow HTTP tracing in push/pull via --trace flag
Signed-off-by: Phil Estes <estesp@amazon.com>
2021-03-02 20:33:35 -05:00
Derek McGowan
9aca94c5b0
Add prune command to remove layer references
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-01-23 10:52:24 -08:00
Shengjing Zhu
2818fdebaa Move runtimeoptions out of cri package
Since it's a standard set of runtime opts, and used in ctr as well,
it could be moved out of cri.

Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2021-01-23 01:24:35 +08:00
Derek McGowan
809635b602
Merge pull request #4759 from anmaxvl/anmaxvl/windows-logging-driver
Enhance logging driver to support windows
2021-01-21 22:37:28 -08:00
Akihiro Suda
5ca3ac65c4
add Image content converter
Go example:
```go
opts := []converter.Opt{
  // convert Docker media types to OCI ones
  converter.WithDocker2OCI(true),
  // convert tar.gz layers to uncompressed tar layers
  converter.WithLayerConvertFunc(uncompress.LayerConvertFunc),
}
srcRef := "example.com/foo:orig"
dstRef := "example.com/foo:converted"
dstImg, err = converter.Convert(ctx, client, dstRef, srcRef, opts...)
fmt.Println(dstImg.Target)
```

ctr example: `ctr images convert --oci --uncompress example.com/foo:orig example.com/foo:converted`

Go test: `go test -exec sudo -test.root -test.run TestConvert`

The implementation is from https://github.com/containerd/stargz-snapshotter/pull/224,
but eStargz-specific functions are not included in this PR.

eStargz converter can be specified by importing `estargz` package and using `WithLayerConvertFunc(estargz.LayerConvertFunc)` option.

This converter interface will be potentially useful for converting zstd and ocicrypt layers as well.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-01-22 13:33:19 +09:00
Derek McGowan
392b2857aa
Merge pull request #4848 from katiewasnothere/ctr_image_chainid
Add a new flag to ctr "images pull" to print the image's chainID
2021-01-21 17:11:53 -08:00
Maksim An
ddb5e1651a Enhance logging driver and ctr tasks to support windows
Signed-off-by: Maksim An <maksiman@microsoft.com>
2021-01-21 12:17:32 -08:00
Kathryn Baldauf
14df541a40 Add a new flag to images pull for printing out the pulled image's chainID
Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
2021-01-12 15:42:40 -08:00
Akihiro Suda
e2e2c5737d
export: add --skip-non-distributable
The flag skips adding non-distributable blobs such as Windows layers to archive.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-01-01 06:32:01 +09:00
Akihiro Suda
419ad73727
ctr/commands/contents: expose ShowProgress
Expected to be used by nerdctl

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-12-11 19:53:44 +09:00
Akihiro Suda
1febce4ca8
ctr: FetchConfig: allow setting additional []containerd.RemoteOpt
The additional []containerd.RemoteOpt is not used by ctr currently,
but planned to be used by nerdctl and also probably by stargz's ctr-remote.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-12-09 16:12:13 +09:00
Derek McGowan
4a4bb851f5
Merge pull request from GHSA-36xw-fx78-c5r4
Use path based unix socket for shims
2020-11-30 10:32:18 -08:00
Michael Crosby
bd908acabd
Use path based unix socket for shims
This allows filesystem based ACLs for configuring access to the socket of a
shim.

Co-authored-by: Samuel Karp <skarp@amazon.com>
Signed-off-by: Samuel Karp <skarp@amazon.com>
Signed-off-by: Michael Crosby <michael@thepasture.io>
Signed-off-by: Michael Crosby <michael.crosby@apple.com>
2020-11-11 11:47:46 -08:00
Li Ning
97cee75da8 ctr: fix the incorrect image unmount error hint
Signed-off-by: Li Ning <lining@cmss.chinamobile.com>
2020-11-11 19:57:31 +08:00
Michael Crosby
5f74840a9a
Merge pull request #4709 from AkihiroSuda/ctr-apparmor
ctr: add AppArmor flags
2020-11-10 10:21:51 -05:00
Akihiro Suda
9d54648be3
ctr: add AppArmor flags
e.g.
```
$ sudo ./bin/ctr run --apparmor-default-profile "cri-containerd.apparmor.d" docker.io/library/alpine:latest foo cat /proc/self/attr/current
cri-containerd.apparmor.d (enforce)
```

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-11-10 14:19:35 +09:00
Evan Hazlett
ef48ef1e4c
add config path option to ctr for runtime
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2020-10-29 15:21:37 +00:00
Avi Deitcher
57baf92211 use proper buffer size for content get
Signed-off-by: Avi Deitcher <avi@deitcher.net>
2020-10-27 10:11:55 +02:00
Michael Crosby
21b6f68765 Add CNI support to ctr run
This adds linux cni support to `ctr run` via a `--cni` flag.  This uses the
default configuration for CNI on `ctr` to configure the network namespace for a
container.

Signed-off-by: Michael Crosby <michael@thepasture.io>
2020-10-14 22:37:53 -04:00
Phil Estes
534be84c5d
Merge pull request #4529 from gongguan/creator
avoid unnecessary NewCreator calls
2020-09-21 13:33:51 -04:00
Guanjun Gong
0dea724fc0 NewTask avoid unnecessary cio.NewCreator calls
Signed-off-by: Guanjun Gong <gongguanjun@hotmail.com>
2020-09-21 11:45:37 +08:00