Commit Graph

1153 Commits

Author SHA1 Message Date
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
Phil Estes
fdab4f4789
Merge pull request #3446 from stefanberger/cleanup
Wrap creation of CryptoConfig in constructors
2019-07-24 14:46:13 -04:00
Stefan Berger
364de4c35d Wrap creation of CryptoConfig in constructors
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-07-23 19:53:23 -04:00
Michael Crosby
f055bdb0aa Remove windows v1 runtime
Closes #3094

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-07-23 18:54:37 +00:00
Derek McGowan
f7761411b8
Merge pull request #3424 from crosbymichael/devices
Add linux device options and --devices flag to ctr
2019-07-22 16:39:02 -07:00
Phil Estes
49fdb9e1b4
Merge pull request #3430 from lumjjb/encgcfix
Made fixes and optimizations to encryption GC
2019-07-22 19:23:47 -04:00
Michael Crosby
1945e26ac3 Add concurrent execs in stress tests
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-07-19 19:12:44 +00:00
Michael Crosby
ffa86b25f9 Add new shims for checking binary sizes
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-07-19 17:49:11 +00:00
Brandon Lum
c6d437fd70 Corrected lease implementation
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2019-07-18 18:17:20 -04:00
Michael Crosby
725d3ad8cb Add --device flag to ctr
Closes #3066

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-07-18 18:51:05 +00:00
Wei Fu
283d5d9005
Merge pull request #3418 from stevvooe/backout-error-changes
errors: use errdefs errors in client and commands
2019-07-17 21:32:52 -04:00
Stephen Day
804ae89be6
errors: use errdefs errors in client and commands
This change moves from specific, global errors to the errdefs errors.
This makes it easy to handle certain classes of errors while still
adding context to the failure.

Signed-off-by: Stephen Day <stephen.day@getcruise.com>
2019-07-17 13:42:28 -07:00
Derek McGowan
dde436e65b Crypto library movement and changes to content helper interfaces
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-07-17 15:21:29 -04:00
Stefan Berger
bf8804c743 Implemented image encryption/decryption libraries and ctr commands
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2019-07-17 15:19:58 -04:00
Phil Estes
d6be45e151
Merge pull request #3416 from crosbymichael/hard-code-err
Replace hard coded error messages
2019-07-15 17:14:59 -04:00
Michael Crosby
61d930ad5b Move specific errors to their respective packages
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-07-15 20:21:11 +00:00
Phil Estes
82826df9bd
Small refactor due to CI linter changes
Without the open variable in use, no reason to define it or use it as the
for loop control.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2019-07-15 10:43:31 -07:00
Michael Crosby
f3e148b1cc
Merge pull request #3411 from mxpv/linter
Switch from gometalinter to golangci-lint
2019-07-15 10:58:59 -04:00
Maksym Pavlenko
ef7f46eb7b Fix linter errors
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-07-14 20:49:40 -07:00
Fahed Dorgaa
abc152d14c fix name in containers file
Signed-off-by: Fahed Dorgaa <fahed.dorgaa@gmail.com>
2019-07-14 21:49:07 +02:00
Peng Wang
4988424fc0 * fix: view snapshot is deleted before diff
Signed-off-by: Peng Wang <wang_peng168@163.com>
2019-07-14 07:06:04 -04:00
Fahed Dorgaa
db95af43f3 centralize harded-code message
Signed-off-by: Fahed Dorgaa <fahed.dorgaa@gmail.com>
2019-07-13 15:07:23 +02:00
Maksym Pavlenko
1918ee4d11 Respect default snapshotter label
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-07-10 12:16:43 -07:00
Maksym Pavlenko
4e2fc81edd Add aliases to namespaces subcommand
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-07-10 12:10:14 -07:00
Michael Crosby
6601b406b7 Refactor runtime code for code sharing
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-07-08 11:47:53 -04:00
Eli Uriegas
af93e4009b ctr: Add images tag subcommand
Adds a subcommand for tagging images managed by containerd.

