Commit Graph

28 Commits

Author SHA1 Message Date
Michael Crosby
d7864eb77b Use namespace in default cgroup path
By default, the generated spec will place containers in cgroups by their
ids, we need to use the namespace as the cgroup root to avoid
containers with the same name being placed in the same cgroup.

```
11:perf_event:/to/redis
10:freezer:/to/redis
9:memory:/to/redis
8:devices:/to/redis
7:net_cls,net_prio:/to/redis
6:pids:/to/redis
5:hugetlb:/to/redis
4:cpuset:/to/redis
3:blkio:/to/redis
2:cpu,cpuacct:/to/redis
1:name=systemd:/to/redis

11:perf_event:/te/redis
10:freezer:/te/redis
9:memory:/te/redis
8:devices:/te/redis
7:net_cls,net_prio:/te/redis
6:pids:/te/redis
5:hugetlb:/te/redis
4:cpuset:/te/redis
3:blkio:/te/redis
2:cpu,cpuacct:/te/redis
1:name=systemd:/te/redis
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-09 17:07:57 -04:00
Akihiro Suda
d7b0e522c7 spec: set MaskedPaths and ReadOnlyPaths by default
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-10-05 06:01:35 +00:00
Ian Campbell
128aaf6eec Correct spelling of default.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-09-07 23:16:05 +01:00
Ian Campbell
ebafab47ca correct container "/" ownership with userns
Previously "`/`" in a container was always owned by `root:root` (0/0), even if
`withRemappedSnapshot` had been used. Meaning that if `withUserNamespace` is
used then `/` can be remapped to `nobody:nogroup` (65534/65534).

The fix is is twofold:

- incrementFS should operate on the root of the tree.
- when creating a new snapshot we must propagate the ownership of the topmost
  "lower" directory into the new "upper".

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-08-16 19:55:55 +01:00
Michael Crosby
1f6b10b699 Use lchown when remapping rootfs
Use lchown when remapping the container's rootfs as to ensure that the
symlink has the correct permissions but the underlying file that it
points to is not modified.

Remapping on the host can cause host files to change outside of the
rootfs if symlinks are dereferenced.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-08-09 11:27:46 -04:00
Kenfe-Mickael Laventure
56b18c1d1f
Move client's options to separate files
This should help in discovering the available options for a given object.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-08-04 13:56:16 -07:00
Michael Crosby
0a85f6e47d Update godoc for client package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-08-04 11:53:31 -04:00
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
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
Stephen J Day
b385798695
containerd: remove GRPC service export
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-07-12 16:57:47 -07:00
Michael Crosby
3b8018d8cf Remove protos from Go client API
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-07-12 14:32:37 -07:00
Michael Crosby
4e8943f7bb Update runtime-spec rc6
This should be the same commit tagged as the 1.0 release

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-07-12 09:32:41 -07:00
Michael Crosby
a60511d5aa Use typeurl package for spec types
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-07-05 15:37:26 -07:00
Derek McGowan
a5fa3bb923 Merge pull request #1100 from crosbymichael/update-task
Implement task update
2017-06-27 14:39:45 -07:00
Michael Crosby
49f9dc494f Update runc and runtime-spec dependencies
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-27 11:44:38 -07:00
Michael Crosby
f36e0193a4 Implement task update
This allows tasks to have their resources updated as they are running.

Fixes #1067

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-26 16:38:49 -07:00
Stephen J Day
12a6beaeeb
*: update import paths to use versioned services
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-06-21 18:29:06 -07:00
Samuel Karp
15c6e832aa containerd: Add WithNamespace to replace namespace
Signed-off-by: Samuel Karp <skarp@amazon.com>
2017-06-19 11:22:26 -07:00
Michael Crosby
a40f307e88 Namespace cgroups monitor ids
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-09 10:35:17 -07:00
Michael Crosby
4c1af8fdd8 Port ctr to use client
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-06-06 14:53:50 -07:00
Derek McGowan
b1a45c2aee
Fix windows build for client
Move io copy logic from ctr utils to io_windows.go.
Fix compilation errors on Windows.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-05-30 16:57:34 -07:00
Michael Crosby
cebe099358 Add test flag for setting containerd address
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-05-25 15:41:10 -07:00
Michael Crosby
89037568d3 Add windows spec generation
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-05-25 11:30:16 -07:00
Michael Crosby
a2b0824720 Export GRPC services from client
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-05-25 11:10:34 -07:00
Michael Crosby
608e6daaa4 Make Task, Container, Image interface types
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-05-25 11:05:58 -07:00
Michael Crosby
8cd882c570 Add test -short for non-integration tests
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-05-24 16:13:54 -07:00
Michael Crosby
bf9ad0c57f Fix spec generation for task execution
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-05-24 15:40:40 -07:00
Michael Crosby
d0e5732f0b Add initial containerd *Client
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-05-24 14:08:58 -07:00