Commit Graph

149 Commits

Author SHA1 Message Date
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
Phil Estes
e63768ea09
Merge pull request #2331 from dmcgowan/fix-image-remove-race
Fix image pull and remove race
2018-05-16 11:05:26 -04:00
Derek McGowan
6e64091322
Move client content store to proxy package
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-05-08 14:54:02 -07:00
Derek McGowan
0d1807a43d
Move client snapshotter to separate package
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-05-08 14:45:27 -07:00
Derek McGowan
f0b3d5a2c5
Move image creation after unpack
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-05-07 15:50:51 -07:00
Derek McGowan
2bc9f49ffd
Retry image creation after update not found
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-05-07 15:50:51 -07:00
Derek McGowan
70d629fc1d
Add missing return statement on pull unpack
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-05-07 14:18:22 -07:00
Michael Crosby
8ee52bfca9 Move import/export code to separate client file
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-05-04 15:48:41 -04:00
Michael Wan
7fd6d5e2be fix words misspell
Signed-off-by: Michael Wan <zirenwan@gmail.com>
2018-04-23 00:09:42 -04:00
Michael Crosby
c47cbe7b57 Only close if conn exists
For internal services like cri, close will panic

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-04-09 14:54:34 -04:00
Stephen J Day
acc71293c5
server: allow configuration default send/recv message sizes
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2018-03-23 16:17:23 -07:00
Derek McGowan
43d0a5cb60
Pass in context to lease done function in client
Allows the client to choose the context to finish the lease.
This allows the client to switch contexts when the main context
used to the create the lease may have been cancelled.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-03-22 14:09:24 -07:00
Derek McGowan
a0b818e093
Merge pull request #2200 from jessvalarezo/multiarch-pulls
allow content to be pulled for specific platform(s), all platforms
2018-03-14 14:46:30 -07:00
Jess Valarezo
c3cf3d7822 allow content to be pulled for specific platform(s), all platforms
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2018-03-12 17:31:42 -07:00