Usage:

  ctr images tag docker.io/library/alpine:latest docker.io/library/alpine:new

Comes with a --force flag to allow you to gracefully overwrite image references
that already exist.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2019-07-06 15:44:17 +00:00
Michael Crosby
876c8890ae
Merge pull request #3384 from mxpv/exec-log-uri
Support --log-uri in exec subcommand
2019-07-02 14:34:13 -04:00
Maksym Pavlenko
46af8ccd2d Check exec log flags compatibility
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-07-02 09:53:11 -07:00
Eric Hotinger
9fda4a5fe6 Bumps the version of go-winio.
This also refactors the lcow and windows
snapshotters to use go-winio's utility functions for checking the
filesystem type.

Signed-off-by: Eric Hotinger <ehotinger@gmail.com>
2019-07-01 14:51:06 -07:00
Maksym Pavlenko
6b59b425e2 Support --log-uri for exec subcommand
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-07-01 13:32:37 -07:00
Michael Crosby
844c58102e Add cgroup delete opt for ns deletion
Closes #3305

This adds an opt and a `--cgroup,-c` flag to `ctr namespaces rm` to
remove the cgroup that is commonly created with runtimes.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-07-01 15:01:02 -04:00
Shukui Yang
ec78305c49 Close the inherited socket fd
containerd-shim has dup the fd 3, and it don't need fd 3 any more.

Signed-off-by: Shukui Yang <keloyangsk@gmail.com>
2019-06-20 19:35:05 +08:00
Michael Crosby
31afff2944 Fix backwards compat with v2 containerd configs
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-06-11 23:44:39 +00:00
Michael Crosby
9547d269a1 Add v2 server config support with plugin URIs
Closes #3210

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-06-10 17:54:20 +00:00
Phil Estes
1c5b384b30
Merge pull request #3313 from kevpar/service-restart-delay
Change restart delay for Windows service to 15s
2019-05-31 15:30:59 +01:00
Kevin Parsons
cee19d1e6e Change restart delay for Windows service to 15s
Previously we waited for 60 seconds after the service faults to restart
it. However, there isn't much benefit to waiting this long. We expect
15 seconds to be a more reasonable delay.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-05-29 16:41:27 -07:00
Wei Fu
290fc9eeab
Merge pull request #3301 from dmcgowan/add-run-platform
Fix run with specified platform
2019-05-24 03:22:35 +08:00
Derek McGowan
a274dbe822
Fix run with specified platform
Adds the platform flag to the run command and resolves
the image based on that platform.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-05-23 11:59:33 -07:00
Derek McGowan
25daa7355c
Merge pull request #3192 from thaJeztah/bump_grpc_1.19.1
bump google.golang.org/grpc v1.20.1
2019-05-22 11:58:52 -07:00
Phil Estes
b99a66c267
Merge pull request #3288 from Ace-Tang/easy-shim
ctr: make ctr shim command easy to use
2019-05-17 15:40:39 +02:00
Wei Fu
e61f7f4913
Merge pull request #3172 from dmcgowan/export-docker-compatibility
Update image export to support Docker format
2019-05-17 14:30:54 +08:00
Ace-Tang
6907062863 ctr: make ctr shim command easy to use
make ctr shim command easy to use for user, shim socket is generated
through sha256, and it can not get directly, change socket flag to id
command, generated socket in code.
It also avoid fail to connect shim v2, since shim v2 have multiple
containers, `ctr shim --socket state` should specify container id, or
get error `rpc error: code = NotFound desc = container not created: not
found`

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-05-17 11:56:08 +08:00
Wei Fu
fbb80b9510 containerd-shim: redirect output into stdout fifo
Redirect is used to make sure that containerd still can read the log of
shim after restart.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-05-12 23:03:28 +08:00
Michael Crosby
67b45aef49 Add WithoutRefreshed metadata
Closes #2566

