Commit Graph

1881 Commits

Author SHA1 Message Date
Michael Crosby
f3d9aae6e9 Merge pull request #956 from ehazlett/events-service
Events Service
2017-06-20 13:23:19 -07:00
Michael Crosby
de10f7c467 Update readme
This moves the scope table out into a separate doc and adds a few
examples to the readme to show the feature set of containerd.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-20 13:19:53 -07:00
Evan Hazlett
ab4181649b events: be nice to Sprintf
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-06-20 16:17:22 -04:00
Kenfe-Mickaël Laventure
ff2ceec224 Merge pull request #1019 from crosbymichael/delete-running
Don't delete container with task
2017-06-20 13:14:16 -07:00
Stephen J Day
d69ef98bfd
filters: add package for filter syntax
With this PR, we add the syntax to use for filtration of items over the
containerd API. This package defines a syntax and parser that can be
used across types and use cases in a uniform manner.

The syntax is fairly familiar, if you've used container ecosystem
projects.  At the core, we base it on the concept of protobuf field
paths, augmenting with the ability to quote portions of the field path
to match arbitrary labels. These "selectors" come in the following
syntax:

```
<fieldpath>[<operator><value>]
```

A basic example is as follows:

```
name=foo
```

This would match all objects that have a field `name` with the value
`foo`. If we only want to test if the field is present, we can omit the
operator. This is most useful for matching labels in containerd. The
following will match objects that has the field labels and have the
label "foo" defined:

```
labels.foo
```

We also allow for quoting of parts of the field path to allow matching
of arbitrary items:

```
labels."very complex label"==something
```

We also define `!=` and `~=` as operators. The `!=` operator will match
all objects that don't match the value for a field and `~=` will compile
the target value as a regular expression and match the field value
against that.

Selectors can be combined using a comma, such that the resulting
selector will require all selectors are matched for the object to match.
The following example will match objects that are named `foo` and have
the label `bar`:

```
name==foo,labels.bar
```

This filter syntax will be used across all APIs that allow listing of
objects and for filtering which event a cleint see. By using a common
syntax, we hope to keep API access uniform.

For the most part, this takes inspiration from docker, swarm and k8s,
but has the limitation that it only allows selection of an inner
product. We may expand to operators that implement `or`, `in` or
`notin`, but it is not clear that this is useful at this level of the
stack.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-06-20 13:03:35 -07:00
Michael Crosby
01dcdf213b Merge pull request #1027 from crosbymichael/reaper-lock
Handle start process errors in reaper
2017-06-20 10:42:20 -07:00
Phil Estes
966ceb2c9a Merge pull request #1028 from crosbymichael/content-codes
Don't log AlreadyExists errors
2017-06-20 13:32:49 -04:00
Michael Crosby
9ea7e47e78 Merge pull request #1030 from stevvooe/calculate-correct-image-size
images: calculate size using ChildrenHandler
2017-06-20 10:26:40 -07:00
Evan Hazlett
935645b03a events: add protos
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

events: update events package to include emitter and use envelope proto

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

events: add events service

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

events: enable events service and update ctr events to use events service

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

event listeners

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

events: helper func for emitting in services

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

events: improved cli for containers and tasks

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

create event envelope with poster

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

events: introspect event data to use for type url

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

events: use pb encoding; add event types

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

events: instrument content and snapshot services with events

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

events: instrument image service with events

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

events: instrument namespace service with events

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

events: add namespace support

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

events: only send events from namespace requested from client

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

