Commit Graph

5305 Commits

Author SHA1 Message Date
Michael Crosby
388c8a1760 Fastpath opt and ExecProcess loading
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-03-22 12:08:43 -04:00
Michael Crosby
fc44aa810c
Merge pull request #3119 from jterry75/windows_lcow_vmgroup_access
Update Windows lcow differ to set NT VIRTUAL MACHINE\Virtual Machines SID
2019-03-22 12:07:17 -04:00
Michael Crosby
24beaece37
Merge pull request #3120 from jhowardmsft/jjh/create-data-root-with-permissions
Windows: Root/state create with right ACL and in right place
2019-03-22 12:06:39 -04:00
John Howard
a849664519 Windows:ProgramFiles to ProgramData
Signed-off-by: John Howard <jhoward@microsoft.com>
2019-03-21 18:50:01 -07:00
John Howard
6034c1950a Windows:Create root/state with ACL
Signed-off-by: John Howard <jhoward@microsoft.com>
2019-03-21 18:47:34 -07:00
Justin Terry (VM)
7361b19875 Update Windows lcow differ to set NT VIRTUAL MACHINE\Virtual Machines SID
For LCOW using the Virtual Machines SID for the shared read-only layers
improves overall performance avoiding the need to set per VM access at runtime.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-03-21 14:53:43 -07:00
Justin Terry (VM)
4c9b5ef8ea Update vendor github.com/Microsoft/go-winio
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-03-21 14:12:41 -07:00
Jack Baines
d15832a4c2 Address review comments
-Fix whitespace on imports
-Fix test case naming

Signed-off-by: Jack Baines <jack.baines@uk.ibm.com>
2019-03-21 15:59:49 +00:00
Phil Estes
ceba56893a
Merge pull request #3104 from AkihiroSuda/split-contentserver
decouple api.ContentServer implementation package from bbolt dependency
2019-03-21 10:10:26 -04:00
Michael Crosby
9bd6b0932e
Merge pull request #3111 from thaJeztah/whitelist_statx
seccomp: whitelist statx syscall
2019-03-20 10:48:18 -05:00
Sebastiaan van Stijn
8f8fd3c3a8
seccomp: whitelist statx syscall
This whitelists the statx syscall; libseccomp-2.3.3 or up
is needed for this, older seccomp versions will ignore this.

Equivalent of https://github.com/moby/moby/pull/36417

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-20 11:59:02 +01:00
Jack Baines
908b771086 Add code to return message field of returned registry errors
Docker registries return errors in a know format so this change now checks for these
errors and returns the message field. If the error is not in the expected format fall
back to the original behaviour.

https://github.com/containerd/containerd/issues/3076

Signed-off-by: Jack Baines <jack.baines@uk.ibm.com>
2019-03-19 21:05:36 +00:00
Phil Estes
9ab4c8cbcc
Merge pull request #3108 from alculquicondor/fix/import
Allow to import an image for the default platform only.
2019-03-19 13:29:57 -04:00
Michael Crosby
0cbbd0f68b
Merge pull request #3107 from avikivity/3105
seccomp: whitelist io_pgetevents
2019-03-19 10:55:00 -05:00
Aldo Culquicondor
9a8727cf09 Allow to import an image for the default platform only.
Add `all-platforms` option to `ctr images import`.

Signed-off-by: Aldo Culquicondor <acondor@google.com>
2019-03-19 11:25:57 -04:00
Avi Kivity
4506eb45bf seccomp: whitelist io_pgetevents
io_pgetevents() is a new Linux system call, similar to the already-whitelisted
io_getevents(). It has no security implications. Whitelist it so applications can
use the new system call.

Fixes #3105.

Signed-off-by: Avi Kivity <avi@scylladb.com>
2019-03-19 11:56:32 +02:00
Akihiro Suda
f3ff95ab72 decouple api.ContentServer implementation package from bbolt dependency
For moby/buildkit#886

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2019-03-19 16:09:45 +09:00
Phil Estes
b90eeadafa
Merge pull request #3102 from Ace-Tang/arg_usage
ctr: fix image cmd ArgsUsage
2019-03-18 08:37:18 -07:00
Ace-Tang
14a050688d ctr: fix image cmd ArgsUsage
ctr image list/check 's ArgsUsage should be filter, not ref

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-03-18 21:11:34 +08:00
Michael Crosby
c60a5fd190
Merge pull request #3099 from crosbymichael/export-caps
Add additional capability handling opts
2019-03-15 13:09:45 -05:00
Michael Crosby
bdd84abf05 Add additional capability handling opts
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-03-15 12:31:41 -04:00
Michael Crosby
ef45e4f021
Merge pull request #3046 from linxiulei/fix_shim_socket
Shorten the unix socket path for shim
2019-03-15 09:10:47 -05:00
Eric Lin
a631796fda horten the unix socket path for shim
Use sha256 hash to shorten the unix socket path to satisfy the
length limitation of abstract socket path

