Commit Graph

1259 Commits

Author SHA1 Message Date
Alakesh Haloi
3597ac859d [otel-tracing] Initial opentelemetry support
Add basic intiialization of opentelemetry including minimum support to
be able to read open telemetry config from config.toml and initialize
exporter. Tracer is initialized and ready to be be used for creating
spans, sub spans etc. With no opentelemetry configuration enabled in
config file, this patch is a no-op.

Basic config stub to be added to use opentelemetry is to add following
in config.toml. We use otlp exporter with default port 4317.

[otel]
  exporter_name = "otlp"
  exporter_endpoint = "0.0.0.1:4317"

otel-collector binary needs to run listening at the same port.

Signed-off-by: Alakesh Haloi <alakeshh@amazon.com>
2021-08-04 14:25:01 -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
869375a413 Remove useless lines
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2021-05-20 16:19:09 +08:00
Shiming Zhang
b890f056e8 Fix content.ReaderAt close
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2021-05-08 12:39:09 +08:00
Michael Crosby
079fe6bca8
Merge pull request #5395 from mikebrow/cmd-check-improve-error-checking
add check quiet option and update usage
2021-04-20 14:43:25 -04: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
Samuel Karp
c3dde8c4bb
freebsd: add zfs to the default plugins
Signed-off-by: Samuel Karp <me@samuelkarp.com>
2021-04-16 00:52:24 -07:00
Phil Estes
88b09e6710
Merge pull request #5359 from ktock/v1cfg
Fix backword-compatibility issue of non-versioned config file
2021-04-15 11:18:27 -04:00
ktock
fdb76f55d8 Fix backword-compatibility issue of non-versioned config file
According to the doc about `config.toml` of containerd:

```
If no version number is specified inside the config file then it is assumed to
be a version 1 config and parsed as such.
```

However, it's not true recently.
This will break the backward-compatibility in some environment.
This commit fixes this issue.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-04-15 10:00:58 +09:00
Phil Estes
c02081fdc1
Merge pull request #5357 from thxCode/support_windows_debug
fix(windows): create debug npipe failure
2021-04-14 13:37:43 -04:00
thxcode
2de38a9269 fix(windows): create debug npipe failure
Signed-off-by: Weijia Mai <thxcode0824@gmail.com>
2021-04-14 17:32:54 +08:00
Derek McGowan
5c6ea7fdc1
Merge pull request #5293 from wzshiming/fix/eveny-error-message
Fix return event publishing error
2021-04-13 20:32:37 -07:00
Alakesh Haloi
0550c32330 containerd-stress: add snapshotter option for stress test to use
containerd-stress utility needs to be able to run with snapshotter
passed by user in cli in order to be able to stress test snapshotters.
This adds a cli option --snapshotter="<snapshotter-name>"

Signed-off-by: Alakesh Haloi <alakeshh@amazon.com>
2021-04-12 20:45:22 +00:00
Davanum Srinivas
9ad087947d
Switch all our tests to version 2
Also warn when someone uses version 1

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-04-12 13:18:33 -04:00
Shiming Zhang
45df696bf3 Fix return event publishing error
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2021-04-09 11:54:58 +08:00
Maksym Pavlenko
ddd4298a10 Migrate current TOML code to github.com/pelletier/go-toml
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-03-25 13:13:33 -07: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
Phil Estes
f2d84035f6
Merge pull request #5266 from Ace-Tang/ace
ctr: add --user for task exec
2021-03-25 09:17:52 -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
Fu, Wei
80fa9fe32a
Merge pull request #5135 from AkihiroSuda/default-config-crypt
add imgcrypt stream processors to the default config
2021-03-25 14:31:38 +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
Alakesh Haloi
24602e7a98 change default runtime for containerd-stress app
This fixes following warning message by changing the default runtime
to io.containerd.runc.v2 and does not require user to set the runtime
from command line anymore.

"WARN[2021-03-17T21:11:01.441207858Z] runtime v1 is deprecated since
containerd v1.4, consider using runtime v2"

Signed-off-by: Alakesh Haloi <alakeshh@amazon.com>
2021-03-17 21:49:30 +00: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
Akihiro Suda
ecb881e5e6
add imgcrypt stream processors to the default config
Enable the following config by default:

