Commit Graph

4032 Commits

Author SHA1 Message Date
Zhang Wei
a06abd7493 [progress] Fix wrong display of progress bar
When we try to pull an image with "ctr pull xxx", the progress bar
display will flush all the screen and make it so hard to find useful
information for user.

This commit fixes bugs for the progress bar, by correcting "line counting"
algorithm. Previous algorithm only counts number of "\n", but one line
can be longer than screen width, in which case it should be counted as
two lines. Also updated the screen cleaning ESC chars.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2017-10-17 00:24:54 +08:00
Kenfe-Mickaël Laventure
103dd0e75e Merge pull request #1644 from cpuguy83/unmarshal_error_desc
Improve error message for `WithContainerExtension`
2017-10-16 09:17:46 -07:00
Michael Crosby
c1a0775136 Build release tar and include hash
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-16 12:07:11 -04:00
Michael Crosby
7f4f4b5e68 Merge pull request #1646 from mlaventure/mlaventure-email
Update @mlaventure e-mail address
2017-10-16 11:21:01 -04:00
Phil Estes
3c7645a89d Merge pull request #1647 from yanxuean/typo
a typo in comment of Snapshotter.Update
2017-10-16 10:19:31 -04:00
yanxuean
d8d1209e50 a typo in comment of Snapshotter.Update
containerd/snapshot/snapshotter.go

Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
2017-10-16 19:36:27 +08:00
Kenfe-Mickael Laventure
bdf801bd36
Update @mlaventure e-mail address
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-10-13 14:50:33 -07:00
Brian Goff
0847ae6cdf Improve error message for WithContainerExtension
The previous error messages are not very descriptive in how to fix the
issue, especially since they come from container create and not when
calling `WithContainerExtensions`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-10-13 13:41:52 -04:00
Lantao Liu
09c2bfadd2 Reduce image pull race.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-10-13 05:17:43 +00:00
Derek McGowan
c66fd83eae Merge pull request #1636 from crosbymichael/cgroups
Bump cgroups dep to 38a61430f7ceb01581fba6dd7ead48
2017-10-12 15:52:46 -07:00
Michael Crosby
d805f77f50 Bump cgroups dep to 38a61430f7ceb01581fba6dd7ead48
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-12 14:24:16 -04:00
Phil Estes
91614a57dc Merge pull request #1633 from ijc/go1.9
Update docs with go 1.9 requirement.
2017-10-12 10:17:39 -04:00
Phil Estes
71c4ee5cf8 Merge pull request #1629 from dmcgowan/remove-archive-umask
archive: remove umask, replace with explicit chmod after create
2017-10-12 10:16:36 -04:00
Ian Campbell
680bab8468 Update docs with go 1.9 requirement.
re: #1632

The comment about plugins in README.md didn't seem relevant any longer so I
removed it.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-10-12 15:06:36 +01:00
Stephen Day
a543c937eb Merge pull request #1630 from stevvooe/beta2
release: prepare 1.0.0-beta.2
2017-10-11 18:09:50 -07:00
Stephen J Day
683ed979f4
release: prepare 1.0.0-beta.2
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-10-11 18:09:32 -07:00
Derek McGowan
dcf7ff5db5
Update apply diff to support context cancellation
Allows cancellation of apply when the grpc service issues a cancel.
Adds a timing log for apply.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-11 16:48:55 -07:00
Stephen Day
1fe31c7e2e Merge pull request #1628 from crosbymichael/release-tool
add release tool to generate releases
2017-10-11 16:15:53 -07:00
Michael Crosby
769d9e16bd add release tool to generate releases
This tool makes our standard release template easy to generate.  It also
adds a few features like marking changed dependnencies for packages and
others to know what updated from the last release.

usage:
`containerd-release -n releases/v1.0.0-beta.2.toml`

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-11 18:51:13 -04:00
Derek McGowan
e20b371807
Remove umask, replace with explicit chmod after create
Call chmod on all open files and created directories to
ensure permission is set as expected without changing umask.