This commit also backports the feature storing address path to
a file from v2 to keep compatibility

Fixes #3032

Signed-off-by: Eric Lin <linxiulei@gmail.com>
2019-03-15 11:58:30 +08:00
Derek McGowan
63d7a9ca8d
Merge pull request #3096 from thaJeztah/override_package_name
Makefile: allow overriding package name
2019-03-14 15:58:21 -07:00
Michael Crosby
3bba2d478d
Merge pull request #3093 from tiborvass/nvidia-export
contrib/nvidia: export helper binary path and list of Nvidia capabilities
2019-03-14 17:24:13 -05:00
Sebastiaan van Stijn
b858cfb41b
Makefile: allow overriding package name
With this patch applied, the package-name in the `--version` output can be overridden;

    make PACKAGE=containerd.io binaries

    ./bin/containerd --version
    containerd containerd.io v1.2.0-329-ga15b6e20.m a15b6e2097c48b632dbdc63254bad4c62b69e709.m

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-14 11:38:13 +01:00
Phil Estes
9ed2c0aa02
Merge pull request #3085 from crosbymichael/shim-logs
Shim pluggable logging
2019-03-13 12:23:06 -07:00
Phil Estes
8f63d2acdb
Merge pull request #3067 from fuweid/me-fetch-platforms
remotes: add distribution labels to blob data
2019-03-13 12:19:44 -07:00
Tibor Vass
7ca2c3d68d contrib/nvidia: export helper binary path and list of Nvidia capabilities
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-03-12 15:28:14 -07:00
Derek McGowan
09da2d867a
Merge pull request #3090 from dmcgowan/update-mailmap
Update mailmap for cgroup authors
2019-03-12 11:38:21 -07:00
Derek McGowan
a7aeffc22e
Update mailmap for cgroup authors
Fix to show real names in contributor list

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-03-12 11:17:39 -07:00
Michael Crosby
e6ae9cc64f Shim pluggable logging
Closes #603

This adds logging facilities at the shim level to provide minimal I/O
overhead and pluggable logging options.  Log handling is done within the
shim so that all I/O, cpu, and memory can be charged to the container.

A sample logging driver setting up logging for a container the systemd
journal looks like this:

```go
package main

import (
	"bufio"
	"context"
	"fmt"
	"io"
	"sync"

	"github.com/containerd/containerd/runtime/v2/logging"
	"github.com/coreos/go-systemd/journal"
)

func main() {
	logging.Run(log)
}

func log(ctx context.Context, config *logging.Config, ready func() error) error {
	// construct any log metadata for the container
	vars := map[string]string{
		"SYSLOG_IDENTIFIER": fmt.Sprintf("%s:%s", config.Namespace, config.ID),
	}
	var wg sync.WaitGroup
	wg.Add(2)
	// forward both stdout and stderr to the journal
	go copy(&wg, config.Stdout, journal.PriInfo, vars)
	go copy(&wg, config.Stderr, journal.PriErr, vars)

	// signal that we are ready and setup for the container to be started
	if err := ready(); err != nil {
		return err
	}
	wg.Wait()
	return nil
}

func copy(wg *sync.WaitGroup, r io.Reader, pri journal.Priority, vars map[string]string) {
	defer wg.Done()
	s := bufio.NewScanner(r)
	for s.Scan() {
		if s.Err() != nil {
			return
		}
		journal.Send(s.Text(), pri, vars)
	}
}
```

A `logging` package has been created to assist log developers create
logging plugins for containerd.

This uses a URI based approach for logging drivers that can be expanded
in the future.

Supported URI scheme's are:

* binary
* fifo
* file

You can pass the log url via ctr on the command line:

```bash
> ctr run --rm --runtime io.containerd.runc.v2 --log-uri binary://shim-journald docker.io/library/redis:alpine redis
```

```bash
> journalctl -f -t default:redis

-- Logs begin at Tue 2018-12-11 16:29:51 EST. --
Mar 08 16:08:22 deathstar default:redis[120760]: 1:C 08 Mar 2019 21:08:22.703 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.704 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.704 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.704 # Current maximum open files is 1024. maxclients has been reduced to 992 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.705 * Running mode=standalone, port=6379.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.705 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.705 # Server initialized
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.705 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.705 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
Mar 08 16:08:22 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:22.705 * Ready to accept connections
Mar 08 16:08:50 deathstar default:redis[120760]: 1:signal-handler (1552079330) Received SIGINT scheduling shutdown...
Mar 08 16:08:50 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:50.405 # User requested shutdown...
Mar 08 16:08:50 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:50.406 * Saving the final RDB snapshot before exiting.
Mar 08 16:08:50 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:50.452 * DB saved on disk
Mar 08 16:08:50 deathstar default:redis[120760]: 1:M 08 Mar 2019 21:08:50.453 # Redis is now ready to exit, bye bye...
```

