Commit Graph

4032 Commits

Author SHA1 Message Date
Stephen Day
2a1bd7414b
oci: introduce WithSpecFromFile combinator
We introduce a WithSpecFromFile option combinator to allow creation
simpler creation of OCI specs from a file name. Often used as the first
option in a `SpecOpts` slice, it simplifies choosing between a local
file and the built-in default.

The code in `ctr run` has been updated to use the new option, with out
changing the order of operations or functionality present there.

Signed-off-by: Stephen Day <stephen.day@getcruise.com>
2018-07-27 14:25:42 -07:00
Phil Estes
985920c513
Merge pull request #2505 from crosbymichael/cmdargs
Add WithImageConfigArgs to replace CMD on image
2018-07-27 15:55:13 -04:00
Michael Crosby
dd0c04970d nvidia GPU support for caps and multiple uuids
This improves nvidia support for multiple uuids per container and fixes
the API to add individual capabilities.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-27 15:28:59 -04:00
Derek McGowan
362405f7b5
Merge pull request #2495 from jterry75/runtime_v2_windows
Adds runtime v2 support for Windows shim's
2018-07-27 11:24:34 -07:00
Justin Terry (VM)
af1b6a026e Review feedback.
1. Moves the log message for each socket to the appropriate _unix and
_windows.go
2. Replaces all reference to Abstract Socket for Windows.
3. Adds support for ctrl+c on Windows to exit a shim.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-07-27 09:49:33 -07:00
Justin
4b5403f9c9
Merge pull request #2 from crosbymichael/runtime-v2-windows
Abstract to SocketAddress
2018-07-27 09:43:56 -07:00
Michael Crosby
13549f7a07 Abstract to SocketAddress
This updates some methods for cross platform use as well as unifying
_unix files.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-27 12:39:53 -04:00
Samuel Karp
2c87d120df ctr: add new metrics subcommand
Signed-off-by: Samuel Karp <skarp@amazon.com>
2018-07-27 09:37:57 -07:00
Michael Crosby
e956441fe0 Add WithImageConfigArgs to replace CMD on image
This allows users to provide args for the process arguments while
creating the base spec with an image.  It provides the same symantics as
Docker where additional args replace the CMD while leaving the
ENTRYPOINT the same.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-27 12:09:11 -04:00
Derek McGowan
c8017d0275
Merge pull request #2500 from crosbymichael/12deps
Update containerd dependencies for 1.2
2018-07-26 12:59:34 -07:00
Michael Crosby
5a0b040ab4 Update containerd dependencies for 1.2
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-26 15:00:59 -04:00
Michael Crosby
c09932fcb0
Merge pull request #2347 from crosbymichael/streamingapis
Add containers streaming API
2018-07-26 14:42:02 -04:00
Michael Crosby
400f16fc46 Add containers streaming API
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-26 13:55:20 -04:00
Justin
965cca6f75
Merge pull request #1 from crosbymichael/runtime-v2-windows
Add Windows Publisher and Signal Handler
2018-07-26 10:07:14 -07:00
Michael Crosby
9d72b4543b Handle windows signals
Since windows does not require a signal handler, we just block on the
channel forever so that it does not exit.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-26 11:24:20 -04:00
Michael Crosby
f15a1170d3 Add windows publisher
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-26 11:21:50 -04:00
Derek McGowan
1580ec59a5
Remove outdated plugin design doc
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-07-25 23:28:09 -07:00
Derek McGowan
3e657de3af
Document plugins
Add plugins documentation to root.
Mention configuring proxy plugins and runtime plugins.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-07-25 23:28:09 -07:00
Derek McGowan
dfc9991135
Add content ingests to lease and gc
Allow content ingests to be cleaned up during gc.
Use a default expiration on content ingests or make
use of the lease expiration when provided.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-07-25 16:54:14 -07:00
Derek McGowan
d02728ff4a
Merge pull request #2499 from crosbymichael/fast
Fast path bundle cleanup on load
2018-07-25 16:31:39 -07:00
Derek McGowan
b760cee65a
Update lease service errors
Ensure delete returns a typed error on not found

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-07-25 14:56:35 -07:00
Justin Terry (VM)
d3e0c163f8 Adds runtime v2 support for Windows shim's
Implements the various requirements for the runtime v2 code to abstract
away the unix/linux code into the appropriate platform level
abstractions to use the runtime v2 on Windows as well.