Fixes #1608

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-11 15:13:18 -07:00
Stephen Day
587f25245a Merge pull request #1563 from dmcgowan/gc-alpha
Metadata garbage collection
2017-10-11 14:31:44 -07:00
Michael Crosby
3cc75915db Merge pull request #1627 from jessvalarezo/task-remove-cast
Remove ProcessInfo cast
2017-10-11 16:11:22 -04:00
Jess Valarezo
1e69de18bd Remove ProcessInfo cast
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-10-11 13:01:15 -07:00
Phil Estes
b5152f2746 Merge pull request #1626 from jessvalarezo/windows-changes
Change hcsshimopts to hcsshimtypes package
2017-10-11 15:00:52 -04:00
Jess Valarezo
830e0ea339 Change hcsshimopts to hcsshimtypes package
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-10-11 11:42:07 -07:00
Derek McGowan
ffb03c4fe2
Add checkpoint and userns gc labels
Prevent checkpoints from getting garbage collected by
adding root labels to unreferenced checkpoint objects.
Mark checkpoints as gc roots.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-11 11:26:46 -07:00
Derek McGowan
de7b281856
Update services to call garbage collection
Call garbage collection on container and image deletion.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-11 10:42:47 -07:00
Derek McGowan
17471d5592
Metadata garbage collection
Marks and sweeps unreferenced objects.
Add snapshot cleanup to metadata.
Add content garbage collection

Add dirty flags for snapshotters and content store which
are set on deletion and used during the next garbage collection.
Cleanup content store backend when content metadata is removed.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-11 10:42:47 -07:00
Derek McGowan
7884707c2f
Add reference labels to snapshots and content
Ensure all snapshots and content are referenced on commit and
protected from cleanup.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-11 10:42:47 -07:00
Stephen Day
551579b316 Merge pull request #1621 from dmcgowan/refactor-diff
Refactor differ into separate package
2017-10-11 10:21:19 -07:00
Derek McGowan
64a96aab8a
Abort newly created references on error
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-11 10:10:19 -07:00
Derek McGowan
69e7e7fa4f
Add error wrapping for client checkpoint errors
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-11 10:02:29 -07:00
Derek McGowan
d9db1d112d
Refactor differ into separate package
Add differ options and package with interface.
Update optional values on diff interface to use options.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-11 10:02:29 -07:00
Michael Crosby
60960e1c17 Merge pull request #1597 from stevvooe/introspection-service
api/services: define the introspection API
2017-10-11 10:57:11 -04:00
Stephen J Day
0e72ce5c5b
services/introspection: implement plugin reporting
With this change, we integrate all the plugin changes into the
introspection service.

All plugins can be listed with the following command:

```console
$ ctr plugins
TYPE                            ID             PLATFORM       STATUS
io.containerd.content.v1        content        -              ok
io.containerd.metadata.v1       bolt           -              ok
io.containerd.differ.v1         walking        linux/amd64    ok
io.containerd.grpc.v1           containers     -              ok
io.containerd.grpc.v1           content        -              ok
io.containerd.grpc.v1           diff           -              ok
io.containerd.grpc.v1           events         -              ok
io.containerd.grpc.v1           healthcheck    -              ok
io.containerd.grpc.v1           images         -              ok
io.containerd.grpc.v1           namespaces     -              ok
io.containerd.snapshotter.v1    btrfs          linux/amd64    error
io.containerd.snapshotter.v1    overlayfs      linux/amd64    ok
io.containerd.grpc.v1           snapshots      -              ok
io.containerd.monitor.v1        cgroups        linux/amd64    ok
io.containerd.runtime.v1        linux          linux/amd64    ok
io.containerd.grpc.v1           tasks          -              ok
io.containerd.grpc.v1           version        -              ok
```

There are few things to note about this output. The first is that it is
printed in the order in which plugins are initialized. This useful for
debugging plugin initialization problems. Also note that even though the
introspection GPRC api is a itself a plugin, it is not listed. This is
because the plugin takes a snapshot of the initialization state at the
end of the plugin init process. This allows us to see errors from each
plugin, as they happen. If it is required to introspect the existence of
the introspection service, we can make modifications to include it in
the future.

The last thing to note is that the btrfs plugin is in an error state.
This is a common state for containerd because even though we load the
plugin, most installations aren't on top of btrfs and the plugin cannot
be used. We can actually view this error using the detailed view with a
filter:

```console
$ ctr plugins --detailed id==btrfs
Type:          io.containerd.snapshotter.v1
ID:            btrfs
Platforms:     linux/amd64
Exports:
               root      /var/lib/containerd/io.containerd.snapshotter.v1.btrfs
Error:
               Code:        Unknown
               Message:     path /var/lib/containerd/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter
```

Along with several other values, this is a valuable tool for evaluating the
state of components in containerd.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-10-10 17:29:24 -07:00
Stephen J Day
49814646cf
plugin: allow declaring a plugin depends on all others
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-10-10 16:40:47 -07:00
Stephen J Day
8508e8252b
plugin: refactor plugin system to support initialization reporting
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-10-10 16:40:47 -07:00
Stephen J Day
fe52d9369f
errdefs: use status package for mapping errors
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-10-10 16:40:47 -07:00
Stephen J Day
d8bd6b70ce
plugin: allow querying plugin graph to be re-entrant
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-10-10 16:40:47 -07:00
Stephen J Day
363d692f35
api/services: define the introspection API
After several requests for information about platform support,
configuration introspection and feature switches, we now have a solution
that should work in all these use cases. The Introspection API hooks
into the plugin subsystem registration process. During registration,
plugins declare several pieces of information, allowing clients to
discover the cababilities and support that a containerd instance
provides, including whether or not it loaded with an error.

To allow symmetrical error reporting, the `google/rpc.Status` protobuf
definitions have been brought in from the googleapis project.
Unfortunately, we had to generate these in place to match our protobuf
system.

Once we like this design, we can add an implementation to integrate it
directly with the plugin system.

Enjoy!

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-10-10 16:40:47 -07:00
Michael Crosby
12c79cc0d9 Merge pull request #1604 from jessvalarezo/windows-listpids
ListPids returns process details in addition to process IDs.
2017-10-10 19:26:47 -04:00
Jess
061c719209 ListPids returns process ID and other info
Signed-off-by: Jess <jessica.valarezo@docker.com>
2017-10-10 22:57:15 +00:00
Phil Estes
96725a5a0b Merge pull request #1620 from mlaventure/runc-io-id
Allow setting the uid & gid of the io pipes
2017-10-10 17:12:34 -04:00
Kenfe-Mickael Laventure
c807ba8379
Allow setting the uid & gid of the io pipes
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-10-10 13:24:12 -07:00
Phil Estes
1ea8ac41d3 Merge pull request #1617 from crosbymichael/2cgroup
Use namespace in default cgroup path
2017-10-10 10:55:12 -04:00
Michael Crosby
d7864eb77b Use namespace in default cgroup path
By default, the generated spec will place containers in cgroups by their
ids, we need to use the namespace as the cgroup root to avoid
containers with the same name being placed in the same cgroup.

```
11:perf_event:/to/redis
10:freezer:/to/redis
9:memory:/to/redis
8:devices:/to/redis
7:net_cls,net_prio:/to/redis
6:pids:/to/redis
5:hugetlb:/to/redis
4:cpuset:/to/redis
3:blkio:/to/redis
2:cpu,cpuacct:/to/redis
1:name=systemd:/to/redis

11:perf_event:/te/redis
10:freezer:/te/redis
9:memory:/te/redis
8:devices:/te/redis
7:net_cls,net_prio:/te/redis
6:pids:/te/redis
5:hugetlb:/te/redis
4:cpuset:/te/redis
3:blkio:/te/redis
2:cpu,cpuacct:/te/redis
1:name=systemd:/te/redis
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-09 17:07:57 -04:00
Michael Crosby
72bb45ac46 Merge pull request #1603 from mlaventure/fix-windows-flaky-tests
windows: ensure a init process exist after "Create()"
2017-10-09 11:58:23 -04:00
Kenfe-Mickael Laventure
cfa87567a0
windows: Create init process with task
This prevents `task.Wait()` to return an error if it is called before the task
is started.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-10-09 08:40:12 -07:00
Kenfe-Mickael Laventure
ad5266456c
windows: Fix a few races
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-10-09 08:40:12 -07:00
Kenfe-Mickaël Laventure
b2e348231c Merge pull request #1584 from miaoyq/fix-mount-lookup-err
Fixes looking up mountinfo corresponds to path
2017-10-09 08:35:01 -07:00