Commit Graph

162 Commits

Author SHA1 Message Date
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
Wei Fu
75af17946d Pull: create image record after blobs download
When pull image with unpack option, the fetch action will defer blobs
download until unpack. If create image record in ImageService before
blobs download, the following requests to use image will fail because
there is still missing blobs download.

In order to fix concurrent issue, need to create image record after
blobs download.

Fix: #3937

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2020-01-20 18:26:14 +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
Lantao Liu
555cb31fd9 Support configurable default platform in the client.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-03 13:34:25 -07: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
Lantao Liu
60f73b6cf1 Support simultaneous image unpack.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-21 16:31:29 -07:00
Michael Crosby
fe3638e887 Add UnpackOpts to RemoteContext
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-08 15:42:51 +00:00
Lantao Liu
af7b7cdb02 Save default namespace in the client.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-08-07 12:03:22 -07: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
Derek McGowan
c965a6c4da
Prevent push by tag for sub-manifests
When pushing a manifest list, all manifests should be pushed by digest
and only the final manifest pushed by tag. The Pusher was preventing
this by mistakenly disallowing objects to contain a digest. When objects
have a digest, only push tags associated with that digest.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-07-31 15:19:44 -07: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
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
Michael Crosby
ce0d2489ac Fix regiression from #3403 with snapshot cmd
The snapshot command calls the snapshotter service directly, therefore,
the name must be resolved.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-07-16 19:24:24 +00: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
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
550a6f1d73 Fix integration tests
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-07-11 11:54:48 -07: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
47d2ac0902 Improve default label handling
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-07-10 12:15:08 -07:00
Michael Crosby
41e1bb8328 Fix snapshotter getter in client code
Fixes #3312

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-06-17 16:57:48 +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
Maksym Pavlenko
be2cbd0b2d Access to client's GRPC connection object
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-04-16 10:19:32 -07:00
Derek McGowan
2f60e389a0
Merge pull request #2626 from krsoninikhil/defaults3
Uses namespace labels for default options
2019-04-02 11:46:35 -07: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
Michael Crosby
84a24711e8 Add runc.v2 multi-shim
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-02-21 11:09:46 -05:00
Derek McGowan
dc09ed1e1a
Add image handler wrapper
Gives clients more control of the pull process, allowing
the client to operate on a descriptor after it has been
pulled. This could be useful for filtering output or
tracking children before they dispatched to. This can
also be used to call custom unpackers to have visibility
into a pulled config in parallel to the downloads.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-02-12 16:34:06 -08:00
Nikhil Soni
6a21728fb6 Use defaults package for listing namespace labels
Labels that are used for configuring defaults are moved to defaults package

Signed-off-by: Nikhil Soni <krsoninikhil@gmail.com>
2019-02-12 01:24:31 +05:30
Nikhil Soni
34323985a1 Use labels only when default namespace is provided and prefer given
options.

Implements same approach of setting defaults for `NewWithConn`.

Signed-off-by: Nikhil Soni <krsoninikhil@gmail.com>
2019-01-30 23:21:24 +05:30
Nikhil Soni
59432aaecf Take default runtime and snapshotter from namespace labels
Signed-off-by: Nikhil Soni <krsoninikhil@gmail.com>
2019-01-30 23:21:24 +05:30
Lantao Liu
d7ed403072 Add image pull concurrency limit.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-01-29 10:27:05 -08:00
Wei Fu
5137fc6f11 bugfix: support application/octet-stream during pull
Even though application/octet-stream issue has been fixed in docker,
there exists lots of images which contains the invalid mediatype.

In order to pull those images, containerd client side modifies the
manifest content before insert/update image reference.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2018-12-29 13:58:36 +08:00
Evan Hazlett
4fdf720b84 move rw to opt; make snapshot opt; move to NewContainerOpts
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-11-12 11:47:17 +00:00
Evan Hazlett
ce0673fd7d Restore take image
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-11-12 11:47:17 +00:00
Evan Hazlett
0e4d9da755 remove task handling from Restore
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-11-12 11:47:16 +00:00
Evan Hazlett
2d3db08daf refactor spec and snapshot restore into opts
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-11-12 11:45:22 +00:00
Evan Hazlett
45c700a955 refactor checkpoint and restore to client
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-11-12 11:45:22 +00:00
Derek McGowan
3d1082e06d
Add a manifest filter limiting the number of matches
Adds a manifest filter for pulling which ensures only one
manifest from a manifest list is pulled even when multiple matches.
Removes unused filter platform list.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-08-27 17:03:55 -07:00
Derek McGowan
9edcfcc1cb
Add platform match comparer interface
Adds a new platform interface for matching and comparing platforms.
This new interface allows both filtering and ordering of platforms
to support running multiple platform and choosing the best platform.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-08-27 00:11:46 -07:00
Michael Crosby
97e73c9348 Add WithTime as client Opt
This also sets the default timeout to 10s instead of 60s.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-08-16 14:57:19 -04:00
Derek McGowan
d64d8a06d5
Use image constructor in client
Replace manual image struct creation with the image
constructor which is there to do just that.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-07-31 15:23:08 -07:00
Phil Estes
ed0e73422d
Merge pull request #2468 from dmcgowan/set-platform-on-unpack
Update client Image to have configurable platform
2018-07-31 11:56:09 -04:00
Michael Fraenkel
9a4d1c5f8d Use connection lock when creating services
Fixes #2335

Signed-off-by: Michael Fraenkel <michael.fraenkel@gmail.com>
2018-07-24 10:46:17 -04:00
Michael Crosby
0d52c71c80
Merge pull request #2474 from dmcgowan/lease-expiration
Improved lease management
2018-07-20 16:54:17 -04:00
Derek McGowan
8cf3fad8d4
Add leases manager interface
Add leases manager to the leases package and use the
interface on the client and service.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-07-18 10:43:37 -07:00
Derek McGowan
3a916a0f67
Update client Image to have configurable platform
Separate Fetch and Pull commands in client to distinguish
between platform specific and non-platform specific operations.
`ctr images pull` with all platforms will now unpack all platforms.
`ctr content fetch` now supports platform flags.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-07-17 15:43:03 -07:00
Michael Crosby
da1b5470cd Runtime v2
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-17 10:21:29 -04:00
Michael Crosby
c7083eed5d
Merge pull request #2369 from dmcgowan/update-grpc
Update grpc to 1.12
2018-05-30 11:07:10 -04:00
Derek McGowan
55afe3359a
Update grpc timeout and logger
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-05-29 15:32:37 -07:00
Phil Estes
e9434a10bc
Merge pull request #2341 from dmcgowan/move-client-content-snapshot
Move client implementations for content store and snapshotter
2018-05-25 13:47:39 -04:00
Michael Crosby
927517de36 Move dialer to pkg
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-05-22 13:32:25 -04:00