The following client side Opts are added:

```go
// LogURI provides the raw logging URI
func LogURI(uri *url.URL) Creator { }
// BinaryIO forwards contianer STDOUT|STDERR directly to a logging binary
func BinaryIO(binary string, args map[string]string) Creator {}
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-03-12 12:18:28 -04: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
a15b6e2097
Merge pull request #3081 from thaJeztah/bump_runc
update runc to 2b18fe1d885ee5083ef9f0838fee39b62d653e30
2019-03-07 15:10:41 -06:00
Sebastiaan van Stijn
b8d40b3535
update runc to 2b18fe1d885ee5083ef9f0838fee39b62d653e30
This includes an improved fix for CVE-2019-5736 to reduce the
increased memory-consumption introduced by the original patch,
RHEL 7.6 getting into a loop due to a kernel bug in those kernels,
and improve compatibility with older kernels.

changes included:

- opencontainers/runc#1973 Vendor opencontainers/runtime-spec 29686dbc
- opencontainers/runc#1978 Remove detection for scope properties, which have always been broken
- opencontainers/runc#1963 Vendor in go-criu and use it for CRIU's RPC definition
- opencontainers/runc#1995 exec: expose --preserve-fds
- opencontainers/runc#2000 fix preserve-fds flag may cause runc hang
- opencontainers/runc#1968 Create bind mount mountpoints during restore
- opencontainers/runc#1984 nsenter: cloned_binary: "memfd" cleanups

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-07 21:30:26 +01:00
Stefan Berger
09cf2a629b Extend metadata images test with fieldpaths for Annotations
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-03-07 14:20:56 -05:00
Stefan Berger
5124f9ee54 Write the Annotations map into the bolt db
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-03-07 13:55:58 -05:00
Stefan Berger
02cc1485df Prepare boltutil for reading and writing another map
Refactor the code so that another function can also read and write maps
into the bolt db.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-03-07 13:55:22 -05:00
Maksym Pavlenko
1e893b19ce
devmapper: add no_devmapper build tag
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-03-07 10:53:19 -08:00
Derek McGowan
aa328dfc55
Merge pull request #3041 from thaJeztah/bump_da_bolt
Update go.etcd.io/bbolt to v1.3.2
2019-03-07 09:28:26 -08:00
Phil Estes
5fdcef55a2
Merge pull request #3075 from ehotinger/with-new-snapshot
Allow WithNewSnapshot and WithNewSnapshotView to take in snapshotter opts
2019-03-07 11:15:18 -05:00
Michael Crosby
cfba7ef8e2
Merge pull request #3064 from dmcgowan/update-gc-content-references
Add content gc ref labels from containers, images, and snapshots
2019-03-07 09:52:53 -06:00
Stefan Berger
79248fea2b Add test for ocispec.Descriptor Annotations
Make sure that Annotations we write into ocispec.Descriptors are
written into the store and can be read back.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-03-06 16:59:39 -05:00
Eric Hotinger
34f3772956 Allow WithNewSnapshot and WithNewSnapshotView to take in snapshotter options.
Signed-off-by: Eric Hotinger <ehotinger@gmail.com>
2019-03-06 13:22:37 -08:00
Phil Estes
04b2e5bbf7
Merge pull request #3072 from crosbymichael/v2opts
Fix runtime v2 option handling
2019-03-06 14:27:02 -05:00
Michael Crosby
aaae81189a Update checkpoint opts with runtime handling
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-03-06 12:42:45 -05:00
Michael Crosby
160737d2c8 Fix no pivot and keyring opts
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-03-06 12:37:36 -05:00
Stefan Berger
0b711d616a Copy annotations around where necessary
Make sure that the newly added annotations are copied around appropriately.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-03-06 12:26:23 -05:00
Phil Estes
bfbd1d09c9
Merge pull request #3070 from darfux/update-build-doc
BUILDING.md: update testing section
2019-03-06 08:53:38 -05:00
Li Yuxuan
4d2a26d751 BUILDING.md: update testing section
The integration-parallel has been removed by
4df7075a74.
Update Makefile targets in BUILDING.md.

Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2019-03-06 18:56:14 +08:00