```toml
version = 2

[plugins."io.containerd.grpc.v1.cri".image_decryption]
  key_model = "node"

[stream_processors]
  [stream_processors."io.containerd.ocicrypt.decoder.v1.tar.gzip"]
    accepts = ["application/vnd.oci.image.layer.v1.tar+gzip+encrypted"]
    returns = "application/vnd.oci.image.layer.v1.tar+gzip"
    path = "ctd-decoder"
    args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"]
    env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"]
  [stream_processors."io.containerd.ocicrypt.decoder.v1.tar"]
    accepts = ["application/vnd.oci.image.layer.v1.tar+encrypted"]
    returns = "application/vnd.oci.image.layer.v1.tar"
    path = "ctd-decoder"
    args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"]
    env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"]
```

Fix issue 5128

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-03-15 13:27:16 +09:00
Akihiro Suda
ac2726e12c
cmd/containerd: deduplicate config*.go
`config_linux.go` and `config_windows.go` are identical.

`config_unsupported.go` is also almost identical but enables debug logs by default.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-03-15 13:27:16 +09:00
Akihiro Suda
9a7ca39cbd
defaults: add DefaultConfigDir
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-03-15 13:27:15 +09: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
Kevin Parsons
5f051c1d71 Improve error detection when loading config
Previously we simply ignored any not found error when loading the
containerd config. This created unintuitive behavior:

- If the user specified a path that didn't exist via --config, we would
  silently ignore the error.
- If a config specified an import that didn't exist, we would silently
  ignore the error.

In either of these cases, it appears we would end up using a potentially
corrupted config, as it would contain any files that were merged into it
before the not found error was hit.

However, we can't just remove the check for !os.IsNotExist(err),
as we shouldn't throw an error when --config is not passed, but the
default config doesn't exist.

This change updates the logic to only attempt to load the config if
we know it exists, or the user passed --config.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2021-02-09 16:21:32 -08: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
Derek McGowan
aae24ecbce
Merge pull request #4963 from zhsj/move-runtimeopt
Move runtimeoptions out of cri package
2021-01-22 11:43:08 -08:00
Shengjing Zhu
074873c68e Add cgo tag to btrfs plugin
btrfs plugin needs CGO support. However on riscv64, cgo
is only support on go1.16 (not released yet).
Instead of setting no_btrfs manually, adding a cgo tag tells
the compiler to skip it automatically.

Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2021-01-23 02:42:57 +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
Liu Hua
86277395cf signal: do not print message when dealing with SIG_PIPE
If we print message when SIG_PIPE occuers in signal handler.
There is a loop {print->SIG_PIPE->print->SIG_PIPE...}, which consume
a lot of cpu time. So do not print message in this situaiton.

Signed-off-by: Liu Hua <weldonliu@tencent.com>
2021-01-12 12:34:53 +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
Maksym Pavlenko
004214808a
Merge pull request #4831 from AkihiroSuda/expose-contents-showprogress
ctr/commands/contents: expose ShowProgress
2020-12-11 11:04:49 -08:00
Phil Estes
fad0ca2612
Merge pull request #4822 from samuelkarp/freebsd
Build on FreeBSD
2020-12-11 08:30:03 -05: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
Samuel Karp
b459209188
Compile for FreeBSD
Signed-off-by: Samuel Karp <me@samuelkarp.com>
2020-12-09 00:30:29 -08: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
Vlad Ungureanu
f12b68cc86 Allow configuration of different log formats: text, json
Signed-off-by: Vlad Ungureanu <vladu@palantir.com>
2020-12-04 13:12:41 -05: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
Kevin Parsons
b2420ebcd1 Fix Windows service panic file to not be read-only
Go 1.14 introduced a change to os.OpenFile (and syscall.Open) on Windows
that uses the permissions passed to determine if the file should be
created read-only or not. If the user-write bit (0200) is not set, then
FILE_ATTRIBUTE_READONLY is set on the underlying CreateFile call.