events: switch to go-events for broadcasting

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-06-20 10:47:28 -04:00
Michael Crosby
100b93ea46 Merge pull request #1029 from sameo/topic/typo
plugin: Fix runtime interface documentation
2017-06-19 12:05:16 -07:00
Michael Crosby
fc3d1161d0 Merge pull request #1023 from samuelkarp/with-namespace
containerd: Add WithLinuxNamespace to replace namespace
2017-06-19 12:03:54 -07:00
Samuel Karp
15c6e832aa containerd: Add WithNamespace to replace namespace
Signed-off-by: Samuel Karp <skarp@amazon.com>
2017-06-19 11:22:26 -07:00
Stephen J Day
549394b135
images: calculate size using ChildrenHandler
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-06-19 11:05:15 -07:00
Samuel Ortiz
ddea395572 plugin: Fix runtime interface documentation
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2017-06-19 18:47:26 +02:00
Michael Crosby
60c08fa386 Don't log AlreadyExists errors
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-16 16:39:52 -07:00
Michael Crosby
ecbc779209 Handle start process errors in reaper
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-16 16:03:13 -07:00
Michael Crosby
7e3b7dead6 Merge pull request #1022 from stevvooe/add-pull-support-for-manifest-list
image: add support for pulling manifest lists/oci indexes
2017-06-16 15:29:28 -07:00
Michael Crosby
e4dd5ce835 Merge pull request #1024 from stevvooe/correctly-flushing
cmd/{dist, ctr}: cleanup flushing and alignment
2017-06-16 15:03:57 -07:00
Stephen J Day
5a124794ae
image: add support for pulling manifest lists/oci indexes
This PR ensures that we can pull images with manifest lists, aka OCI
indexes. After this change, when pulling such an image, the resources
will all be available for creating the image.

Further support is required to do platform based selection for rootfs
creation, so such images may not yet be runnable. This is mostly useful
for checkpoint transfers, which use an OCI index for assembling the
component set.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-06-16 14:59:35 -07:00
Stephen J Day
5d13f8027c
cmd/{dist, ctr}: cleanup flushing and alignment
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-06-16 14:49:48 -07:00
Michael Crosby
4f20689d37 Merge pull request #1020 from chanezon/master
retrying pr for website to satify cncf guidelines
2017-06-16 14:39:25 -07:00
Patrick Chanezon
16f04383ae retrying pr for website to satify cncf guidelines
Signed-off-by: Patrick Chanezon <patlist@chanezon.com>

fixing validation issue for whitespace

Signed-off-by: Patrick Chanezon <patlist@chanezon.com>
2017-06-16 14:30:31 -07:00
Stephen Day
b4b16a1d45 Merge pull request #1016 from crosbymichael/servicefile
Add containerd unit file
2017-06-16 14:30:20 -07:00
Stephen Day
751bd54c89 Merge pull request #1021 from crosbymichael/with-image
Set image on rootfs options
2017-06-16 14:12:17 -07:00
Michael Crosby
0bc86860f0 Add containerd unit file
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-16 14:05:16 -07:00
Michael Crosby
79631498af Set image on rootfs options
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-16 13:51:24 -07:00
Michael Crosby
d922f48735 Merge pull request #1006 from dmcgowan/content-writer-exists
Content store writer checks expected
2017-06-16 13:29:07 -07:00
Michael Crosby
6c4a2691b3 Don't delete container with task
Make sure we don't delete a container with a live task

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-15 16:37:50 -07:00
Michael Crosby
9d155e8164 Merge pull request #1015 from crosbymichael/benchmark
Benchmark container create and task start
2017-06-15 16:07:32 -07:00
Michael Crosby
268ab7c053 Benchmark container create and task start
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-15 10:43:59 -07:00
Phil Estes
f2963f7562 Merge pull request #1012 from miaoyq/add-format-description-for-ctr-info
Add 'ArgsUsage' for ctr sub-cmds
2017-06-15 11:12:53 -04:00
Kenfe-Mickaël Laventure
40fbd282cc Merge pull request #1014 from ijc/log-when-skipping-a-plugin
Do not claim to be loading a plugin which we aren't.
2017-06-15 07:31:46 -07:00
Daniel, Dao Quang Minh
05cfd0e8d3 Merge pull request #1011 from AkihiroSuda/godoc
README.md: add GoDoc badge
2017-06-15 14:32:59 +01:00
Phil Estes
5e65d62ed9 Merge pull request #968 from dmcgowan/pull-schema-1
Add schema1 conversion on pull
2017-06-15 09:15:17 -04:00
Ian Campbell
66b7f8d79f Do not claim to be loading a plugin which we aren't.
I had forgotten to update my config.toml after #994 and was very confused by:

INFO[0000] starting containerd boot...                   module=containerd
INFO[0000] starting debug API...                         debug="/run/containerd/debug.sock" module=containerd
INFO[0000] loading plugin "io.containerd.content.v1.content"...  module=containerd type=io.containerd.content.v1
INFO[0000] loading plugin "io.containerd.snapshotter.v1.btrfs"...  module=containerd type=io.containerd.snapshotter.v1
INFO[0000] loading plugin "io.containerd.snapshotter.v1.overlayfs"...  module=containerd type=io.containerd.snapshotter.v1
INFO[0000] loading plugin "io.containerd.differ.v1.base-diff"...  module=containerd type=io.containerd.differ.v1
containerd: no plugins registered for io.containerd.snapshotter.v1

Where apparently two candidates for io.containerd.snapshotter.v1 had been
loaded but the error claimed (correctly, it turns out) that none were. With
this change instead I see:

INFO[0000] starting containerd boot...                   module=containerd
INFO[0000] starting debug API...                         debug="/run/containerd/debug.sock" module=containerd
INFO[0000] loading plugin "io.containerd.content.v1.content"...  module=containerd type=io.containerd.content.v1
INFO[0000] skipping plugin "io.containerd.snapshotter.v1.btrfs"...  module=containerd type=io.containerd.snapshotter.v1
INFO[0000] skipping plugin "io.containerd.snapshotter.v1.overlayfs"...  module=containerd type=io.containerd.snapshotter.v1
INFO[0000] loading plugin "io.containerd.differ.v1.base-diff"...  module=containerd type=io.containerd.differ.v1
containerd: no plugins registered for io.containerd.snapshotter.v1

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-06-15 14:04:56 +01:00
Akihiro Suda
490530be04 README.md: add GoDoc badge
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-06-15 08:08:17 +00:00
Yanqiang Miao
b88b53212f Add 'ArgsUsage' for some ctr sub-cmds
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-06-15 16:04:11 +08:00
Derek McGowan
c215531a8f Merge pull request #994 from crosbymichael/bundles
Setup plugin ids and dependencies
2017-06-14 17:03:46 -07:00
Derek McGowan
64bc516bbe
Add with block and fail on non-temp dial error
This guarantees that grpc requests will fail quickly
when the service is not started or does not have permission.
Without the fail on non-temp error the withblock will
cause the client to wait until the timeout before failing.

Fixes #989

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-06-14 16:50:37 -07:00
Michael Crosby
94e7f8e943 Setup plugin ids and dependencies
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-14 16:17:20 -07:00
Derek McGowan
38c3cc71de
Content store writer checks expected
Fixes #1004

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-06-14 14:54:13 -07:00
Derek McGowan
6bbed2c125 Merge pull request #1003 from crosbymichael/gprc-metrics
Register grpc metrics in main
2017-06-14 13:04:59 -07:00
Phil Estes
e10a9aff7d
Use error interfaces for content/metadata
These interfaces allow us to preserve both the checking of error "cause"
as well as messages returned from the gRPC API so that the client gets
full error reason instead of a default "metadata: not found" in the case
of a missing image.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2017-06-14 15:55:08 -04:00
Michael Crosby
f5c587c1f7 Merge pull request #1002 from mlaventure/runtime-error-bubble
Bubble up linux runtime errors
2017-06-14 12:25:25 -07:00
Kenfe-Mickael Laventure
c9064df2cf
Discard grpc logs by default
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-06-14 11:58:13 -07:00
Derek McGowan
8ed1e24ae9
Add blob state calculation to handle empty ambiguity
The size and throwaway fields in the history can bother be
omitted, making the emptiness of a layer ambiguous. In these
cases download and check whether the content is empty.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-06-14 11:53:52 -07:00
Michael Crosby
c2dd40c9bc Register grpc metrics in main
This needs to be registered last after all other services have been
registred.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-14 11:19:58 -07:00
Michael Crosby
9b8e76edf1 Merge pull request #929 from AkihiroSuda/ociimage
package for manipulating OCI images
2017-06-14 10:50:16 -07:00
Kenfe-Mickael Laventure
709ba260de
linux: Ensure shim is killed if we can't connect to it initially
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-06-14 10:21:48 -07:00
Kenfe-Mickael Laventure
5922cfaba8
linux: Bubble up runc error message
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-06-14 10:21:48 -07:00