Commit Graph

2903 Commits

Author SHA1 Message Date
Akihiro Suda
752d253f40 client, ctr: allow specifying unmanaged rootfs dir
e.g. ctr run -t --rm --rootfs /tmp/busybox-rootfs foo /bin/sh
(--rm removes the container but does not remove rootfs dir, of course)

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-07-28 04:45:04 +00:00
Stephen Day
1a054c67b1 Merge pull request #1134 from crosbymichael/shim-cgroup
Allow shim to be placed inside cgroup
2017-07-27 16:09:07 -07:00
Derek McGowan
4e299a9a20 Merge pull request #1254 from stevvooe/close-channel
events: close channel explicitly
2017-07-27 15:59:50 -07:00
Stephen Day
1679727648 Merge pull request #1230 from dmcgowan/snapshot-client-testsuite
snapshot: run test suite for metadata and client implementations
2017-07-27 15:49:17 -07:00
Stephen Day
fdea1ceacd Merge pull request #1256 from dmcgowan/fix-ingest-file-not-exists
Convert file not exists to status not found
2017-07-27 15:48:41 -07:00
Stephen Day
afe0ce3543 Merge pull request #1255 from stevvooe/multi-delete
cmd/ctr: allow deleting multiple containers at once
2017-07-27 15:46:57 -07:00
Derek McGowan
585f7d6494
Skip test on windows
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-27 15:42:34 -07:00
Derek McGowan
ccbb035231
Convert file not exists to status not found
Fixes message on pull about a statuses not being found.
These statuses can just be ignored since they are no
longer valid and holding the database lock while reading
statuses is not necessary.

Closes #1231

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-27 15:37:16 -07:00
Stephen J Day
83ac874886
cmd/ctr: allow deleting multiple containers at once
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-07-27 15:30:35 -07:00
Stephen J Day
a1f7509648
events: close channel explicitly
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-07-27 14:22:11 -07:00
Michael Crosby
98a86c4d38 Add ShimCgroup path for placing shim in cgroup
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-07-27 15:25:27 -04:00
Derek McGowan
d4349eff39 Merge pull request #1251 from crosbymichael/apparmor
Add User Namespace and Apparmor support to client
2017-07-27 11:13:03 -07:00
Michael Crosby
a0a5cc7787 Add user namespace support to client
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-07-27 11:06:20 -04:00
Derek McGowan
856b038437 Merge pull request #1253 from stevvooe/alpha2
release: prepare for v1.0.0-alpha2
2017-07-26 15:45:24 -07:00
Stephen J Day
997a1b5a13
release: prepare for v1.0.0-alpha2
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-07-26 15:23:24 -07:00
Michael Crosby
c3872b848f Move RootPath to fs package
This moves the RootPath function out of the archive package and into the
fs package for external use.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-07-26 14:26:27 -04:00
Michael Crosby
b84817a29c Merge pull request #1246 from stevvooe/events-refactor
events: refactor event distribution
2017-07-26 08:31:12 -04:00
Stephen Day
036232856f Merge pull request #1248 from dmcgowan/snapshot-storage-kind-test
Update storage kind test
2017-07-25 15:31:24 -07:00
Stephen Day
366ebfd660 Merge pull request #1249 from dmcgowan/client-rename-with-rootfs
client: clarify and rename `WithRootFS`
2017-07-25 15:30:58 -07:00
Derek McGowan
c7cc6ad2b4
Add root mounts to task info
Add WithRootFS for task creation

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-25 15:24:06 -07:00
Derek McGowan
73bec3edea
client: rename rootfs to snapshot in "With" functions
Clarify terminology around functions which use and create
snapshots for containers.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-25 15:24:06 -07:00
Stephen J Day
a615a6fe5d
events: refactor event distribution
In the course of setting out to add filters and address some cleanup, it
was found that we had a few problems in the events subsystem that needed
addressing before moving forward.

The biggest change was to move to the more standard terminology of
publish and subscribe. We make this terminology change across the Go
interface and the GRPC API, making the behavior more familier. The
previous system was very context-oriented, which is no longer required.

With this, we've removed a large amount of dead and unneeded code. Event
transactions, context storage and the concept of `Poster` is gone. This
has been replaced in most places with a `Publisher`, which matches the
actual usage throughout the codebase, removing the need for helpers.

There are still some questions around the way events are handled in the
shim. Right now, we've preserved some of the existing bugs which may
require more extensive changes to resolve correctly.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-07-25 15:08:09 -07:00
Derek McGowan
6012f5047d Update storage kind test
Testing proto and snapshot kinds are equivalent when cast to each other.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-25 13:59:16 -07:00
Derek McGowan
9434bf9e8a Merge pull request #1236 from stevvooe/snapshot-column-kind
snapshot: replace "readonly" with View snapshot type
2017-07-25 13:48:50 -07:00
Michael Crosby
050c7d24b9 Merge pull request #1247 from darrenstahlmsft/revendorMicrosoft
Revendor hcsshim and go-winio
2017-07-25 15:17:51 -04:00
Darren Stahl
cec6331e4b Revendor hcsshim and go-winio
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-07-25 12:03:44 -07:00
Derek McGowan
da5c72c335 Run snapshot test suite for metadata and client
The snapshot test suite is designed to run against the snapshotter
interface, run the test suite for metadata and client implementations
of the snapshotter interface.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-25 10:47:45 -07:00
Michael Crosby
1251413a96 Merge pull request #1245 from dmcgowan/archive-more-tar-fixes
Update tar path resolution
2017-07-25 09:49:10 -04:00
Derek McGowan
afec478beb Update tar path resolution
Fixes bug for resolving symlinks which allowed fully resolving
an existing symlink to a path, causing some symlinks to get
overridden as symlinks to self.
Updates logic to split name into parent path, resolve the parent
path, then safely join back with the base name.
Uses the split code to ensure parent directories are created in
all cases.
Replaces `rootJoin` with filepath.Join to the root, which already
correctly cleans relative symlinks to the root.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-24 17:51:47 -07:00
Stephen J Day
863784f991
snapshot: replace "readonly" with View snapshot type
What started out as a simple PR to remove the "Readonly" column became an
adventure to add a proper type for a "View" snapshot. The short story here is
that we now get the following output:

```
$ sudo ctr snapshot ls
ID 									 PARENT 								 KIND
sha256:08c2295a7fa5c220b0f60c994362d290429ad92f6e0235509db91582809442f3 								  	 Committed
testing4								 sha256:08c2295a7fa5c220b0f60c994362d290429ad92f6e0235509db91582809442f3 Active
```

In pursuing this output, it was found that the idea of having "readonly" as an
attribute on all snapshots was redundant. For committed, they are always
readonly, as they are not accessible without an active snapshot. For active
snapshots that were views, we'd have to check the type before interpreting
"readonly". With this PR, this is baked fully into the kind of snapshot. When
`Snapshotter.View` is  called, the kind of snapshot is `KindView`, and the
storage system reflects this end to end.

Unfortunately, this will break existing users. There is no migration, so they
will have to wipe `/var/lib/containerd` and recreate everything. However, this
is deemed worthwhile at this point, as we won't have to judge validity of the
"Readonly" field when new snapshot types are added.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-07-24 16:58:01 -07:00
Stephen Day
a9ab45fb77 Merge pull request #1241 from stevvooe/allow-resumable-upload
metadata: defer ingest lock to backend
2017-07-24 15:30:17 -07:00
Stephen Day
bfe747daed Merge pull request #1242 from mlaventure/appveyor-no-coverage-only-master
Only trigger AppVeyor on master and PR
2017-07-24 15:30:01 -07:00
Stephen Day
f5bd8bbba3 Merge pull request #1243 from crosbymichael/reg-diff-urls
Panic when registering the same type but diff urls
2017-07-24 14:58:36 -07:00
Michael Crosby
a3769f887b Panic when registering the same type but diff urls
Panic on typeurl registration when you register the same type but
different urls for that type.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-07-24 15:51:09 -04:00
Kenfe-Mickael Laventure
219c3e3996
Disable coverage tests on Windows CI
The content unit-tests fail on Windows atm as they are not taking Windows
specific behavior in account.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-07-24 21:39:08 +02:00
Kenfe-Mickael Laventure
2eaac7103b
Only run Windows CI on master branch
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-07-24 21:34:36 +02:00
Stephen J Day
d0e396aa60
metadata: defer ingest lock to backend
Because the lock on an ingest ref being held regardless of whether a
writer was in use, resuming an existing ingest proved impossible. We now
defer writer locking to the content store backend, where the lock will
be released automatically on closing the writer or on restarting
containerd.

There are still cases where a writer can be abandoned but not closed,
leaving an active ingest, but this is extremely rare and can be resolved
with a daemon restart.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-07-24 12:20:34 -07:00
Phil Estes
c52523c4d3 Merge pull request #1238 from crosbymichael/reg-specs
Register spec types in client
2017-07-24 14:49:09 -04:00
Stephen Day
f98b29792a Merge pull request #1239 from crosbymichael/roadmap
Replace roadmap with link to milestones
2017-07-24 11:34:14 -07:00
Stephen Day
ba577f7115 Merge pull request #1227 from tossmilestone/fix-comment-typo
Fix typo error in Protobuild.toml
2017-07-24 10:51:51 -07:00
Michael Crosby
becf001552 Replace roadmap with link to milestones
Closes #1193

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-07-24 13:42:35 -04:00
Michael Crosby
b7e0101b37 Merge pull request #1228 from dmcgowan/content-testsuite
content: test suite
2017-07-24 13:36:50 -04:00
Michael Crosby
228f7d452c Register spec types in client
Allow types to be registred multiple times instead of panic.

Fixes #1235

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-07-24 13:30:37 -04:00
Derek McGowan
8e1591bd8b
Call upload status tests
Fix metadata status not returning correct reference string

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-24 10:11:35 -07:00
Derek McGowan
bb3c9c5927
Rename content/fs to content/local
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-24 10:11:35 -07:00
Derek McGowan
938f3185bd
Add content test suite
Add content test suite with test for writer.
Update fs and metadata implementations to use test suite.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-24 10:11:34 -07:00
Derek McGowan
442365248b
Move content store implementation
Move the filesystem content store implementation to a
subpackage of content.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-24 10:11:34 -07:00
Phil Estes
9b53b8b68d Merge pull request #1237 from WeiZhang555/remove-hardcoded-str
Replace hardcoded debug address with const var
2017-07-24 13:10:21 -04:00
Zhang Wei
adeec483a3 Replace hardcoded debug address with const var
Debug address in defaultConfig() doesn't have to be a hardcoded string,
instead it can be const var from package server, which is also a
platform dependent const. So it would be better to use
server.DefaultDebugAddress here.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2017-07-24 23:41:39 +08:00
He Xiaoxi
856c351fac Improve the comment
Signed-off-by: He Xiaoxi <tossmilestone@gmail.com>
2017-07-22 12:39:34 +08:00