This is a significant change for any Windows code which created new
files and set the permissions to 0 (previously the permissions had no
affect, so some code didn't set them at all).

This change fixes the issue for the Windows service panic file. It will
now properly be created as a non-read-only file on Go 1.14+.

I have looked over the rest of the containerd code and didn't see other
places where this seems like an issue.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2020-11-24 01:37:00 -08:00
Brian Goff
bd7c6ca6fa Fix integer overflow on windows
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-11-16 19:21:00 +00:00
Samuel Karp
126b35ca43
containerd-shim: use path-based unix socket
This allows filesystem-based ACLs for configuring access to the socket
of a shim.

Ported from Michael Crosby's similar patch for v2 shims.

Signed-off-by: Samuel Karp <skarp@amazon.com>
2020-11-11 11:47:47 -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
Davanum Srinivas
edc671d6a0
disable staticcheck for IsAnInteractiveSession
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-10-13 10:47:18 -04:00
Derek McGowan
1c60ae7f87
Use local version of cri packages
Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-10-07 10:59:40 -07: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
Derek McGowan
438c87b8e0
Merge pull request #4534 from sedflix/zfs-root-path
zfs: seperate implementation pkg from plugin pkg
2020-09-18 10:28:23 -07:00
Phil Estes
1484593ee9
Merge pull request #4533 from sedflix/aufs-seperate-plugin
feat(snapshot::aufs): config root_path
2020-09-18 10:18:31 -04:00
Siddharth Yadav
96f4ce4a5c zfs: seperate implementation pkg from plugin pkg and revendor
Signed-off-by: Siddharth Yadav <sedflix@gmail.com>
2020-09-18 18:49:12 +05:30
Siddharth Yadav
2354e187c3 aufs: seperate implementation pkg from plugin pkg and revendor
Signed-off-by: Siddharth Yadav <sedflix@gmail.com>
2020-09-18 18:37:23 +05:30
Teemu Kallio
71fd68a920 devicemapper: seperate implementation pkg from plugin pkg
Signed-off-by: Teemu Kallio <teemu.kallio@pm.me>
2020-09-18 12:00:14 +02:00
Li Yuxuan
bdb5b2ce47 ctr: Return error if task.Metrics fails
Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2020-09-10 16:42:35 +08:00
Qian Xiao
469b637358 Fix ctr command typo.
Signed-off-by: Qian Xiao <heyheyco@gmail.com>
2020-09-07 15:50:52 -07:00
Brian Goff
899b4e3cb5 Ignore SIGURG signals in signal forwarder
Starting with go1.14, the go runtime hijacks SIGURG but with no way to
not send to other signal handlers.

In practice, we get this signal frequently.
I found this while testing out go1.15 with ctr and multiple execs with
only `echo hello`. When the process exits quickly, if the previous
commit is not applied, you end up with an error message that it couldn't
forward SIGURG to the container (due to the process being gone).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-09-04 16:19:31 -07:00
Brian Goff
6650510836 Exit signal forward if process not found
Previously the signal loop can end up racing with the process exiting.
Intead of logging and continuing the loop, exit early.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-09-04 16:17:00 -07:00
Derek McGowan
d4e78200d6
Merge pull request #4518 from knight42/feat/btrfs-config-root-path
feat(snapshot::btrfs): config root_path
2020-09-03 11:12:27 -07:00
Derek McGowan
445e26fff4
Merge pull request #4517 from knight42/feat/native-config-root-path
feat(snapshot::native): config root_path
2020-09-03 11:10:37 -07:00
Jian Zeng
c50ff694f0
refactor(native): separate init from implementation
Part of #4513

Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>
2020-09-03 19:58:31 +08:00
Jian Zeng
a52daa26ae
refactor(btrfs): separate init from implementation
Part of #4513

Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>
2020-09-03 19:54:18 +08:00
Shishir Mahajan
1eae524df6 ctr: CLI Flag (seccomp-profile) for setting custom seccomp profile.
Signed-off-by: Shishir Mahajan <smahajan@roblox.com>
2020-09-02 16:13:11 -07:00
Derek McGowan
70ffb12c1b
Separate overlay implementation from plugin
Put the overlay plugin in a separate package to allow the overlay package to be
used without needing to import and initialize the plugin.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-08-26 18:50:51 -07:00
Michael Crosby
db687ff485 Add --runtime-root to ctr
Signed-off-by: Michael Crosby <michael@thepasture.io>
2020-08-21 04:55:28 -04:00
Michael Crosby
7e84abe99c
Merge pull request #4468 from prashantbhutani90/master
Report correct stats for windows containers
2020-08-25 11:37:28 -04:00
Wei Fu
433662502f
Merge pull request #4456 from crisesw/ctr-cpu-limit
Add --cpu-quota, --cpu-period flag to ctr
2020-08-12 20:14:13 +08:00
Prashant Bhutani
35b63c064f Report correct stats for windows containers
Windows container stats were reporting incorrect metrics for cpu kernel runtime.

Signed-off-by: Prashant Bhutani <prbhutan@microsoft.com>
2020-08-12 00:51:37 +05:30
Akihiro Suda
8433602989
update runc to v1.0.0-rc92
Changes: https://github.com/opencontainers/runc/releases/tag/v1.0.0-rc92

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-08-06 20:31:33 +09:00
kenneth.kang
e20a5079e8 Add --cpu-quota, --cpu-period flag to ctr
Signed-off-by: Kenneth Kang <kenneth.kang@lge.com>
2020-08-06 10:04:59 +09:00
Michael Crosby
02afa94256 Add --cpus flag to ctr
Signed-off-by: Michael Crosby <michael@thepasture.io>
2020-07-28 23:06:07 -04:00
Maksym Pavlenko
97c081c84b
Merge pull request #4410 from TBBle/minor_windows_fixes
Minor fixes around Windows network setup
2020-07-21 15:26:18 -07:00
Paul "TBBle" Hampson
06fb93e0f0 Reject host-mode networking on Windows
The flag was being silently ignored, and so no network setup was done,
and no notice given.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2020-07-21 19:43:08 +10:00
Sherif
96099550b5
parseIDMapping: accept 32-bit IDs
Signed-off-by: Sherif Mowafy <sherif.mowafy@gmail.com>
2020-07-19 10:09:51 +02:00
Phil Estes
45c28f56b2
Add ability to use remapper labels versus remapping snapshot helper
A simple starting point for testing the remapper labels with
fuse-overlayfs snapshotter

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2020-06-29 10:21:55 -04:00
Wei Fu
4b5d7f66c9
Merge pull request #4290 from mxpv/ctr-oci
Add ctr subcommand to print default OCI spec
2020-05-29 10:45:36 +08:00
Maksym Pavlenko
636c533d95 Add ctr subcommand to print default OCI spec
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2020-05-28 14:06:44 -07:00
John Millikin
b8ccdcb07d
Add ctr flags for configuring default TLS credentials.
Signed-off-by: John Millikin <jmillikin@stripe.com>
2020-05-27 21:59:33 +09:00
Phil Estes
990076b731
Merge pull request #4228 from thaJeztah/refactor_reaper
Refactor reaper-related functionality to be in the sys/reaper package
2020-05-07 14:32:55 -04:00
Michael Crosby
b2aef14c0c
Merge pull request #4210 from cpuguy83/ctr_mount
Add commands to mount/unmount image from ref
2020-05-07 13:07:38 -04:00
Sebastiaan van Stijn
1b66fecad3
Integrate sys.SetSubreaper, sys.GetSubreaper in sys/reaper package
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-04 08:44:02 +02:00
Sebastiaan van Stijn
23aab35fdb
Remove libcontainer from containerd-shim
Replace the libcontainer variant with the one in our sys package

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-03 16:53:24 +02:00
fahedouch
8e76d18eff remove if condition because it is handled by the sdNotify daemon func
Signed-off-by: fahedouch <fahed.dorgaa@gmail.com>

lint code

Signed-off-by: fahedouch <fahed.dorgaa@gmail.com>
2020-04-26 23:18:34 +02:00
Brian Goff
1a10211e3f WithLease: always return context and done fn
We should never return a nil context because of the way this function is
typically used... e.g.

```
  ctx, done, err := containerd.WithLease(ctx)
```

If there is an error `ctx` will be nil and any error handling may cause
an NPE if it tries to use `ctx`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-04-25 21:16:43 -07:00
Brian Goff
98b30f4690 Add commands to mount/unmount image from ref
Example:

```terminal
$ mkdir /opt/busybox
$ ctr image mount docker.io/library/busybox:latest /opt/busybox
/opt/busybox
$ ls -lh /opt/busybox
total 40K
drwxr-xr-x 2 root   root     12K Apr 14 01:10 bin
drwxr-xr-x 2 root   root    4.0K Apr 14 01:10 dev
drwxr-xr-x 3 root   root    4.0K Apr 14 01:10 etc
drwxr-xr-x 2 nobody nogroup 4.0K Apr 14 01:10 home
drwx------ 2 root   root    4.0K Apr 14 01:10 root
drwxrwxrwt 2 root   root    4.0K Apr 14 01:10 tmp
drwxr-xr-x 3 root   root    4.0K Apr 14 01:10 usr
drwxr-xr-x 4 root   root    4.0K Apr 14 01:10 var
$ ctr image unmount /opt/busybox
$ ls -lh /opt/busybox
total 0
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-04-25 21:00:21 -07:00
Sebastiaan van Stijn
ad090e67e9
man: move ctr.1, containerd-config to section 8, and fix generation
I missed this in my previous change: the ctr man page is also
in Section 8, because it's considered an administrative tool,
and containerd-config is related to containerd so updating these
as well.

This commit also fixes naming of the generated files, which was
hard-coded to .1.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-03 12:32:52 +02:00
Derek McGowan
547301cb0c
Update ctr resolver to use new config package
Moved registry host configuration to the config package
and allows support of loading configurations from a
directory when the hosts are being resolved.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2020-03-31 22:52:10 -07:00
Akihiro Suda
dc131aa862
support loading certs from a directory
Add `remotes/certutil` functions for loading `ca.crt`, `client.cert`, and `client.key` into `tls.Config` from a directory like `/etc/docker/certs.d/<hostname>.

See https://docs.docker.com/engine/security/certificates/ .

Client applications including CRI plugin are expected to configure the resolver using these functions.

As an example, the `ctr` tool is extended to support `ctr images pull --certs-dir=/etc/docker/certs.d example.com/foo/bar:baz`.

Tested with Harbor 1.8.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-03-31 21:48:08 -07:00
Peng Tao
ebd745f91a ctr: do not assume runc options by default
If runtime is not runc, it doesn't make sense to send runc Options
as container create options, which will confuse other runtimes and
it actually causes kata shimv2 to fail to unmarshal the requset.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-03-24 18:45:34 +08:00
Sebastiaan van Stijn
4756258faf
service_windows.go: remove unused "service" variable
This was added in 40d898a820, but
doesn't appear to be used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-03-10 12:36:23 +01:00
Maksym Pavlenko
ddae905b82 Support NOTIFY_SOCKET
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2020-03-07 10:24:51 -08:00
Michael Crosby
00e6be9f45 Add ctr c info --spec flag to output spec
This flag makes it easy to view only the OCI spec for the container.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2020-03-05 12:10:14 -05:00
Maksym Pavlenko
ca66f3dd5d
Merge pull request #4076 from kevpar/windows-cri-support
Enable CRI plugin for Windows builds as well
2020-02-29 21:55:11 -08:00
Kevin Parsons
c7eec0c178 Fix file header in builtins_cri.go
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2020-02-28 14:34:13 -08:00
Akihiro Suda
8e448bb279 vendor protobuf & grpc
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-02-26 10:57:05 +09:00
Justin Terry (SF)
fed8890e93 Enable CRI plugin for Windows builds as well
The builtins_cri_linux.go file only being included for _linux builds which
means that the builds for Windows do not contain the CRI plugin. This can
be disabled for either platform with the no_cri tag.

Signed-off-by: Justin Terry (SF) <juterry@microsoft.com>
2020-02-20 22:00:49 -08:00
Akihiro Suda
8e685f78cf support building with BUILDTAGS="no_zfs no_aufs"
These plugins do not always need to be built-in.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-02-19 01:52:03 +09:00
Akihiro Suda
833701165a ctr events: do not exit on an error
Errors like `"type with url %s: not found"` are typical for non-builtin
event types, and should not resultin exiting `ctr`.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-01-29 13:10:16 +09:00
Akihiro Suda
b127b666aa ctr: support $CONTAINERD_ADDRESS env var
`$CONTAINERD_ADDRESS` can be specified instead of the `ctr --address` flag.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-01-07 15:59:12 +09:00
Wei Fu
5fc0f30167
Merge pull request #3903 from katiewasnothere/local_introspection
create local version of introspection service
2020-01-03 15:36:31 +08:00
Kathryn Baldauf
a18f77bea0 create local version of introspection service
Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
2020-01-02 12:34:23 -08:00
Xiaodong Ye
072dfbaf36 Support pushing a specific platform of a multi-architecture docker image to a registry
Signed-off-by: Xiaodong Ye <xiaodongy@vmware.com>
2019-12-23 17:24:45 +08:00
Boris Popovschi
49e7039a85 cpu metrics consistency
Signed-off-by: Boris Popovschi <zyqsempai@mail.ru>
2019-12-17 12:30:12 +02:00
Boris Popovschi
659c971cad task metrics fix
Signed-off-by: Boris Popovschi <zyqsempai@mail.ru>
2019-12-17 10:52:37 +02:00
bpopovschi
b98cc79184 Added memory and cpu metrics for cgroupv2
Signed-off-by: bpopovschi <zyqsempai@mail.ru>
2019-12-16 16:10:51 +02:00
Phil Estes
fa62b6d238
Use logrus instead of printf for warning
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2019-12-12 19:33:04 -05:00
Michael Crosby
5d93ece758
Merge pull request #3799 from AkihiroSuda/cgroup2
support cgroup2
2019-12-12 14:30:19 -05:00
Michael Crosby
1649e8e43b
Merge pull request #3848 from liaojh1998/master
support user remapping in ctr
2019-12-12 14:20:07 -05:00
Joakim Roubert
e0011978ff start.go: Improve help text
Change-Id: I9adfc27868b246fb85823d18c65f95668e3fbc58
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2019-12-12 11:19:41 +01:00
Jie Hao Liao
9862cb8f85 support user remapping in ctr
* --uidmap support for one remapping
* --gidmap support for one remapping
* create IoUid and IoGid options for getNewTaskOpts

Signed-off-by: Jie Hao Liao <liaojh1998@gmail.com>
2019-12-12 01:16:47 -06:00
Akihiro Suda
8f870c233f support cgroup2
* only shim v2 runc v2 ("io.containerd.runc.v2") is supported
* only PID metrics is implemented. Others should be implemented in separate PRs.
* lots of code duplication in v1 metrics and v2 metrics. Dedupe should be separate PR.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-12-12 02:56:51 +09:00
Jie Hao Liao
787be0efe2 Modify ctr run to search for read-only flag instead of readonly
Signed-off-by: Jie Hao Liao <liaojh1998@gmail.com>
2019-12-04 02:18:23 -06:00
Phil Estes
11ef041ff4
Update golang.org/x/sys to recent commit
This prepares us to be able to update docker/docker vendoring to a
recent commit.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2019-11-22 19:34:38 -05:00
Lantao Liu
0bb48aef07 Add --log-file flag for windows service.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-11-15 16:57:39 -08:00
Akihiro Suda
8f74de9e9e ctr: allow specifying --runc-systemd-cgroup
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-11-08 14:06:08 +09:00
Akihiro Suda
7f5d900769 ctr: allow specifying --runc-binary
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-11-08 14:06:08 +09:00
Akihiro Suda
a2688b972c bring back aufs and zfs
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-10-30 17:51:27 +09:00
Phil Estes
aeec80fca1
Merge pull request #3773 from Random-Liu/use-logrus-trace
Use logrus trace support.
2019-10-25 07:45:31 -04:00
Lantao Liu
20e844a227 Use logrus trace support.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-10-24 20:12:19 -07:00
Derek McGowan
66aa1d3ef6
Add snapshot walk implementations
Temporarily remove zfs and aufs until interface update

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-10-24 11:11:22 -07:00
Lantao Liu
aaccfcbe2b Fix containerd config dump.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-10-23 22:38:18 -07:00
Justin Terry (VM)
37b56cafc6 Add ctr metrics support for Windows/LCOW containers
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-10-23 13:50:34 -07:00
Michael Crosby
38937f0607
Merge pull request #3718 from crosbymichael/devperms
Add spec opts for host device and privileged handling
2019-10-11 09:56:14 -04:00
Michael Crosby
a6d3f4d30b
Add device opts to ctr --privileged
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-10-10 14:23:59 -04:00
Eli Uriegas
036db34f37
build: Fix manpage generation
Seems to be that docs/man/ctr.1.md and docs/man/containerd.1.md were
removed in #3637 and were not updated correctly in the Makefile, leading
to build failures like:

    + make man

    make: *** No rule to make target `man/ctr.1', needed by `man'.  Stop.

Changes the gen-manpages command to be specific on which manpages are to
be generated.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2019-10-08 18:22:23 +00:00
fahed dorgaa
c0984941e3 adding go version to client description
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>

gofmt version.go

Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>

add a Godoc

Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>

go fmt version.go

Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>

add sapces to comment

Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2019-10-06 13:38:51 +02:00
Phil Estes
309c9c25ba
Merge pull request #3706 from mrueg/enable-autocmpl
ctr: Enable shell autocompletion
2019-10-03 09:15:51 -04:00
Michael Crosby
8ff5827e98 Update cri and cgroup packages
This change includes a cri master bump and a cgroup bump for windows support
with cgroup stats and reusing the cgroup metric types.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-10-01 10:19:56 -04:00
Manuel Rüger
b5fa55b0c2 ctr: Enable shell autocompletion
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2019-10-01 09:43:21 +02:00
yuxiaobo
a0ae24b984 Word spelling correction
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-09-25 16:49:54 +08:00
Eli Uriegas
2a636f8c34
gen-manpages: Create man directory if it does not exist
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2019-09-23 20:31:26 +00:00
Michael Crosby
fd6299be98 Fix density spec generation
Fixes #3580

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-09-17 16:21:25 -04:00
Lajos Papp
19ecd49ed0 implement ctr -connect-timeout
Signed-off-by: Lajos Papp <lalyos@yahoo.com>
2019-09-16 13:56:53 +02:00
Michael Crosby
5a656cacb4 Move manpage gen to separate binary
This moves the man page generation to a separate binary

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-09-12 14:19:00 -04:00
Michael Crosby
f3a5b8c0a9 Add command to generate man pages
The climan package has a command that can be registered with any urfav
cli app to generate man pages.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-09-11 15:31:02 -04:00
Michael Crosby
51671ef734
Merge pull request #3630 from AkihiroSuda/ctr-newdockerauthorized
ctr: use NewDockerAuthorizer instead of deprecated NewAuthorizer
2019-09-09 12:47:10 -04:00
Akihiro Suda
c1fc21e92e ctr: use NewDockerAuthorizer instead of deprecated NewAuthorizer
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-09-09 02:38:07 +09:00
Michael Crosby
fa11147e5f Add --env-file to ctr
Closes #3517

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-09-06 16:25:02 -04:00
Michael Crosby
f76eefd272
Merge pull request #3574 from mxpv/cfg
Support config imports
2019-09-04 16:34:11 -04:00
Derek McGowan
01f7265892
Support v1 configurations for config dump
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-09-03 17:20:44 -07:00
Derek McGowan
b039c39186
Merge pull request #3564 from tiborvass/move-cgroups-dep-to-namespaces-pkg
runtime/opts: move WithNamespaceCgroupDeletion from containerd to its own package
2019-09-03 10:38:53 -07:00
Lantao Liu
dd24d76a13 Fix potential containerd panic during graceful shutdown.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-01 22:11:20 -07:00
Maksym Pavlenko
db3a711738 Add 'containerd config dump' subcommand
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-08-30 10:55:32 -07:00
Michael Crosby
779701b29c Add --seccomp flag to ctr
This enables testing of containers with the default seccomp profile

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-29 13:02:21 -04:00
Tibor Vass
6624a70d92 runtime/opts: move WithNamespaceCgroupDeletion from containerd to its own package
The cgroup dependency brings in quite a lot only for WithNamespaceCgroupDeletion,
which is a namespaces.DeleteOpt.

Signed-off-by: Tibor Vass <tibor@docker.com>
2019-08-27 19:02:55 +00:00
Michael Crosby
df84e546b5
Merge pull request #3577 from dmcgowan/change-default-manifest-download
[carry #3127] Update pull default to skip all platform manifests
2019-08-26 15:04:15 -04:00
Derek McGowan
a40c3830df
Add option to pull all metadata
Add flags to pull and fetch to grab all metadata.
Add fetch option to pull only metadata.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-08-26 11:05:21 -07:00
fesu
5cab0d3f3f update the max if cur will be greater than max for setting the limit
Signed-off-by: Su Fei <sofat1989@126.com>
2019-08-26 15:09:01 +08:00
Yu Yi
aae2d0d754
delete unnecessary checks and fix a test
Signed-off-by: Yu Yi <yiyu@google.com>
2019-08-23 14:02:56 -07:00
Yu Yi
9e183f5e52
add cli option to download all manifests
- Add `all-manifests` option to both `ctr content fetch` and `ctr
  images pull`. By default it is false.
- This option ties to `AppendDistributionSourceLabel` in client.

Signed-off-by: Yu Yi <yiyu@google.com>
2019-08-23 14:02:56 -07:00
Kevin Parsons
d7e1b25384 Allow explicit configuration of TTRPC address
Previously the TTRPC address was generated as "<GRPC address>.ttrpc".
This change now allows explicit configuration of the TTRPC address, with
the default still being the old format if no value is specified.

As part of this change, a new configuration section is added for TTRPC
listener options.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-08-22 00:56:27 -07:00
Michael Crosby
08061c7c3c
Merge pull request #3540 from crosbymichael/shim-hang
Use non-blocking send and retry for exit events
2019-08-20 09:31:21 -04:00
Phil Estes
c537c8968c
Merge pull request #3550 from kevpar/remove-eventlog
Remove Windows EventLog logging hook
2019-08-19 15:04:42 -04:00
Kevin Parsons
5023d96ad2 Remove Windows EventLog logging hook
EventLog is very old and provides a poor experience. We have supported
ETW for logging for a while, which is much better. We have also
observed an issue where EventLog keeps containerd.exe open, preventing
containerd from being upgraded to a new version. Due to all of this,
it makes sense to remove the old EventLog hook in favor of using ETW
logging on Windows as the primary diagnostic experience.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-08-19 10:24:37 -07:00
Michael Crosby
bee4c1a8a2 Add retry and non-blocking send for exit events
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-16 13:55:05 +00:00
Michael Crosby
0d27d8f4f2 Unifi reaper logic into package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-16 13:55:05 +00:00
Michael Crosby
2e8ea9fd6b Allow timeouts to be configured in config
This adds a singleton `timeout` package that will allow services and user
to configure timeouts in the daemon.  When a service wants to use a
timeout, it should declare a const and register it's default value
inside an `init()` function for that package.  When the default config
is generated, we can use the `timeout` package to provide the available
timeout keys so that a user knows that they can configure.

These show up in the config as follows:

```toml
[timeouts]
  "io.containerd.timeout.shim.cleanup" = 5
  "io.containerd.timeout.shim.load" = 5
  "io.containerd.timeout.shim.shutdown" = 3
  "io.containerd.timeout.task.state" = 2

```

Timeouts in the config are specified in seconds.

Timeouts are very hard to get right and giving this power to the user to
configure things is a huge improvement.  Machines can be faster and
slower and depending on the CPU or load of the machine, a timeout may
need to be adjusted.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-13 17:36:32 +00:00
Michael Crosby
d085d9b464 Remove encryption code from containerd core
We are separating out the encryption code and have designed a few new
interfaces and APIs for processing content streams.  This keep the core
clean of encryption code but enables not only encryption but support of
multiple content types ( custom media types ).

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-09 15:01:16 +00:00
Phil Estes
03d934adc4
Merge pull request #3474 from crosbymichael/uuid
Add UUID and server info to introspection
2019-08-06 15:58:05 -04:00
Akihiro Suda
225cc7d5bd
Merge pull request #3494 from jterry75/remove_v2
Completely remove Windows v2 in-tree shim
2019-08-07 02:19:12 +09:00
Michael Crosby
9f0bc2b53f Add UUID and server info to introspection
Closes #1862

This adds a new rpc to the introspection service to provide server
information with a generated UUID that is done on demand and the os and
arch of the server.

ctr output:

```bash
> sudo ctr version

Client:
  Version:  v1.2.0-802-g57821695.m
  Revision: 578216950de9c1c188708369e2a31ac6c494dfee.m

Server:
  Version:  v1.2.0-802-g57821695.m
  Revision: 578216950de9c1c188708369e2a31ac6c494dfee.m
  UUID: 92e982a9-f13e-4a2c-9032-e69b27fed454
  OS: linux
  ARCH: amd64
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-06 14:40:48 +00:00
Justin Terry (VM)
4b5dfaee13 Completely remove Windows v2 in-tree shim
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-08-05 16:49:56 -07:00
Lantao Liu
a5940da62c Remove ctr cri load and update cri-tools to v1.15.0
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-05 15:22:36 -07:00
Derek McGowan
adad947b77
Merge pull request #3460 from lumjjb/ctrrecipients
Specify protocols in ctr encrypt recipients
2019-08-01 15:37:40 -07:00
Michael Crosby
f543f2fbcd Call CloseIO when stdin closes in ctr
Fixes #2439

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-07-26 19:52:03 +00:00
Brandon Lum
8cd480c233 Specify protocols in ctr encrypt recipients
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2019-07-26 13:20:22 -04:00
Phil Estes
29930e9185
Merge pull request #3455 from dmcgowan/fix-default-import-compression
Add option to compress blobs on import
2019-07-25 16:45:11 -04:00
Derek McGowan
02826345cf
Add option to compress blobs on import
Change the default back to leave uncompressed and add
option to do the compression.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-07-25 12:05:38 -07:00