Merge branch 'tty'

This commit is contained in:
Michael Crosby 2015-12-14 17:13:54 -08:00
commit e16dfc36a5
11 changed files with 173 additions and 111 deletions

View file

@ -36,6 +36,7 @@ func (s *apiServer) CreateContainer(ctx context.Context, c *types.CreateContaine
e.Stdout = c.Stdout
e.Stderr = c.Stderr
e.Stdin = c.Stdin
e.Console = c.Console
if c.Checkpoint != "" {
e.Checkpoint = &runtime.Checkpoint{
Name: c.Checkpoint,

View file

@ -68,6 +68,7 @@ type CreateContainerRequest struct {
Stdin string `protobuf:"bytes,3,opt,name=stdin" json:"stdin,omitempty"`
Stdout string `protobuf:"bytes,4,opt,name=stdout" json:"stdout,omitempty"`
Stderr string `protobuf:"bytes,5,opt,name=stderr" json:"stderr,omitempty"`
Console string `protobuf:"bytes,6,opt,name=console" json:"console,omitempty"`
Checkpoint string `protobuf:"bytes,7,opt,name=checkpoint" json:"checkpoint,omitempty"`
}
@ -1081,95 +1082,95 @@ var _API_serviceDesc = grpc.ServiceDesc{
}
var fileDescriptor0 = []byte{
// 1426 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x57, 0xd9, 0x6e, 0x1c, 0x55,
0x13, 0xf6, 0xcc, 0xf4, 0x6c, 0x35, 0x8b, 0xed, 0x76, 0xec, 0x8c, 0xe7, 0xff, 0x43, 0x92, 0x26,
0x40, 0x84, 0x22, 0x2b, 0x38, 0x2c, 0x21, 0x5c, 0x40, 0x70, 0xa2, 0x04, 0x94, 0x80, 0x95, 0xd8,
0x48, 0xdc, 0x30, 0x6a, 0x77, 0x1f, 0x66, 0x0e, 0xd3, 0x1b, 0xdd, 0xa7, 0xbd, 0x88, 0x37, 0xe0,
0x81, 0x78, 0x00, 0x24, 0xee, 0x79, 0x0e, 0x9e, 0x82, 0x3a, 0x4b, 0x9f, 0x5e, 0x66, 0x09, 0x5c,
0x70, 0x33, 0xd2, 0xa9, 0xae, 0xfa, 0xa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xa5, 0x0b, 0xe5, 0xb8, 0x5f, 0x94, 0x5a, 0x1b, 0xf7, 0x6b,
0xb8, 0xa5, 0x3a, 0xcf, 0x08, 0x93, 0xfd, 0x5c, 0x74, 0xb5, 0x60, 0x22, 0x84, 0xdc, 0xe4, 0xac,
0x25, 0xde, 0xf8, 0x0f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xef, 0x98, 0x5d, 0x0a, 0xf0, 0x0f,
0x00, 0x00,
// 1433 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x57, 0xd9, 0x6e, 0x1c, 0x45,
0x17, 0xf6, 0xcc, 0xf4, 0x6c, 0x67, 0x16, 0xdb, 0xed, 0xd8, 0x19, 0xcf, 0xff, 0x87, 0x24, 0x4d,
0x80, 0x08, 0x45, 0x56, 0x70, 0x58, 0x42, 0xb8, 0x80, 0xe0, 0x44, 0x09, 0x28, 0x01, 0x2b, 0xb1,
0x91, 0xb8, 0x61, 0xd4, 0xee, 0x2e, 0x66, 0x8a, 0xe9, 0x8d, 0xee, 0x6a, 0x2f, 0xaf, 0x80, 0x78,
0x1e, 0x1e, 0x00, 0x89, 0x7b, 0x9e, 0x83, 0xa7, 0xe0, 0xd4, 0xd2, 0xd5, 0xcb, 0x2c, 0x81, 0x0b,
0x6e, 0x5a, 0xaa, 0xaa, 0x73, 0xbe, 0xf3, 0x9d, 0xb5, 0xab, 0xa0, 0x6b, 0x47, 0xf4, 0x20, 0x8a,
0x43, 0x16, 0x9a, 0x4d, 0x76, 0x15, 0x91, 0xc4, 0xfa, 0xb5, 0x06, 0x7b, 0x47, 0x31, 0xb1, 0x19,
0x39, 0x0a, 0x03, 0x66, 0xd3, 0x80, 0xc4, 0xaf, 0xc8, 0xcf, 0x29, 0x49, 0x98, 0x09, 0x50, 0xa7,
0xee, 0xa8, 0x76, 0xab, 0x76, 0xb7, 0x6b, 0xe2, 0xe2,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0x02, 0x10, 0x00, 0x00,
}

View file

@ -21,6 +21,7 @@ message CreateContainerRequest {
string stdin = 3; // path to the file where stdin will be read (optional)
string stdout = 4; // path to file where stdout will be written (optional)
string stderr = 5; // path to file where stderr will be written (optional)
string console = 6; // path to the console for a container (optional)
string checkpoint = 7; // checkpoint name if you want to create immediate checkpoint (optional)
}

View file

@ -11,6 +11,8 @@ import (
"github.com/codegangsta/cli"
"github.com/docker/containerd/api/grpc/types"
"github.com/docker/docker/pkg/term"
"github.com/opencontainers/runc/libcontainer"
netcontext "golang.org/x/net/context"
"google.golang.org/grpc"
)
@ -72,6 +74,10 @@ var StartCommand = cli.Command{
Name: "interactive,i",
Usage: "connect to the stdio of the container",
},
cli.BoolFlag{
Name: "tty,t",
Usage: "allocate a tty for use with the container",
},
},
Action: func(context *cli.Context) {
var (
@ -84,6 +90,11 @@ var StartCommand = cli.Command{
if id == "" {
fatal("container id cannot be empty", 1)
}
c := getClient()
events, err := c.Events(netcontext.Background(), &types.EventsRequest{})
if err != nil {
fatal(err.Error(), 1)
}
r := &types.CreateContainerRequest{
Id: id,
BundlePath: path,
@ -94,17 +105,57 @@ var StartCommand = cli.Command{
fatal(err.Error(), 1)
}
}
c := getClient()
if context.Bool("tty") {
if err := attachTty(r); err != nil {
fatal(err.Error(), 1)
}
}
if _, err := c.CreateContainer(netcontext.Background(), r); err != nil {
fatal(err.Error(), 1)
}
if stdin != nil {
go func() {
io.Copy(stdin, os.Stdin)
if state != nil {
term.RestoreTerminal(os.Stdin.Fd(), state)
}
}()
for {
e, err := events.Recv()
if err != nil {
fatal(err.Error(), 1)
}
if e.Id == id && e.Type == "exit" {
os.Exit(int(e.Status))
}
}
}
},
}
var stdin io.WriteCloser
var (
stdin io.WriteCloser
state *term.State
)
func attachTty(r *types.CreateContainerRequest) error {
console, err := libcontainer.NewConsole(os.Getuid(), os.Getgid())
if err != nil {
return err
}
r.Console = console.Path()
stdin = console
go func() {
io.Copy(os.Stdout, console)
console.Close()
}()
s, err := term.SetRawTerminal(os.Stdin.Fd())
if err != nil {
return err
}
state = s
return nil
}
func attachStdio(r *types.CreateContainerRequest) error {
dir, err := ioutil.TempDir("", "ctr-")

View file

@ -41,6 +41,7 @@ type Event struct {
Stdout string
Stderr string
Stdin string
Console string
Pid int
Status int
Signal os.Signal

2
io.go
View file

@ -53,9 +53,11 @@ type copier struct {
func (l *copier) Close() (err error) {
for _, c := range append(l.closers, l.config.Stdin, l.config.Stdout, l.config.Stderr) {
if c != nil {
if cerr := c.Close(); err == nil {
err = cerr
}
}
}
return err
}

View file

@ -188,9 +188,18 @@ func (p *libcontainerProcess) Signal(s os.Signal) error {
func (p *libcontainerProcess) Close() error {
// in close we always need to call wait to close/flush any pipes
_, err := p.process.Wait()
p.process.Stdin.(io.Closer).Close()
p.process.Stdout.(io.Closer).Close()
p.process.Stderr.(io.Closer).Close()
// explicitly close any open fd on the process
for _, cl := range []interface{}{
p.process.Stderr,
p.process.Stdout,
p.process.Stdin,
} {
if cl != nil {
if c, ok := cl.(io.Closer); ok {
c.Close()
}
}
}
return err
}
@ -375,7 +384,7 @@ func (r *libcontainerRuntime) Type() string {
return "libcontainer"
}
func (r *libcontainerRuntime) Create(id, bundlePath string) (runtime.Container, *runtime.IO, error) {
func (r *libcontainerRuntime) Create(id, bundlePath, consolePath string) (runtime.Container, *runtime.IO, error) {
spec, rspec, err := r.loadSpec(
filepath.Join(bundlePath, "config.json"),
filepath.Join(bundlePath, "runtime.json"),
@ -397,11 +406,9 @@ func (r *libcontainerRuntime) Create(id, bundlePath string) (runtime.Container,
}
var rio runtime.IO
if spec.Process.Terminal {
console, err := process.NewConsole(int(spec.Process.User.UID))
if err != nil {
if err := process.ConsoleFromPath(consolePath); err != nil {
return nil, nil, err
}
rio.Console = console
} else {
i, err := process.InitializeIO(int(spec.Process.User.UID))
if err != nil {

View file

@ -147,7 +147,7 @@ func (r *runcRuntime) Type() string {
return "runc"
}
func (r *runcRuntime) Create(id, bundlePath string) (runtime.Container, *runtime.IO, error) {
func (r *runcRuntime) Create(id, bundlePath, consolePath string) (runtime.Container, *runtime.IO, error) {
var s specs.Spec
f, err := os.Open(filepath.Join(bundlePath, "config.json"))
if err != nil {

View file

@ -35,7 +35,6 @@ type IO struct {
Stdin io.WriteCloser
Stdout io.ReadCloser
Stderr io.ReadCloser
Console Console
}
func (i *IO) Close() error {
@ -44,7 +43,6 @@ func (i *IO) Close() error {
i.Stdin,
i.Stdout,
i.Stderr,
i.Console,
} {
if c != nil {
if err := c.Close(); oerr == nil {

View file

@ -20,7 +20,7 @@ type Runtime interface {
// Type of the runtime
Type() string
// Create creates a new container initialized but without it starting it
Create(id, bundlePath string) (Container, *IO, error)
Create(id, bundlePath, consolePath string) (Container, *IO, error)
// StartProcess adds a new process to the container
StartProcess(Container, specs.Process) (Process, *IO, error)
}

View file

@ -5,7 +5,7 @@ type StartEvent struct {
}
func (h *StartEvent) Handle(e *Event) error {
container, io, err := h.s.runtime.Create(e.ID, e.BundlePath)
container, io, err := h.s.runtime.Create(e.ID, e.BundlePath, e.Console)
if err != nil {
return err
}