Adds support in the Makefile.windows to actually build the runtime v2
code for Windows by setting a shell environment BUILD_WINDOWS_V2=1
before calling make. (Note this disables the compilation of the Windows
runtime v1)

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-07-25 14:09:26 -07:00
Michael Crosby
710df57854 Fast path bundle cleanup on load
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-25 14:37:56 -04:00
Michael Crosby
26e2dd6754
Merge pull request #2425 from avagin/docker-fixes
task: allow to specify namespaces which are restored externally
2018-07-25 10:26:08 -04:00
Michael Crosby
3289dc63e9
Merge pull request #2465 from fraenkel/lock_conn
Use connection lock when creating services
2018-07-25 10:24:08 -04:00
Kenfe-Mickaël Laventure
d47bda91e9
Merge pull request #2490 from thaJeztah/logging_nanosecond_precision
Set default log formatting to use RFC3339Nano with fixed width
2018-07-24 08:23:59 -07: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
Sebastiaan van Stijn
da73b98b63
Set default log formatting to use RFC3339Nano with fixed width
This patch changes the logs format to use a fixed-width timestamp,
matching the format that's used in dockerd.

Before:

    $ containerd
    INFO[0000] starting containerd                           revision=a88b6319614de846458750ff882723479ca7b1a1 version=v1.1.0-202-ga88b6319
    INFO[0000] loading plugin "io.containerd.content.v1.content"...  type=io.containerd.content.v1
    INFO[0000] loading plugin "io.containerd.snapshotter.v1.btrfs"...  type=io.containerd.snapshotter.v1
    WARN[0000] failed to load plugin io.containerd.snapshotter.v1.btrfs  error="path /var/lib/containerd/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter"

After:

    $ containerd
    INFO[2018-07-24T08:11:07.397856489Z] starting containerd                           revision=c3195155cacb361cd3549c4d78901b20aa19579a version=v1.1.0-203-gc3195155
    INFO[2018-07-24T08:11:07.399264587Z] loading plugin "io.containerd.content.v1.content"...  type=io.containerd.content.v1
    INFO[2018-07-24T08:11:07.399343959Z] loading plugin "io.containerd.snapshotter.v1.btrfs"...  type=io.containerd.snapshotter.v1
    WARN[2018-07-24T08:11:07.399474423Z] failed to load plugin io.containerd.snapshotter.v1.btrfs  error="path /var/lib/containerd/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter"

Or, when running as child-process of dockerd:

Before:

    root@9637fcd85ea4:/go/src/github.com/docker/docker# dockerd --debug
    DEBU[2018-07-24T08:15:16.946312436Z] Listener created for HTTP on unix (/var/run/docker.sock)
    INFO[2018-07-24T08:15:16.947086499Z] libcontainerd: started new docker-containerd process  pid=231
    INFO[2018-07-24T08:15:16.947137166Z] parsed scheme: "unix"                         module=grpc
    INFO[2018-07-24T08:15:16.947235001Z] scheme "unix" not registered, fallback to default scheme  module=grpc
    INFO[2018-07-24T08:15:16.947463403Z] ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/docker-containerd.sock 0  <nil>}]  module=grpc
    INFO[2018-07-24T08:15:16.947505954Z] ClientConn switching balancer to "pick_first"  module=grpc
    INFO[2018-07-24T08:15:16.947717368Z] pickfirstBalancer: HandleSubConnStateChange: 0xc420507ab0, CONNECTING  module=grpc
    INFO[0000] starting containerd                           revision=d64c661f1d51c48782c9cec8fda7604785f93587 version=v1.1.1
    DEBU[0000] changing OOM score to -500
    INFO[0000] loading plugin "io.containerd.content.v1.content"...  type=io.containerd.content.v1
    INFO[0000] loading plugin "io.containerd.snapshotter.v1.btrfs"...  type=io.containerd.snapshotter.v1
    WARN[0000] failed to load plugin io.containerd.snapshotter.v1.btrfs  error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter"

After:

    DEBU[2018-07-24T08:21:33.441741970Z] Listener created for HTTP on unix (/var/run/docker.sock)
    INFO[2018-07-24T08:21:33.442428017Z] libcontainerd: started new docker-containerd process  pid=232
    INFO[2018-07-24T08:21:33.442510827Z] parsed scheme: "unix"                         module=grpc
    INFO[2018-07-24T08:21:33.442598812Z] scheme "unix" not registered, fallback to default scheme  module=grpc
    INFO[2018-07-24T08:21:33.442681006Z] ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/docker-containerd.sock 0  <nil>}]  module=grpc
    INFO[2018-07-24T08:21:33.442770353Z] ClientConn switching balancer to "pick_first"  module=grpc
    INFO[2018-07-24T08:21:33.442871502Z] pickfirstBalancer: HandleSubConnStateChange: 0xc42018bc30, CONNECTING  module=grpc
    INFO[2018-07-24T08:21:33.457963804Z] starting containerd                           revision=597dd082e37f8bc6b6265ca05839d7a300861911 version=597dd082
    DEBU[2018-07-24T08:21:33.458113301Z] changing OOM score to -500
    INFO[2018-07-24T08:21:33.458474842Z] loading plugin "io.containerd.content.v1.content"...  type=io.containerd.content.v1
    INFO[2018-07-24T08:21:33.458911054Z] loading plugin "io.containerd.snapshotter.v1.btrfs"...  type=io.containerd.snapshotter.v1
    WARN[2018-07-24T08:21:33.459366268Z] failed to load plugin io.containerd.snapshotter.v1.btrfs  error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-24 10:23:38 +02:00
