Runtime v2

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2018-07-09 13:27:52 -04:00
parent 6de11ab973
commit da1b5470cd
78 changed files with 9836 additions and 652 deletions

View File

@@ -36,9 +36,9 @@ import (
"github.com/containerd/containerd/events"
"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/runtime/linux/proc"
"github.com/containerd/containerd/runtime/shim"
shimapi "github.com/containerd/containerd/runtime/shim/v1"
"github.com/containerd/containerd/runtime/v1/linux/proc"
"github.com/containerd/containerd/runtime/v1/shim"
shimapi "github.com/containerd/containerd/runtime/v1/shim/v1"
"github.com/containerd/ttrpc"
"github.com/containerd/typeurl"
ptypes "github.com/gogo/protobuf/types"
@@ -134,7 +134,7 @@ func executeShim() error {
shimapi.RegisterShimService(server, sv)
socket := socketFlag
if err := serve(server, socket); err != nil {
if err := serve(context.Background(), server, socket); err != nil {
return err
}
logger := logrus.WithFields(logrus.Fields{
@@ -152,7 +152,7 @@ func executeShim() error {
// serve serves the ttrpc API over a unix socket at the provided path
// this function does not block
func serve(server *ttrpc.Server, path string) error {
func serve(ctx context.Context, server *ttrpc.Server, path string) error {
var (
l net.Listener
err error
@@ -172,7 +172,7 @@ func serve(server *ttrpc.Server, path string) error {
logrus.WithField("socket", path).Debug("serving api on unix socket")
go func() {
defer l.Close()
if err := server.Serve(context.Background(), l); err != nil &&
if err := server.Serve(ctx, l); err != nil &&
!strings.Contains(err.Error(), "use of closed network connection") {
logrus.WithError(err).Fatal("containerd-shim: ttrpc server failure")
}

View File

@@ -22,7 +22,7 @@ import (
"os"
"os/signal"
"github.com/containerd/containerd/runtime/shim"
"github.com/containerd/containerd/runtime/v1/shim"
runc "github.com/containerd/go-runc"
"github.com/containerd/ttrpc"
)

View File

@@ -20,7 +20,7 @@ import (
"os"
"os/signal"
"github.com/containerd/containerd/runtime/shim"
"github.com/containerd/containerd/runtime/v1/shim"
runc "github.com/containerd/go-runc"
"github.com/containerd/ttrpc"
"github.com/opencontainers/runc/libcontainer/system"

View File

@@ -22,7 +22,7 @@ import (
"os"
"os/signal"
"github.com/containerd/containerd/runtime/shim"
"github.com/containerd/containerd/runtime/v1/shim"
runc "github.com/containerd/go-runc"
"github.com/containerd/ttrpc"
)