This provides faster lookups and lists for ctr commands.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-05-10 15:16:14 +00:00
Michael Crosby
bd27bef4ad Move checkpoint and restore commands to new files
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-05-10 14:20:19 +00:00
Sebastiaan van Stijn
2ed8e60fa1
bump google.golang.org/grpc v1.20.1
full diff: https://github.com/grpc/grpc-go/compare/v1.12.2...v1.20.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-05-05 12:39:23 -07:00
Phil Estes
d71c7ada27
Merge pull request #3259 from BenTheElder/no-unpack
ctr images import: add --no-unpack option
2019-05-05 12:29:45 -07:00
Benjamin Elder
cb7c780af2 ctr images import: add --no-unpack option
Signed-off-by: Benjamin Elder <bentheelder@google.com>
2019-05-01 17:09:30 -07:00
Davor Kapsa
cfc36388b3 Remove redundant error checks
Signed-off-by: Davor Kapsa <davor.kapsa@gmail.com>
2019-04-30 21:28:51 +02:00
Kevin Parsons
0376dd4605 Don't write dumped stacks to file for ETW capture state
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-04-19 10:11:24 -07:00
John Howard
7718d060eb Write stack dump to os.TempDir() as well
Signed-off-by: John Howard <jhoward@microsoft.com>
2019-04-18 09:26:11 -07:00
Kevin Parsons
78f3dc433c Allow dumping stacks via ETW capture state
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-04-15 13:35:35 -07:00
Derek McGowan
5f4c977ba0
Merge pull request #3162 from crosbymichael/tcpservice
Add tcp service for grpc listeners
2019-04-11 11:55:00 -07:00
Phil Estes
5703f415c6
Merge pull request #3197 from Random-Liu/add-required-plugins
Add support for required plugins.
2019-04-11 12:02:16 +02:00
Lantao Liu
4b3b99ea11 Add support for required plugins.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-04-10 11:31:59 -07:00
Michael Crosby
b911ae3428 Add tcp service for grpc listeners
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-04-10 11:12:50 -04:00
Michael Crosby
a8a805cad3 Add ttrpc server to containerd
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-04-09 13:08:23 -04:00
Derek McGowan
4754d2aeee
Update image export to support Docker format
Add manifest.json file which is used by Docker
to import images.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-04-04 15:23:06 -07:00
Lantao Liu
74eb0dc812 Return event publish errors.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-04-04 14:55:38 -07:00
Michael Crosby
e7b6fea572
Merge pull request #3022 from mxpv/devmapper
Integrate device mapper snapshotter
2019-03-29 00:06:11 -04:00
Phil Estes
9ab4c8cbcc
Merge pull request #3108 from alculquicondor/fix/import
Allow to import an image for the default platform only.
2019-03-19 13:29:57 -04:00
Aldo Culquicondor
9a8727cf09 Allow to import an image for the default platform only.
Add `all-platforms` option to `ctr images import`.

Signed-off-by: Aldo Culquicondor <acondor@google.com>
2019-03-19 11:25:57 -04:00
Phil Estes
b90eeadafa
Merge pull request #3102 from Ace-Tang/arg_usage
ctr: fix image cmd ArgsUsage
2019-03-18 08:37:18 -07:00
Ace-Tang
14a050688d ctr: fix image cmd ArgsUsage
ctr image list/check 's ArgsUsage should be filter, not ref

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-03-18 21:11:34 +08:00
Phil Estes
9ed2c0aa02
Merge pull request #3085 from crosbymichael/shim-logs
Shim pluggable logging
2019-03-13 12:23:06 -07:00
Michael Crosby
e6ae9cc64f Shim pluggable logging
Closes #603

This adds logging facilities at the shim level to provide minimal I/O
overhead and pluggable logging options.  Log handling is done within the
shim so that all I/O, cpu, and memory can be charged to the container.

A sample logging driver setting up logging for a container the systemd
journal looks like this:

```go
package main

import (
	"bufio"
	"context"
	"fmt"
	"io"
	"sync"

	"github.com/containerd/containerd/runtime/v2/logging"
	"github.com/coreos/go-systemd/journal"
)

func main() {
	logging.Run(log)
}

func log(ctx context.Context, config *logging.Config, ready func() error) error {
	// construct any log metadata for the container
	vars := map[string]string{
		"SYSLOG_IDENTIFIER": fmt.Sprintf("%s:%s", config.Namespace, config.ID),
	}
	var wg sync.WaitGroup
	wg.Add(2)
	// forward both stdout and stderr to the journal
	go copy(&wg, config.Stdout, journal.PriInfo, vars)
	go copy(&wg, config.Stderr, journal.PriErr, vars)

	// signal that we are ready and setup for the container to be started
	if err := ready(); err != nil {
		return err
	}
	wg.Wait()
	return nil
}

func copy(wg *sync.WaitGroup, r io.Reader, pri journal.Priority, vars map[string]string) {
	defer wg.Done()
	s := bufio.NewScanner(r)
	for s.Scan() {
		if s.Err() != nil {
			return
		}
		journal.Send(s.Text(), pri, vars)
	}
}
```

A `logging` package has been created to assist log developers create
logging plugins for containerd.

This uses a URI based approach for logging drivers that can be expanded
in the future.

Supported URI scheme's are:

* binary
* fifo
* file

You can pass the log url via ctr on the command line:

```bash
> ctr run --rm --runtime io.containerd.runc.v2 --log-uri binary://shim-journald docker.io/library/redis:alpine redis
```

```bash
> journalctl -f -t default:redis

-- Logs begin at Tue 2018-12-11 16:29:51 EST. --
Mar 08 16:08:22 deathstar default:redis[120760]: 1:C 08 Mar 2019 21:08:22.703 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.704 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.704 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.704 # Current maximum open files is 1024. maxclients has been reduced to 992 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.705 * Running mode=standalone, port=6379.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.705 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.705 # Server initialized
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.705 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.705 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.705 * Ready to accept connections
Mar 08 16:08:50 deathstar default:redis[120760]: 1:signal-handler (1552079330) Received SIGINT scheduling shutdown...
Mar 08 16:08:50 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:50.405 # User requested shutdown...
Mar 08 16:08:50 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:50.406 * Saving the final RDB snapshot before exiting.
Mar 08 16:08:50 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:50.452 * DB saved on disk
Mar 08 16:08:50 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:50.453 # Redis is now ready to exit, bye bye...
```

The following client side Opts are added:

