Commit Graph

1153 Commits

Author SHA1 Message Date
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
Phil Estes
7ff23438f6
Merge pull request #3452 from lumjjb/keybundles
Create CryptoConfig constructors to replace dcparameters
2019-07-25 14:57:59 -04:00
Michael Crosby
2190c0e5f7
Merge pull request #3450 from kevpar/windows-alloc-console
Allocate a conhost during Windows service startup
2019-07-25 14:55:22 -04:00
Phil Estes
15b59f9684
Merge pull request #3441 from YLonely/multiple-task-delete
Update ctr to support deleting multiple tasks at a time
2019-07-25 14:29:31 -04:00
Brandon Lum
3d1fa69694 Implemented constructors for both encryption and decryption
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2019-07-24 22:19:39 -04:00
BoWen Yan
392668d007 ctr:Support deleting multiple tasks at a time
Signed-off-by: BoWen Yan <loneybw@gmail.com>
2019-07-25 09:59:15 +08:00
Kevin Parsons
1c7eab1979 Allocate a conhost during Windows service startup
Creating a console for containerd causes it to be inherited by any child
processes, which gives us performance and reliability improvements. See
comment in code for more information.

Another option considered here would be to invoke each child process
with the DETACHED_PROCESS flag. This would save us the containerd
console allocation. The difficulty of this approach would be ensuring
that all process invocation points have had this flag added, and that
any future invocations also use the flag.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-07-24 17:50:24 -07:00