Start work on execution server implementation

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-12-02 11:33:58 -08:00
parent d0e2f3778a
commit 6641888667
31 changed files with 125 additions and 26 deletions

View file

@ -13,6 +13,8 @@ import (
"github.com/Sirupsen/logrus"
"github.com/docker/containerd"
api "github.com/docker/containerd/api/execution"
"github.com/docker/containerd/services/execution"
metrics "github.com/docker/go-metrics"
"github.com/urfave/cli"
)
@ -35,6 +37,16 @@ high performance container runtime
Name: "debug",
Usage: "enable debug output in logs",
},
cli.StringFlag{
Name: "root",
Usage: "containerd state directory",
Value: "/run/containerd",
},
cli.StringFlag{
Name: "runtime",
Usage: "default runtime for execution",
Value: "runc",
},
cli.StringFlag{
Name: "socket, s",
Usage: "socket path for containerd's GRPC server",
@ -69,7 +81,17 @@ high performance container runtime
return err
}
execService, err := execution.New(execution.Opts{
Root: context.GlobalString("root"),
Runtime: context.GlobalString("runtime"),
})
if err != nil {
return err
}
server := grpc.NewServer()
api.RegisterExecutionServiceServer(server, execService)
api.RegisterContainerServiceServer(server, execService)
go serveGRPC(server, l)
for s := range signals {