```go
// LogURI provides the raw logging URI
func LogURI(uri *url.URL) Creator { }
// BinaryIO forwards contianer STDOUT|STDERR directly to a logging binary
func BinaryIO(binary string, args map[string]string) Creator {}
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-03-12 12:18:28 -04:00
Wei Fu
506b815483 remotes: add distribution labels to blob data
We can use cross repository push feature to reuse the existing blobs in
the same registry. Before make push fast, we know where the blob comes
from.

Use the `containerd.io/distribution.source. = [,]` as label format. For
example, the blob is downloaded by the docker.io/library/busybox:latest
and the label will be

    containerd.io/distribution.source.docker.io = library/busybox

If the blob is shared by different repos in the same registry, the repo
name will be appended, like:

    containerd.io/distribution.source.docker.io = library/busybox,x/y

NOTE:
1. no need to apply for legacy docker image schema1.
2. the concurrent fetch actions might miss some repo names in label, but
it is ok.
3. it is optional. no need to add label if the engine only uses images
not push.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-03-12 13:42:54 +08:00
Maksym Pavlenko
1e893b19ce
devmapper: add no_devmapper build tag
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-03-07 10:53:19 -08:00
Wei Fu
6424a36032 ctr/commands/images/push: don't show progress if it is debug mode
If user sets debug mode, the command push should only show the debug log
information. If the stdout is with flush by the progress status, it is
hard to see the debug log.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-03-05 22:21:55 +08:00
Michael Crosby
dea27b1b64
Merge pull request #3036 from jhowardmsft/jjh/etw
Windows: Enable ETW logging
2019-02-21 20:12:35 -05:00
Maksym Pavlenko
2218275ec9
devmapper: register plugin
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-02-21 16:25:55 -08:00
John Howard
e0d7ed12a5 Windows: Enable ETW logging
Signed-off-by: John Howard <jhoward@microsoft.com>
2019-02-21 14:16:44 -08:00
Michael Crosby
84a24711e8 Add runc.v2 multi-shim
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-02-21 11:09:46 -05:00
Michael Crosby
6bcbf88f82 Move runc shim code into common package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-02-21 10:47:41 -05:00
Veeraiah Chowdary Nuvvula
f6ac73d71e fixing typo and added a missing comment.
Signed-off-by: Veeraiah Chowdary Nuvvula <venuvvul@microsoft.com>
2019-02-18 14:13:02 -08:00
John Howard
88f19a90a8 Windows: Update stackdump event name
Signed-off-by: John Howard <jhoward@microsoft.com>
2019-02-15 15:33:29 -08:00
Justin Terry (VM)
00895670e7 Stop sending stderr with TTY on Windows
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-02-11 23:11:40 -08:00
John Howard
59ea134ce1 OCI Modifiers for Windows
Signed-off-by: John Howard <jhoward@microsoft.com>

Needed for the containerd work on Windows and integrating the
oci package from containerd into moby.

No longer sets defaults for
 - .Process.ConsoleSize
 - .Windows.IgnoreFlushesDuringBoot
 - .Windows.Network.AllowUnqualifiedDNSQuery

Adds helper functions and tests for
 - WithWindowsIgnoreFlushesDuringBoot
 - WithWindowNetworksAllowUnqualifiedDNSQuery

Updates `ctr run` on Windows to use the new helper functions,
ConsoleSize is already handled.
2019-02-06 10:44:36 -08:00
Wei Fu
132ee9b826 fix: linter issue
megacheck, gosimple and unused has been deprecated and subsumed by
staticcheck. And staticcheck also has been upgraded. we need to update
code for the linter issue.

close: #2945

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-01-23 22:54:51 +08:00
Phil Estes
df97414a77
Merge pull request #2622 from kadisi/export_bug
fix ctr image export not found error
2019-01-16 12:59:34 -05:00
Phil Estes
06e04bc5a9
Merge pull request #2830 from Ace-Tang/support_cr_without_image
cr: support checkpoint/restore without image
2018-12-20 13:24:37 -05:00
kadisi
40267382c5 fix ctr image export not found error
Signed-off-by: Jie Zhang <iamkadisi@163.com>
2018-12-17 08:52:28 +08:00
Justin Cormack
8be05eb237
Fix freebsd build
This brings freebsd in line with Darwin, ie it builds, but some parts may not yet
be fully functional. There is now a WIP `runc` port for FreeBSD at
https://github.com/clovertrail/runc/tree/1501-SupportOnFreeBSD so should be able
to test further.

Signed-off-by: Justin Cormack <justin@specialbusservice.com>
2018-12-16 14:27:42 +00:00
Wei Fu
603e97a9ec ctr/content: make editor flag is required
The $EDITOR is not clear for user. If the env doesn't set the value for
$EDITOR, the users don't know how to use this subcommand when they get
error like this:

```
sh: 1: /tmp/edit-605573012: Permission denied
```

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2018-12-11 18:55:09 +08:00
Justin Terry (VM)
7ac221e8d7 Adding ctr memory and cpu flags
Adds ctr run --memory-limit for all platforms.
Adds ctr run --cpu-count for Windows platforms.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-12-10 13:31:59 -08:00
Michael Crosby
4a8acf54b1
Merge pull request #2793 from lifubang/runexecflag
fix container cmd args may parsed as ctr args
2018-12-04 11:05:51 -05:00
Lifubang
2d3a4f99ec should no defer when detach
Signed-off-by: Lifubang <lifubang@acmcoder.com>
2018-12-03 19:18:57 +08:00
Michael Crosby
09a5b1f8af
Merge pull request #2839 from jhowardmsft/jjh/service
Windows: Allow running as a service
2018-11-30 11:11:16 -05:00
Ace-Tang
6593399e9f cr: support checkpoint/restore without image
support checkpoint without committing a checkpoint dir into a
checkpoint image and restore without untar image into checkpoint
directory. support for both v1 and v2 runtime

Signed-off-by: Ace-Tang <aceapril@126.com>
2018-11-29 10:19:39 +08:00
Derek McGowan
82c57a3a38
Merge pull request #2828 from jterry75/ctr_isolation
Move ctr run --isolation to Windows only
2018-11-28 10:36:50 -08:00
Justin Terry (VM)
b4a642f6a5 Add dumpStacks support for containerd on Windows
Resolves: #1763

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-11-27 21:02:32 -08:00
John Howard
40d898a820 Windows: Allow running as a service
Signed-off-by: John Howard <jhoward@microsoft.com>

Allows containerd.exe to run as a Windows service. eg

Register: `.\containerd.exe --register-service`

Start: `net start containerd`
...
Stop: `net stop containerd`

Unregister: `.\containerd.exe --unregister-service`

When running as a service, logs will go to the Windows application
event log.
2018-11-27 17:28:04 -08:00
Michael Crosby
3eae8b9c3f
Merge pull request #2631 from masters-of-cats/shim-io-redirect
Use named pipes for shim logs
2018-11-27 10:44:00 -05:00
Justin Terry (VM)
f90e5d564a Move ctr run --isolation to Windows only
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-11-23 17:11:59 -08:00
Ace-Tang
461222dba8 fix: should get runtime name from container info
when use `ctr t checkpoint`, runtime name should get from container
info, but not passed by flag, since task has already running with
specified runtime

Signed-off-by: Ace-Tang <aceapril@126.com>
2018-11-23 15:39:43 +08:00
Derek McGowan
32aa0cd79b
Merge pull request #2632 from ehazlett/checkpoint-restore
Refactor checkpoint and restore to client
2018-11-20 16:31:08 -08:00
Lifubang
2101b1362e add ctr delete --exec-id to debug DeleteProcess
Signed-off-by: Lifubang <lifubang@acmcoder.com>
2018-11-20 19:53:06 +08:00
Phil Estes
55baf50b5a
Merge pull request #2798 from lifubang/execd
add flag -d for ctr t exec to run a service in container
2018-11-20 08:34:29 +08:00
Julia Nedialkova
1d4105cacf Use named pipes for shim logs
Relating to issue [#2606](https://github.com/containerd/containerd/issues/2606)

Co-authored-by: Oliver Stenbom <ostenbom@pivotal.io>
Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
Co-authored-by: Giuseppe Capizzi <gcapizzi@pivotal.io>
Co-authored-by: Danail Branekov <danailster@gmail.com>

Signed-off-by: Oliver Stenbom <ostenbom@pivotal.io>
Signed-off-by: Georgi Sabev <georgethebeatle@gmail.com>
Signed-off-by: Giuseppe Capizzi <gcapizzi@pivotal.io>
Signed-off-by: Danail Branekov <danailster@gmail.com>
2018-11-16 16:11:43 +02:00
Lifubang
01f5aa3878 add flag -d for ctr t exec to run a service in container
Signed-off-by: Lifubang <lifubang@acmcoder.com>
2018-11-16 14:29:45 +08:00
Lifubang
51ad4d3020 change args usage for ctr c create
Signed-off-by: Lifubang <lifubang@acmcoder.com>
2018-11-16 14:09:39 +08:00