Stephen Day
a88b631961
Merge pull request #2471 from crosbymichael/fatal
Don't fatal on epoll wait
2018-07-23 14:17:57 -07:00
Phil Estes
88ec4559b6
Merge pull request #2487 from thaJeztah/fix_compilation_issues_on_go1.11
Fix compilation failures on Go 1.11
2018-07-23 14:52:27 -04:00
Sebastiaan van Stijn
65ef8310d9 Fix compilation failures on Go 1.11
Compilation failed;

    windows\process.go:124: Wrapf format %s has arg s of wrong type github.com/containerd/containerd/runtime.Status
    windows\task.go:287: Wrapf format %d has arg id of wrong type string
    windows\task.go:300: Wrapf format %d has arg t.id of wrong type string

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-23 20:01:56 +02:00
Phil Estes
92d147ebde
Merge pull request #2485 from AkihiroSuda/fix-native-root-permission
native: set '/' permission to 0755
2018-07-23 09:52:53 -04:00
Akihiro Suda
7461739b58 native: set '/' permission to 0755
Unlike other snapshotters, the permission was previously set to 0700
unexpectedly.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-07-23 16:14:55 +09:00
Michael Crosby
0d52c71c80
Merge pull request #2474 from dmcgowan/lease-expiration
Improved lease management
2018-07-20 16:54:17 -04:00
Andrei Vagin
fc2fcf6b2a task: WithExit() doesn't have to overwrite existing options
Signed-off-by: Andrei Vagin <avagin@openvz.org>
2018-07-20 13:19:05 -07:00
Phil Estes
394784b3aa
Merge pull request #2482 from crosbymichael/v2cr
Fixes for runtimev2 and checkpoint restore
2018-07-20 13:56:18 -04:00
Michael Crosby
17ab11a236 Fixes for runtimev2 and checkpoint restore
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-20 12:09:29 -04:00
Derek McGowan
94e132fd07
Add sync option on lease removal
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-07-19 14:37:55 -07:00
Michael Crosby
49fb363811
Merge pull request #2458 from fuweid/bugfix_apply_hardlink_to_softlink
bugfix: allow hardlink to softlink file
2018-07-19 14:38:20 -04:00
Derek McGowan
77ffa366af
Merge pull request #2476 from kolyshkin/osusergo
BUILDING.md: add osusergo for static build
2018-07-19 11:31:09 -07:00
Derek McGowan
2a8e28ae29
Merge pull request #2477 from crosbymichael/stress-runtime
Set runtime for stress tests
2018-07-19 11:26:04 -07:00
Michael Crosby
17ae673b5c Set runtime for stress tests
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-19 12:06:39 -04:00
Kir Kolyshkin
48570b39c5 BUILDING.md: add osusergo for static build
Go 1.11 includes a fix to os/user to be working in a static binary
(fixing https://github.com/golang/go/issues/23265). The fix requires
`osusergo` build tag to be set for static binaries, which is what
this commit documents.

[v2: sort tags alphabetically]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-07-19 12:32:15 +03:00
Wei Fu
3b1534c47a bugfix: allow hardlink to softlink file
With `fs.RootPath`, the target file will be the file which the softlink
points to, like:

  touch /tmp/zzz
  ln -s /tmp/zzz /tmp/xxx
  ln /tmp/xxx /tmp/yyy

The `/tmp/yyy` should be same with the `/tmp/xxx`, not `/tmp/zzz`. We
should allow hardlink to softlink file.

Signed-off-by: Wei Fu <fhfuwei@163.com>
2018-07-19 15:13:50 +08:00
Michael Crosby
9743ff21c9 Don't fatal on epoll wait
This removes a log fatal on epoll wait for OOM events.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-18 16:40:31 -04:00
Derek McGowan
94cfce62ba
Merge pull request #2434 from crosbymichael/shimv2
Runtime v2 (shim API)
2018-07-18 13:14:10 -07:00
Michael Crosby
d53a96fbe4 Add comments for oci protos
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-18 15:12:18 -04:00
Derek McGowan
29b72d4ff0
Support lease filters
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-07-18 10:43:37 -07:00
Derek McGowan
00a99c0472
Add leases subcommand in ctr
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-07-18 10:43:37 -07:00
Derek McGowan
4c2ad9cefb
Update CRI vendor
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-07-18 10:43:37 -07:00