Commit Graph

3064 Commits

Author SHA1 Message Date
Derek McGowan
25b5592eaf
Fix close twice test to retain snapshot
Update to set labels and use a unique key

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-11-30 14:43:33 -08:00
Michael Crosby
2657e49fc1
Merge pull request #1835 from stevvooe/we-use-ttrpc
shim: we use ttrpc in the shim now
2017-11-30 16:35:42 -05:00
Stephen J Day
6c416fa3a7
shim: we use ttrpc in the shim now
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-30 12:58:40 -08:00
Stephen Day
c357934f0f
Merge pull request #1841 from crosbymichael/parse-uid
Use strconv.Atoi for uid/gid parsing
2017-11-30 12:56:20 -08:00
Michael Crosby
a4a4c90ed3 Use strconv.Atoi for uid/gid parsing
This follows the same logic that runc uses for parsing uid/gid values.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-30 15:22:41 -05:00
Stephen Day
8fbdd5c63d
Merge pull request #1840 from kolyshkin/mkdir-all
MkdirAll: fix usage
2017-11-30 11:21:59 -08:00
Kir Kolyshkin
acc6f4ec77 MkdirAll: fix usage
(below is a quote from my runc commit 6f82d4b)

TL;DR: check for IsExist(err) after a failed MkdirAll() is both
redundant and wrong -- so two reasons to remove it.

Quoting MkdirAll documentation:

> MkdirAll creates a directory named path, along with any necessary
> parents, and returns nil, or else returns an error. If path
> is already a directory, MkdirAll does nothing and returns nil.

This means two things:

1. If a directory to be created already exists, no error is
returned.

2. If the error returned is IsExist (EEXIST), it means there exists
a non-directory with the same name as MkdirAll need to use for
directory. Example: we want to MkdirAll("a/b"), but file "a"
(or "a/b") already exists, so MkdirAll fails.

The above is a theory, based on quoted documentation and my UNIX
knowledge.

3. In practice, though, current MkdirAll implementation [1] returns
ENOTDIR in most of cases described in #2, with the exception when
there is a race between MkdirAll and someone else creating the
last component of MkdirAll argument as a file. In this very case
MkdirAll() will indeed return EEXIST.

Because of #1, IsExist check after MkdirAll is not needed.

Because of #2 and #3, ignoring IsExist error is just plain wrong,
as directory we require is not created. It's cleaner to report
the error now.

Note this error is all over the tree, I guess due to copy-paste,
or trying to follow the same usage pattern as for Mkdir(),
or some not quite correct examples on the Internet.

[1] https://github.com/golang/go/blob/f9ed2f75/src/os/path.go

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-11-30 10:18:08 -08:00
Michael Crosby
8114d2f2e2
Merge pull request #1838 from estesp/mention-kernel-vers
Add runtime requirements section to README
2017-11-30 11:38:11 -05:00
Michael Crosby
e974099b8c
Merge pull request #1839 from crosbymichael/test-long-exec
Add test for large exec payload
2017-11-30 11:33:28 -05:00
Phil Estes
a87062efdd
Add runtime requirements section to README
Add details on kernel version, criu, snapshotters, and links to existing
sections for developers/criu details.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2017-11-30 11:12:33 -05:00
Kenfe-Mickaël Laventure
6bff39c643
Merge pull request #1837 from crosbymichael/bump-cgroups
Update cgroups to 29da22c6171a4316169f9205ab6c49f5
2017-11-30 08:03:22 -08:00
Michael Crosby
68bec1e9ce Add test for large exec payload
Test for #1826

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-30 11:03:18 -05:00
Michael Crosby
c4b11148f9
Merge pull request #1831 from stevvooe/update-ttrpc
vendor: update ttrpc with latest changes
2017-11-30 10:33:50 -05:00
Michael Crosby
4349df4554 Update cgroups to 29da22c6171a4316169f9205ab6c49f5
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-30 10:15:37 -05:00
Stephen J Day
393cf8e8fc
vendor: update ttrpc with latest changes
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-29 21:37:50 -08:00
Derek McGowan
96ca9738ca
Merge pull request #1797 from jessvalarezo/rename-packages
rename snapshot->snapshots packages, add aliases
2017-11-29 17:53:11 -08:00
Michael Crosby
04dab2acd6
Merge pull request #1832 from crosbymichael/stress-kill
Fix stress test tool exec kill
2017-11-29 18:54:45 -05:00
Jess Valarezo
1dd6f339a2 rename snapshot->snapshots proto pkg and service
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-11-29 14:55:24 -08:00
Jess Valarezo
9885edfc44 rename snapshot->snapshots pkg
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-11-29 14:55:02 -08:00
Michael Crosby
4363994d87 Fix stress test tool exec kill
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-29 17:54:16 -05:00
Jess Valarezo
61c8fe2307 ctr: snapshot->snapshots cmd, add aliases
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-11-29 14:34:02 -08:00
Phil Estes
59bd196711
Merge pull request #1830 from stevvooe/define-fieldpath-support-envelope
events: define fieldpath implement for envelope
2017-11-29 17:21:26 -05:00
Michael Crosby
16d3aeb515
Merge pull request #1829 from AkihiroSuda/ctr-envvar-snapshotter
ctr: add EnvVar `CONTAINERD_SNAPSHOTTER` for `--snapshotter`
2017-11-29 17:19:31 -05:00
Stephen J Day
d7c950e145
events: define fieldpath implement for envelope
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-29 14:03:32 -08:00
Michael Crosby
a56e7420a7
Merge pull request #1812 from darrenstahlmsft/revendor
Revendor hcsshim and go-tar
2017-11-29 15:52:07 -05:00
Michael Crosby
d298f9a070
Merge pull request #1824 from kolyshkin/static-build
plugins: don't compile for static build
2017-11-29 10:27:06 -05:00
Phil Estes
3da99ed7a5
Merge pull request #1825 from mlaventure/use-defaults-pkg-everywhere
Use defaults pkg for all platforms
2017-11-29 09:26:12 -05:00
Akihiro Suda
7f95b9f987 ctr: add EnvVar CONTAINERD_SNAPSHOTTER for --snapshotter
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-11-29 19:11:10 +09:00
Kir Kolyshkin
0d682e24a1 plugins: don't compile for static build
We can't really use `dlopen()` from a statically built binary, so
let's disable this functionality if `static_build` tag is used
(which is sort of a de-facto standard way of doing it).

This eliminates the following warning:

	🇩 bin/containerd
	# github.com/containerd/containerd/cmd/containerd
	/tmp/go-link-509179974/000004.o: In function `pluginOpen':
	/usr/local/go/src/plugin/plugin_dlopen.go:19: warning: Using 'dlopen' in
	statically linked applications requires at runtime the shared libraries
	from the glibc version used for linking

[v2: add static build instructions to BUILDING.md]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-11-28 21:29:09 -08:00
Kenfe-Mickael Laventure
6bf779c589
Use defaults pkg for all platforms
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-11-28 18:04:21 -08:00
Derek McGowan
bc9cb25012
Update tar to use PAXRecords instead of Xattrs
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-11-28 17:03:14 -08:00
Derek McGowan
16d00870ef
Add test for prefix header issue
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-11-28 16:38:26 -08:00
Darren Stahl
444e4220c2
Revendor hcsshim and go-tar
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-11-28 16:19:56 -08:00
Stephen Day
90a6b79bfc
Merge pull request #1810 from dnephin/add-staticcheck-linter
Fix usage of sync.Pool
2017-11-28 15:46:41 -08:00
Kenfe-Mickaël Laventure
a3955e1d21
Merge pull request #1822 from crosbymichael/subreaper
Change default subreaper setting
2017-11-28 14:51:11 -08:00
Michael Crosby
6e9f24b711 Change default subreaper setting
This subreaper should always be turned on for containerd unless
explicitly needed for it to be off.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-28 17:04:21 -05:00
Michael Crosby
967caeeacc
Merge pull request #1821 from dnephin/remove-use-of-deprecated-grpc-funcs
Replace calls to deprecated grpc functions
2017-11-28 15:34:49 -05:00
Daniel Nephin
dab3ba2aff Replace calls to deprecated grpc functions
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-11-28 15:12:05 -05:00
Kenfe-Mickaël Laventure
118c0a279e
Merge pull request #1820 from crosbymichael/shim-lockup
Resolve issues with signal handling and exec exit events
2017-11-28 11:57:21 -08:00
Michael Crosby
74b3cb3391 Fix exit event handling in shim
Could issues where when exec processes fail the wait block is not
released.

Second, you could not dump stacks if the reaper loop locks up.

Third, the publisher was not waiting on the correct pid.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-28 14:32:06 -05:00
Michael Crosby
723f37d846 Add exec support to stress test tool
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-28 14:18:58 -05:00
Daniel Nephin
a05e5fd77a restore deferred cleanup in rootfs.init
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-11-28 13:14:39 -05:00
Daniel Nephin
ee04cfa3f9 Add staticcheck linter
Fix issues with sync.Pool being passed an array and not a pointer.
See https://github.com/dominikh/go-tools/blob/master/cmd/staticcheck/docs/checks/SA6002

Add missing tests for content.Copy

Fix T.Fatal being called in a goroutine

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-11-28 13:05:30 -05:00
Phil Estes
2556c594ec
Merge pull request #1767 from stevvooe/ttrpc-shim
linux/shim: reduce memory overhead by using ttrpc
2017-11-28 12:43:41 -05:00
Michael Crosby
9e04cff8e9
Merge pull request #1814 from stevvooe/panic-client-fix-oci-spec
oci: allocate process if not already set
2017-11-28 10:29:57 -05:00
Michael Crosby
ca39f76f82
Merge pull request #1798 from stevvooe/shim-gomaxprocs
cmd/containerd-shim: set GOMAXPROCS to 2
2017-11-28 09:55:31 -05:00
Stephen J Day
d54961ccaa
vendor: add ttrpc as vendored dependency
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-27 18:22:37 -08:00
Stephen Day
372cdfac3b
Merge pull request #1638 from dmcgowan/gc-policy
gc: add policy plugin
2017-11-27 18:20:10 -08:00
Derek McGowan
f011bec35e
Merge pull request #1800 from yanxuean/image-store-redandunt
remove redandunt check for imagestore create
2017-11-27 17:46:47 -08:00
Stephen J Day
0d957b1da5
oci: allocate process if not already set
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-27 17:36:43 -08:00