diff --git a/runtime/v2/binary.go b/runtime/v2/binary.go new file mode 100644 index 000000000..3727ba08b --- /dev/null +++ b/runtime/v2/binary.go @@ -0,0 +1,106 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package v2 + +import ( + "context" + "strings" + + eventstypes "github.com/containerd/containerd/api/events" + "github.com/containerd/containerd/events/exchange" + "github.com/containerd/containerd/runtime" + client "github.com/containerd/containerd/runtime/v2/shim" + "github.com/containerd/containerd/runtime/v2/task" + "github.com/containerd/ttrpc" + "github.com/pkg/errors" +) + +func shimBinary(ctx context.Context, bundle *Bundle, runtime, containerdAddress string, events *exchange.Exchange, rt *runtime.TaskList) *binary { + return &binary{ + bundle: bundle, + runtime: runtime, + containerdAddress: containerdAddress, + events: events, + rtTasks: rt, + } +} + +type binary struct { + runtime string + containerdAddress string + bundle *Bundle + events *exchange.Exchange + rtTasks *runtime.TaskList +} + +func (b *binary) Start(ctx context.Context) (*shim, error) { + cmd, err := client.Command(ctx, b.runtime, b.containerdAddress, b.bundle.Path, "-id", b.bundle.ID, "start") + if err != nil { + return nil, err + } + out, err := cmd.CombinedOutput() + if err != nil { + return nil, errors.Wrapf(err, "%s", out) + } + address := strings.TrimSpace(string(out)) + conn, err := client.Connect(address, client.AnonDialer) + if err != nil { + return nil, err + } + client := ttrpc.NewClient(conn) + client.OnClose(func() { conn.Close() }) + return &shim{ + bundle: b.bundle, + client: client, + task: task.NewTaskClient(client), + events: b.events, + rtTasks: b.rtTasks, + }, nil +} + +func (b *binary) Delete(ctx context.Context) (*runtime.Exit, error) { + cmd, err := client.Command(ctx, b.runtime, b.containerdAddress, b.bundle.Path, "-id", b.bundle.ID, "delete") + if err != nil { + return nil, err + } + out, err := cmd.CombinedOutput() + if err != nil { + return nil, errors.Wrapf(err, "%s", out) + } + var response task.DeleteResponse + if err := response.Unmarshal(out); err != nil { + return nil, err + } + if err := b.bundle.Delete(); err != nil { + return nil, err + } + // remove self from the runtime task list + // this seems dirty but it cleans up the API across runtimes, tasks, and the service + b.rtTasks.Delete(ctx, b.bundle.ID) + // shim will send the exit event + b.events.Publish(ctx, runtime.TaskDeleteEventTopic, &eventstypes.TaskDelete{ + ContainerID: b.bundle.ID, + ExitStatus: response.ExitStatus, + ExitedAt: response.ExitedAt, + Pid: response.Pid, + }) + return &runtime.Exit{ + Status: response.ExitStatus, + Timestamp: response.ExitedAt, + Pid: response.Pid, + }, nil +} diff --git a/runtime/v2/manager.go b/runtime/v2/manager.go index 9d36f351b..9cf7e514a 100644 --- a/runtime/v2/manager.go +++ b/runtime/v2/manager.go @@ -33,13 +33,10 @@ import ( "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/runtime" - ptypes "github.com/gogo/protobuf/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) -var empty = &ptypes.Empty{} - func init() { plugin.Register(&plugin.Registration{ Type: plugin.RuntimePluginV2, @@ -112,7 +109,8 @@ func (m *TaskManager) Create(ctx context.Context, id string, opts runtime.Create bundle.Delete() } }() - shim, err := newShim(ctx, bundle, opts.Runtime, m.containerdAddress, m.events, m.tasks) + b := shimBinary(ctx, bundle, opts.Runtime, m.containerdAddress, m.events, m.tasks) + shim, err := b.Start(ctx) if err != nil { return nil, err } diff --git a/runtime/v2/process.go b/runtime/v2/process.go index 02b05cf75..dbff8fd2c 100644 --- a/runtime/v2/process.go +++ b/runtime/v2/process.go @@ -40,7 +40,8 @@ func (p *process) ID() string { func (p *process) Kill(ctx context.Context, signal uint32, _ bool) error { _, err := p.shim.task.Kill(ctx, &task.KillRequest{ Signal: signal, - ID: p.id, + ID: p.shim.ID(), + ExecID: p.id, }) if err != nil { return errdefs.FromGRPC(err) @@ -50,7 +51,8 @@ func (p *process) Kill(ctx context.Context, signal uint32, _ bool) error { func (p *process) State(ctx context.Context) (runtime.State, error) { response, err := p.shim.task.State(ctx, &task.StateRequest{ - ID: p.id, + ID: p.shim.ID(), + ExecID: p.id, }) if err != nil { if errors.Cause(err) != ttrpc.ErrClosed { @@ -86,7 +88,8 @@ func (p *process) State(ctx context.Context) (runtime.State, error) { // ResizePty changes the side of the process's PTY to the provided width and height func (p *process) ResizePty(ctx context.Context, size runtime.ConsoleSize) error { _, err := p.shim.task.ResizePty(ctx, &task.ResizePtyRequest{ - ID: p.id, + ID: p.shim.ID(), + ExecID: p.id, Width: size.Width, Height: size.Height, }) @@ -99,8 +102,9 @@ func (p *process) ResizePty(ctx context.Context, size runtime.ConsoleSize) error // CloseIO closes the provided IO pipe for the process func (p *process) CloseIO(ctx context.Context) error { _, err := p.shim.task.CloseIO(ctx, &task.CloseIORequest{ - ID: p.id, - Stdin: true, + ID: p.shim.ID(), + ExecID: p.id, + Stdin: true, }) if err != nil { return errdefs.FromGRPC(err) @@ -111,7 +115,8 @@ func (p *process) CloseIO(ctx context.Context) error { // Start the process func (p *process) Start(ctx context.Context) error { response, err := p.shim.task.Start(ctx, &task.StartRequest{ - ID: p.id, + ID: p.shim.ID(), + ExecID: p.id, }) if err != nil { return errdefs.FromGRPC(err) @@ -127,7 +132,8 @@ func (p *process) Start(ctx context.Context) error { // Wait on the process to exit and return the exit status and timestamp func (p *process) Wait(ctx context.Context) (*runtime.Exit, error) { response, err := p.shim.task.Wait(ctx, &task.WaitRequest{ - ID: p.id, + ID: p.shim.ID(), + ExecID: p.id, }) if err != nil { return nil, errdefs.FromGRPC(err) @@ -140,7 +146,8 @@ func (p *process) Wait(ctx context.Context) (*runtime.Exit, error) { func (p *process) Delete(ctx context.Context) (*runtime.Exit, error) { response, err := p.shim.task.Delete(ctx, &task.DeleteRequest{ - ID: p.id, + ID: p.shim.ID(), + ExecID: p.id, }) if err != nil { return nil, errdefs.FromGRPC(err) diff --git a/runtime/v2/runc/service.go b/runtime/v2/runc/service.go index a815c6b22..14a8f5b8c 100644 --- a/runtime/v2/runc/service.go +++ b/runtime/v2/runc/service.go @@ -22,8 +22,10 @@ import ( "context" "io/ioutil" "os" + "os/exec" "path/filepath" "sync" + "syscall" "time" "github.com/containerd/cgroups" @@ -83,6 +85,7 @@ type service struct { mu sync.Mutex context context.Context + task rproc.Process processes map[string]rproc.Process events chan interface{} platform rproc.Platform @@ -94,6 +97,77 @@ type service struct { cg cgroups.Cgroup } +func newCommand(ctx context.Context, containerdBinary, containerdAddress string) (*exec.Cmd, error) { + ns, err := namespaces.NamespaceRequired(ctx) + if err != nil { + return nil, err + } + self, err := os.Executable() + if err != nil { + return nil, err + } + cwd, err := os.Getwd() + if err != nil { + return nil, err + } + args := []string{ + "-namespace", ns, + "-address", containerdAddress, + "-publish-binary", containerdBinary, + } + cmd := exec.Command(self, args...) + cmd.Dir = cwd + cmd.Env = append(os.Environ(), "GOMAXPROCS=2") + cmd.SysProcAttr = &syscall.SysProcAttr{ + Setpgid: true, + } + return cmd, nil +} + +func (s *service) StartShim(ctx context.Context, id, containerdBinary, containerdAddress string) (string, error) { + cmd, err := newCommand(ctx, containerdBinary, containerdAddress) + if err != nil { + return "", err + } + address, err := shim.AbstractAddress(ctx, id) + if err != nil { + return "", err + } + socket, err := shim.NewSocket(address) + if err != nil { + return "", err + } + defer socket.Close() + f, err := socket.File() + if err != nil { + return "", err + } + defer f.Close() + + cmd.ExtraFiles = append(cmd.ExtraFiles, f) + + if err := cmd.Start(); err != nil { + return "", err + } + defer func() { + if err != nil { + cmd.Process.Kill() + } + }() + // make sure to wait after start + go cmd.Wait() + if err := shim.WritePidFile("shim.pid", cmd.Process.Pid); err != nil { + return "", err + } + if err := shim.WriteAddress("address", address); err != nil { + return "", err + } + if err := shim.SetScore(cmd.Process.Pid); err != nil { + return "", errors.Wrap(err, "failed to set OOM Score on shim") + } + return address, nil +} + func (s *service) Cleanup(ctx context.Context) (*taskAPI.DeleteResponse, error) { path, err := os.Getwd() if err != nil { @@ -221,7 +295,7 @@ func (s *service) Create(ctx context.Context, r *taskAPI.CreateTaskRequest) (_ * } s.cg = cg } - s.processes[r.ID] = process + s.task = process return &taskAPI.CreateTaskResponse{ Pid: uint32(pid), }, nil @@ -232,9 +306,9 @@ func (s *service) Create(ctx context.Context, r *taskAPI.CreateTaskRequest) (_ * func (s *service) Start(ctx context.Context, r *taskAPI.StartRequest) (*taskAPI.StartResponse, error) { s.mu.Lock() defer s.mu.Unlock() - p := s.processes[r.ID] - if p == nil { - return nil, errdefs.ToGRPCf(errdefs.ErrNotFound, "process %s", r.ID) + p, err := s.getProcess(r.ExecID) + if err != nil { + return nil, err } if err := p.Start(ctx); err != nil { return nil, err @@ -247,7 +321,6 @@ func (s *service) Start(ctx context.Context, r *taskAPI.StartRequest) (*taskAPI. s.cg = cg } return &taskAPI.StartResponse{ - ID: p.ID(), Pid: uint32(p.Pid()), }, nil } @@ -256,16 +329,21 @@ func (s *service) Start(ctx context.Context, r *taskAPI.StartRequest) (*taskAPI. func (s *service) Delete(ctx context.Context, r *taskAPI.DeleteRequest) (*taskAPI.DeleteResponse, error) { s.mu.Lock() defer s.mu.Unlock() - - p := s.processes[r.ID] + p, err := s.getProcess(r.ExecID) + if err != nil { + return nil, err + } if p == nil { - return nil, errors.Wrapf(errdefs.ErrNotFound, "process %s", r.ID) + return nil, errdefs.ToGRPCf(errdefs.ErrFailedPrecondition, "container must be created") } if err := p.Delete(ctx); err != nil { return nil, err } - delete(s.processes, r.ID) - if r.ID == s.id && s.platform != nil { + isTask := r.ExecID == "" + if !isTask { + delete(s.processes, r.ExecID) + } + if isTask && s.platform != nil { s.platform.Close() } return &taskAPI.DeleteResponse{ @@ -279,18 +357,15 @@ func (s *service) Delete(ctx context.Context, r *taskAPI.DeleteRequest) (*taskAP func (s *service) Exec(ctx context.Context, r *taskAPI.ExecProcessRequest) (*ptypes.Empty, error) { s.mu.Lock() defer s.mu.Unlock() - - if p := s.processes[r.ID]; p != nil { - return nil, errdefs.ToGRPCf(errdefs.ErrAlreadyExists, "id %s", r.ID) + if p := s.processes[r.ExecID]; p != nil { + return nil, errdefs.ToGRPCf(errdefs.ErrAlreadyExists, "id %s", r.ExecID) } - - p := s.processes[s.id] + p := s.task if p == nil { return nil, errdefs.ToGRPCf(errdefs.ErrFailedPrecondition, "container must be created") } - process, err := p.(*proc.Init).Exec(ctx, s.bundle, &proc.ExecConfig{ - ID: r.ID, + ID: r.ExecID, Terminal: r.Terminal, Stdin: r.Stdin, Stdout: r.Stdout, @@ -300,7 +375,7 @@ func (s *service) Exec(ctx context.Context, r *taskAPI.ExecProcessRequest) (*pty if err != nil { return nil, errdefs.ToGRPC(err) } - s.processes[r.ID] = process + s.processes[r.ExecID] = process return empty, nil } @@ -308,17 +383,14 @@ func (s *service) Exec(ctx context.Context, r *taskAPI.ExecProcessRequest) (*pty func (s *service) ResizePty(ctx context.Context, r *taskAPI.ResizePtyRequest) (*ptypes.Empty, error) { s.mu.Lock() defer s.mu.Unlock() - if r.ID == "" { - return nil, errdefs.ToGRPCf(errdefs.ErrInvalidArgument, "id not provided") + p, err := s.getProcess(r.ExecID) + if err != nil { + return nil, err } ws := console.WinSize{ Width: uint16(r.Width), Height: uint16(r.Height), } - p := s.processes[r.ID] - if p == nil { - return nil, errors.Errorf("process does not exist %s", r.ID) - } if err := p.Resize(ws); err != nil { return nil, errdefs.ToGRPC(err) } @@ -329,9 +401,9 @@ func (s *service) ResizePty(ctx context.Context, r *taskAPI.ResizePtyRequest) (* func (s *service) State(ctx context.Context, r *taskAPI.StateRequest) (*taskAPI.StateResponse, error) { s.mu.Lock() defer s.mu.Unlock() - p := s.processes[r.ID] - if p == nil { - return nil, errdefs.ToGRPCf(errdefs.ErrNotFound, "process id %s", r.ID) + p, err := s.getProcess(r.ExecID) + if err != nil { + return nil, err } st, err := p.Status(ctx) if err != nil { @@ -366,10 +438,10 @@ func (s *service) State(ctx context.Context, r *taskAPI.StateRequest) (*taskAPI. } // Pause the container -func (s *service) Pause(ctx context.Context, r *ptypes.Empty) (*ptypes.Empty, error) { +func (s *service) Pause(ctx context.Context, r *taskAPI.PauseRequest) (*ptypes.Empty, error) { s.mu.Lock() defer s.mu.Unlock() - p := s.processes[s.id] + p := s.task if p == nil { return nil, errdefs.ToGRPCf(errdefs.ErrFailedPrecondition, "container must be created") } @@ -380,10 +452,10 @@ func (s *service) Pause(ctx context.Context, r *ptypes.Empty) (*ptypes.Empty, er } // Resume the container -func (s *service) Resume(ctx context.Context, r *ptypes.Empty) (*ptypes.Empty, error) { +func (s *service) Resume(ctx context.Context, r *taskAPI.ResumeRequest) (*ptypes.Empty, error) { s.mu.Lock() defer s.mu.Unlock() - p := s.processes[s.id] + p := s.task if p == nil { return nil, errdefs.ToGRPCf(errdefs.ErrFailedPrecondition, "container must be created") } @@ -397,20 +469,12 @@ func (s *service) Resume(ctx context.Context, r *ptypes.Empty) (*ptypes.Empty, e func (s *service) Kill(ctx context.Context, r *taskAPI.KillRequest) (*ptypes.Empty, error) { s.mu.Lock() defer s.mu.Unlock() - if r.ID == "" { - p := s.processes[s.id] - if p == nil { - return nil, errdefs.ToGRPCf(errdefs.ErrFailedPrecondition, "container must be created") - } - if err := p.Kill(ctx, r.Signal, r.All); err != nil { - return nil, errdefs.ToGRPC(err) - } - return empty, nil + p, err := s.getProcess(r.ExecID) + if err != nil { + return nil, err } - - p := s.processes[r.ID] if p == nil { - return nil, errdefs.ToGRPCf(errdefs.ErrNotFound, "process id %s not found", r.ID) + return nil, errdefs.ToGRPCf(errdefs.ErrFailedPrecondition, "container must be created") } if err := p.Kill(ctx, r.Signal, r.All); err != nil { return nil, errdefs.ToGRPC(err) @@ -453,9 +517,9 @@ func (s *service) Pids(ctx context.Context, r *taskAPI.PidsRequest) (*taskAPI.Pi func (s *service) CloseIO(ctx context.Context, r *taskAPI.CloseIORequest) (*ptypes.Empty, error) { s.mu.Lock() defer s.mu.Unlock() - p := s.processes[r.ID] - if p == nil { - return nil, errdefs.ToGRPCf(errdefs.ErrNotFound, "process does not exist %s", r.ID) + p, err := s.getProcess(r.ExecID) + if err != nil { + return nil, err } if stdin := p.Stdin(); stdin != nil { if err := stdin.Close(); err != nil { @@ -469,7 +533,7 @@ func (s *service) CloseIO(ctx context.Context, r *taskAPI.CloseIORequest) (*ptyp func (s *service) Checkpoint(ctx context.Context, r *taskAPI.CheckpointTaskRequest) (*ptypes.Empty, error) { s.mu.Lock() defer s.mu.Unlock() - p := s.processes[s.id] + p := s.task if p == nil { return nil, errdefs.ToGRPCf(errdefs.ErrFailedPrecondition, "container must be created") } @@ -497,9 +561,13 @@ func (s *service) Checkpoint(ctx context.Context, r *taskAPI.CheckpointTaskReque // Connect returns shim information such as the shim's pid func (s *service) Connect(ctx context.Context, r *taskAPI.ConnectRequest) (*taskAPI.ConnectResponse, error) { + var pid int + if s.task != nil { + pid = s.task.Pid() + } return &taskAPI.ConnectResponse{ ShimPid: uint32(os.Getpid()), - TaskPid: uint32(s.processes[s.id].Pid()), + TaskPid: uint32(pid), }, nil } @@ -532,7 +600,7 @@ func (s *service) Stats(ctx context.Context, r *taskAPI.StatsRequest) (*taskAPI. func (s *service) Update(ctx context.Context, r *taskAPI.UpdateTaskRequest) (*ptypes.Empty, error) { s.mu.Lock() defer s.mu.Unlock() - p := s.processes[s.id] + p := s.task if p == nil { return nil, errdefs.ToGRPCf(errdefs.ErrFailedPrecondition, "container must be created") } @@ -545,8 +613,11 @@ func (s *service) Update(ctx context.Context, r *taskAPI.UpdateTaskRequest) (*pt // Wait for a process to exit func (s *service) Wait(ctx context.Context, r *taskAPI.WaitRequest) (*taskAPI.WaitResponse, error) { s.mu.Lock() - p := s.processes[r.ID] + p, err := s.getProcess(r.ExecID) s.mu.Unlock() + if err != nil { + return nil, err + } if p == nil { return nil, errdefs.ToGRPCf(errdefs.ErrFailedPrecondition, "container must be created") } @@ -567,7 +638,8 @@ func (s *service) processExits() { func (s *service) checkProcesses(e runcC.Exit) { s.mu.Lock() defer s.mu.Unlock() - for _, p := range s.processes { + + for _, p := range s.allProcesses() { if p.Pid() == e.Pid { if ip, ok := p.(*proc.Init); ok { // Ensure all children are killed @@ -589,14 +661,23 @@ func (s *service) checkProcesses(e runcC.Exit) { } } +func (s *service) allProcesses() (o []rproc.Process) { + for _, p := range s.processes { + o = append(o, p) + } + if s.task != nil { + o = append(o, s.task) + } + return o +} + func (s *service) getContainerPids(ctx context.Context, id string) ([]uint32, error) { s.mu.Lock() defer s.mu.Unlock() - p := s.processes[s.id] + p := s.task if p == nil { return nil, errors.Wrapf(errdefs.ErrFailedPrecondition, "container must be created") } - ps, err := p.(*proc.Init).Runtime().Ps(ctx, id) if err != nil { return nil, err @@ -616,6 +697,17 @@ func (s *service) forward(publisher events.Publisher) { } } +func (s *service) getProcess(execID string) (rproc.Process, error) { + if execID == "" { + return s.task, nil + } + p := s.processes[execID] + if p == nil { + return nil, errdefs.ToGRPCf(errdefs.ErrNotFound, "process does not exist %s", execID) + } + return p, nil +} + func getTopic(ctx context.Context, e interface{}) string { switch e.(type) { case *eventstypes.TaskCreate: diff --git a/runtime/v2/shim.go b/runtime/v2/shim.go index dae112cdc..8200a9e1c 100644 --- a/runtime/v2/shim.go +++ b/runtime/v2/shim.go @@ -18,6 +18,7 @@ package v2 import ( "context" + "io/ioutil" "path/filepath" "time" @@ -29,129 +30,27 @@ import ( "github.com/containerd/containerd/identifiers" "github.com/containerd/containerd/log" "github.com/containerd/containerd/runtime" + client "github.com/containerd/containerd/runtime/v2/shim" "github.com/containerd/containerd/runtime/v2/task" "github.com/containerd/ttrpc" ptypes "github.com/gogo/protobuf/types" "github.com/pkg/errors" - "github.com/sirupsen/logrus" ) -type binary struct { - runtime string - containerdAddress string - bundle *Bundle - events *exchange.Exchange - rtTasks *runtime.TaskList -} - -func (b *binary) Delete(ctx context.Context) (*runtime.Exit, error) { - cmd, err := shimCommand(ctx, b.runtime, b.containerdAddress, b.bundle, "-debug", "delete") +func loadAddress(path string) (string, error) { + data, err := ioutil.ReadFile(path) if err != nil { - return nil, err + return "", err } - out, err := cmd.CombinedOutput() - if err != nil { - return nil, errors.Wrapf(err, "%s", out) - } - var response task.DeleteResponse - if err := response.Unmarshal(out); err != nil { - return nil, err - } - if err := b.bundle.Delete(); err != nil { - return nil, err - } - // remove self from the runtime task list - // this seems dirty but it cleans up the API across runtimes, tasks, and the service - b.rtTasks.Delete(ctx, b.bundle.ID) - // shim will send the exit event - b.events.Publish(ctx, runtime.TaskDeleteEventTopic, &eventstypes.TaskDelete{ - ContainerID: b.bundle.ID, - ExitStatus: response.ExitStatus, - ExitedAt: response.ExitedAt, - Pid: response.Pid, - }) - return &runtime.Exit{ - Status: response.ExitStatus, - Timestamp: response.ExitedAt, - Pid: response.Pid, - }, nil -} - -func shimBinary(ctx context.Context, bundle *Bundle, runtime, containerdAddress string, events *exchange.Exchange, rt *runtime.TaskList) *binary { - return &binary{ - bundle: bundle, - runtime: runtime, - containerdAddress: containerdAddress, - events: events, - rtTasks: rt, - } -} - -// newShim starts and returns a new shim -func newShim(ctx context.Context, bundle *Bundle, runtime, containerdAddress string, events *exchange.Exchange, rt *runtime.TaskList) (_ *shim, err error) { - cmd, err := shimCommand(ctx, runtime, containerdAddress, bundle, "-debug") - if err != nil { - return nil, err - } - address, err := abstractAddress(ctx, bundle.ID) - if err != nil { - return nil, err - } - socket, err := newSocket(address) - if err != nil { - return nil, err - } - defer socket.Close() - f, err := socket.File() - if err != nil { - return nil, err - } - defer f.Close() - - cmd.ExtraFiles = append(cmd.ExtraFiles, f) - - if err := cmd.Start(); err != nil { - return nil, err - } - defer func() { - if err != nil { - cmd.Process.Kill() - } - }() - // make sure to wait after start - go cmd.Wait() - if err := writePidFile(filepath.Join(bundle.Path, "shim.pid"), cmd.Process.Pid); err != nil { - return nil, err - } - log.G(ctx).WithFields(logrus.Fields{ - "pid": cmd.Process.Pid, - "address": address, - }).Infof("shim %s started", cmd.Args[0]) - if err := setScore(cmd.Process.Pid); err != nil { - return nil, errors.Wrap(err, "failed to set OOM Score on shim") - } - conn, err := connect(address, annonDialer) - if err != nil { - return nil, err - } - client := ttrpc.NewClient(conn) - client.OnClose(func() { conn.Close() }) - return &shim{ - bundle: bundle, - client: client, - task: task.NewTaskClient(client), - shimPid: cmd.Process.Pid, - events: events, - rtTasks: rt, - }, nil + return string(data), nil } func loadShim(ctx context.Context, bundle *Bundle, events *exchange.Exchange, rt *runtime.TaskList) (_ *shim, err error) { - address, err := abstractAddress(ctx, bundle.ID) + address, err := loadAddress(filepath.Join(bundle.Path, "address")) if err != nil { return nil, err } - conn, err := connect(address, annonDialer) + conn, err := client.Connect(address, client.AnonDialer) if err != nil { return nil, err } @@ -174,7 +73,6 @@ type shim struct { bundle *Bundle client *ttrpc.Client task task.TaskService - shimPid int taskPid int events *exchange.Exchange rtTasks *runtime.TaskList @@ -185,15 +83,15 @@ func (s *shim) Connect(ctx context.Context) error { if err != nil { return err } - s.shimPid = int(response.ShimPid) s.taskPid = int(response.TaskPid) return nil } func (s *shim) Shutdown(ctx context.Context) error { - _, err := s.task.Shutdown(ctx, &task.ShutdownRequest{}) - if err != nil { - // handle conn closed error type + _, err := s.task.Shutdown(ctx, &task.ShutdownRequest{ + ID: s.ID(), + }) + if err != nil && err != ttrpc.ErrClosed { return errdefs.FromGRPC(err) } return nil @@ -208,12 +106,8 @@ func (s *shim) waitShutdown(ctx context.Context) error { close(dead) }() select { - case <-time.After(1 * time.Second): - if err := terminate(s.shimPid); err != nil { - log.G(ctx).WithError(err).Error("terminate shim") - } - <-dead - return nil + case <-time.After(3 * time.Second): + return errors.New("failed to shutdown shim in time") case <-dead: return nil } @@ -292,7 +186,9 @@ func (s *shim) Create(ctx context.Context, opts runtime.CreateOpts) (runtime.Tas } func (s *shim) Pause(ctx context.Context) error { - if _, err := s.task.Pause(ctx, empty); err != nil { + if _, err := s.task.Pause(ctx, &task.PauseRequest{ + ID: s.ID(), + }); err != nil { return errdefs.FromGRPC(err) } s.events.Publish(ctx, runtime.TaskPausedEventTopic, &eventstypes.TaskPaused{ @@ -302,7 +198,9 @@ func (s *shim) Pause(ctx context.Context) error { } func (s *shim) Resume(ctx context.Context) error { - if _, err := s.task.Resume(ctx, empty); err != nil { + if _, err := s.task.Resume(ctx, &task.ResumeRequest{ + ID: s.ID(), + }); err != nil { return errdefs.FromGRPC(err) } s.events.Publish(ctx, runtime.TaskResumedEventTopic, &eventstypes.TaskResumed{ @@ -342,7 +240,8 @@ func (s *shim) Exec(ctx context.Context, id string, opts runtime.ExecOpts) (runt return nil, errors.Wrapf(err, "invalid exec id %s", id) } request := &task.ExecProcessRequest{ - ID: id, + ID: s.ID(), + ExecID: id, Stdin: opts.IO.Stdin, Stdout: opts.IO.Stdout, Stderr: opts.IO.Stderr, @@ -428,6 +327,7 @@ func (s *shim) Checkpoint(ctx context.Context, path string, options *ptypes.Any) func (s *shim) Update(ctx context.Context, resources *ptypes.Any) error { if _, err := s.task.Update(ctx, &task.UpdateTaskRequest{ + ID: s.ID(), Resources: resources, }); err != nil { return errdefs.FromGRPC(err) @@ -436,7 +336,9 @@ func (s *shim) Update(ctx context.Context, resources *ptypes.Any) error { } func (s *shim) Stats(ctx context.Context) (*ptypes.Any, error) { - response, err := s.task.Stats(ctx, &task.StatsRequest{}) + response, err := s.task.Stats(ctx, &task.StatsRequest{ + ID: s.ID(), + }) if err != nil { return nil, errdefs.FromGRPC(err) } diff --git a/runtime/v2/shim/shim.go b/runtime/v2/shim/shim.go index b1129173d..93a1ab6a4 100644 --- a/runtime/v2/shim/shim.go +++ b/runtime/v2/shim/shim.go @@ -57,6 +57,7 @@ type Init func(context.Context, string, events.Publisher) (Shim, error) type Shim interface { shimapi.TaskService Cleanup(ctx context.Context) (*shimapi.DeleteResponse, error) + StartShim(ctx context.Context, id, containerdBinary, containerdAddress string) (string, error) } var ( @@ -72,7 +73,7 @@ var ( func parseFlags() { flag.BoolVar(&debugFlag, "debug", false, "enable debug output in logs") flag.StringVar(&namespaceFlag, "namespace", "", "namespace that owns the shim") - flag.StringVar(&idFlag, "id", "", "id of the shim") + flag.StringVar(&idFlag, "id", "", "id of the task") flag.StringVar(&socketFlag, "socket", "", "abstract socket path to serve") flag.StringVar(&addressFlag, "address", "", "grpc address back to main containerd") @@ -92,7 +93,7 @@ func setRuntime() { if debugFlag { f, err := os.OpenFile("shim.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600) if err != nil { - fmt.Fprintf(os.Stderr, "open should log %s", err) + fmt.Fprintf(os.Stderr, "open shim log %s", err) os.Exit(1) } logrus.SetLevel(logrus.DebugLevel) @@ -148,6 +149,15 @@ func Run(initFunc Init) error { return err } return nil + case "start": + address, err := service.StartShim(ctx, idFlag, containerdBinaryFlag, addressFlag) + if err != nil { + return err + } + if _, err := os.Stdout.WriteString(address); err != nil { + return err + } + return nil default: client := NewShimClient(ctx, service, signals) return client.Serve() diff --git a/runtime/v2/util.go b/runtime/v2/shim/util.go similarity index 66% rename from runtime/v2/util.go rename to runtime/v2/shim/util.go index 24bf26469..29d5d41bf 100644 --- a/runtime/v2/util.go +++ b/runtime/v2/shim/util.go @@ -14,7 +14,7 @@ limitations under the License. */ -package v2 +package shim import ( "context" @@ -32,7 +32,8 @@ import ( const shimBinaryFormat = "containerd-shim-%s-%s" -func shimCommand(ctx context.Context, runtime, containerdAddress string, bundle *Bundle, cmdArgs ...string) (*exec.Cmd, error) { +// Command returns the shim command with the provided args and configuration +func Command(ctx context.Context, runtime, containerdAddress, path string, cmdArgs ...string) (*exec.Cmd, error) { ns, err := namespaces.NamespaceRequired(ctx) if err != nil { return nil, err @@ -47,7 +48,7 @@ func shimCommand(ctx context.Context, runtime, containerdAddress string, bundle "-publish-binary", self, } args = append(args, cmdArgs...) - name := getShimBinaryName(runtime) + name := BinaryName(runtime) if _, err := exec.LookPath(name); err != nil { if eerr, ok := err.(*exec.Error); ok { if eerr.Err == exec.ErrNotFound { @@ -56,19 +57,21 @@ func shimCommand(ctx context.Context, runtime, containerdAddress string, bundle } } cmd := exec.Command(name, args...) - cmd.Dir = bundle.Path + cmd.Dir = path cmd.Env = append(os.Environ(), "GOMAXPROCS=2") cmd.SysProcAttr = getSysProcAttr() return cmd, nil } -func getShimBinaryName(runtime string) string { +// BinaryName returns the shim binary name from the runtime name +func BinaryName(runtime string) string { parts := strings.Split(runtime, ".") // TODO: add validation for runtime return fmt.Sprintf(shimBinaryFormat, parts[len(parts)-2], parts[len(parts)-1]) } -func abstractAddress(ctx context.Context, id string) (string, error) { +// AbstractAddress returns an abstract socket address +func AbstractAddress(ctx context.Context, id string) (string, error) { ns, err := namespaces.NamespaceRequired(ctx) if err != nil { return "", err @@ -76,16 +79,19 @@ func abstractAddress(ctx context.Context, id string) (string, error) { return filepath.Join(string(filepath.Separator), "containerd-shim", ns, id, "shim.sock"), nil } -func connect(address string, d func(string, time.Duration) (net.Conn, error)) (net.Conn, error) { +// Connect to the provided address +func Connect(address string, d func(string, time.Duration) (net.Conn, error)) (net.Conn, error) { return d(address, 100*time.Second) } -func annonDialer(address string, timeout time.Duration) (net.Conn, error) { +// AnonDialer returns a dialer for an abstract socket +func AnonDialer(address string, timeout time.Duration) (net.Conn, error) { address = strings.TrimPrefix(address, "unix://") return net.DialTimeout("unix", "\x00"+address, timeout) } -func newSocket(address string) (*net.UnixListener, error) { +// NewSocket returns a new socket +func NewSocket(address string) (*net.UnixListener, error) { if len(address) > 106 { return nil, errors.Errorf("%q: unix socket path too long (> 106)", address) } @@ -96,7 +102,8 @@ func newSocket(address string) (*net.UnixListener, error) { return l.(*net.UnixListener), nil } -func writePidFile(path string, pid int) error { +// WritePidFile writes a pid file atomically +func WritePidFile(path string, pid int) error { path, err := filepath.Abs(path) if err != nil { return err @@ -113,3 +120,22 @@ func writePidFile(path string, pid int) error { } return os.Rename(tempPath, path) } + +// WriteAddress writes a address file atomically +func WriteAddress(path, address string) error { + path, err := filepath.Abs(path) + if err != nil { + return err + } + tempPath := filepath.Join(filepath.Dir(path), fmt.Sprintf(".%s", filepath.Base(path))) + f, err := os.OpenFile(tempPath, os.O_RDWR|os.O_CREATE|os.O_EXCL|os.O_SYNC, 0666) + if err != nil { + return err + } + _, err = f.WriteString(address) + f.Close() + if err != nil { + return err + } + return os.Rename(tempPath, path) +} diff --git a/runtime/v2/shim_linux.go b/runtime/v2/shim/util_linux.go similarity index 85% rename from runtime/v2/shim_linux.go rename to runtime/v2/shim/util_linux.go index 17cd4c521..f7178b6b5 100644 --- a/runtime/v2/shim_linux.go +++ b/runtime/v2/shim/util_linux.go @@ -14,13 +14,12 @@ limitations under the License. */ -package v2 +package shim import ( "syscall" "github.com/containerd/containerd/sys" - "golang.org/x/sys/unix" ) func getSysProcAttr() *syscall.SysProcAttr { @@ -29,10 +28,7 @@ func getSysProcAttr() *syscall.SysProcAttr { } } -func terminate(pid int) error { - return unix.Kill(pid, unix.SIGKILL) -} - -func setScore(pid int) error { +// SetScore sets the oom score for a process +func SetScore(pid int) error { return sys.SetOOMScore(pid, sys.OOMScoreMaxKillable) } diff --git a/runtime/v2/shim_unix.go b/runtime/v2/shim/util_unix.go similarity index 84% rename from runtime/v2/shim_unix.go rename to runtime/v2/shim/util_unix.go index 82f202de8..e2d99bf97 100644 --- a/runtime/v2/shim_unix.go +++ b/runtime/v2/shim/util_unix.go @@ -16,12 +16,10 @@ limitations under the License. */ -package v2 +package shim import ( "syscall" - - "golang.org/x/sys/unix" ) func getSysProcAttr() *syscall.SysProcAttr { @@ -30,10 +28,7 @@ func getSysProcAttr() *syscall.SysProcAttr { } } -func terminate(pid int) error { - return unix.Kill(pid, unix.SIGKILL) -} - -func setScore(pid int) error { +// SetScore sets the oom score for a process +func SetScore(pid int) error { return nil } diff --git a/runtime/v2/shim_windows.go b/runtime/v2/shim/util_windows.go similarity index 80% rename from runtime/v2/shim_windows.go rename to runtime/v2/shim/util_windows.go index ec368fd94..b5a3ecb9d 100644 --- a/runtime/v2/shim_windows.go +++ b/runtime/v2/shim/util_windows.go @@ -14,10 +14,9 @@ limitations under the License. */ -package v2 +package shim import ( - "os" "syscall" ) @@ -25,14 +24,7 @@ func getSysProcAttr() *syscall.SysProcAttr { return nil } -func terminate(pid int) error { - p, err := os.FindProcess(pid) - if err != nil { - return err - } - return p.Kill() -} - -func setScore(pid int) error { +// SetScore sets the oom score for a process +func SetScore(pid int) error { return nil } diff --git a/runtime/v2/task/shim.pb.go b/runtime/v2/task/shim.pb.go index 6fbba8e41..9caefd758 100644 --- a/runtime/v2/task/shim.pb.go +++ b/runtime/v2/task/shim.pb.go @@ -32,6 +32,8 @@ ConnectRequest ConnectResponse ShutdownRequest + PauseRequest + ResumeRequest */ package task @@ -96,7 +98,8 @@ func (*CreateTaskResponse) ProtoMessage() {} func (*CreateTaskResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{1} } type DeleteRequest struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` } func (m *DeleteRequest) Reset() { *m = DeleteRequest{} } @@ -115,11 +118,12 @@ func (*DeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, type ExecProcessRequest struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Terminal bool `protobuf:"varint,2,opt,name=terminal,proto3" json:"terminal,omitempty"` - Stdin string `protobuf:"bytes,3,opt,name=stdin,proto3" json:"stdin,omitempty"` - Stdout string `protobuf:"bytes,4,opt,name=stdout,proto3" json:"stdout,omitempty"` - Stderr string `protobuf:"bytes,5,opt,name=stderr,proto3" json:"stderr,omitempty"` - Spec *google_protobuf.Any `protobuf:"bytes,6,opt,name=spec" json:"spec,omitempty"` + ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` + Terminal bool `protobuf:"varint,3,opt,name=terminal,proto3" json:"terminal,omitempty"` + Stdin string `protobuf:"bytes,4,opt,name=stdin,proto3" json:"stdin,omitempty"` + Stdout string `protobuf:"bytes,5,opt,name=stdout,proto3" json:"stdout,omitempty"` + Stderr string `protobuf:"bytes,6,opt,name=stderr,proto3" json:"stderr,omitempty"` + Spec *google_protobuf.Any `protobuf:"bytes,7,opt,name=spec" json:"spec,omitempty"` } func (m *ExecProcessRequest) Reset() { *m = ExecProcessRequest{} } @@ -135,8 +139,9 @@ func (*ExecProcessResponse) Descriptor() ([]byte, []int) { return fileDescriptor type ResizePtyRequest struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Width uint32 `protobuf:"varint,2,opt,name=width,proto3" json:"width,omitempty"` - Height uint32 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` + Width uint32 `protobuf:"varint,3,opt,name=width,proto3" json:"width,omitempty"` + Height uint32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"` } func (m *ResizePtyRequest) Reset() { *m = ResizePtyRequest{} } @@ -144,7 +149,8 @@ func (*ResizePtyRequest) ProtoMessage() {} func (*ResizePtyRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{6} } type StateRequest struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` } func (m *StateRequest) Reset() { *m = StateRequest{} } @@ -170,8 +176,9 @@ func (*StateResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, type KillRequest struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Signal uint32 `protobuf:"varint,2,opt,name=signal,proto3" json:"signal,omitempty"` - All bool `protobuf:"varint,3,opt,name=all,proto3" json:"all,omitempty"` + ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` + Signal uint32 `protobuf:"varint,3,opt,name=signal,proto3" json:"signal,omitempty"` + All bool `protobuf:"varint,4,opt,name=all,proto3" json:"all,omitempty"` } func (m *KillRequest) Reset() { *m = KillRequest{} } @@ -179,8 +186,9 @@ func (*KillRequest) ProtoMessage() {} func (*KillRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{9} } type CloseIORequest struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Stdin bool `protobuf:"varint,2,opt,name=stdin,proto3" json:"stdin,omitempty"` + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` + Stdin bool `protobuf:"varint,3,opt,name=stdin,proto3" json:"stdin,omitempty"` } func (m *CloseIORequest) Reset() { *m = CloseIORequest{} } @@ -204,8 +212,9 @@ func (*PidsResponse) ProtoMessage() {} func (*PidsResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{12} } type CheckpointTaskRequest struct { - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Options *google_protobuf.Any `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"` + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Options *google_protobuf.Any `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` } func (m *CheckpointTaskRequest) Reset() { *m = CheckpointTaskRequest{} } @@ -213,7 +222,8 @@ func (*CheckpointTaskRequest) ProtoMessage() {} func (*CheckpointTaskRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{13} } type UpdateTaskRequest struct { - Resources *google_protobuf.Any `protobuf:"bytes,1,opt,name=resources" json:"resources,omitempty"` + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Resources *google_protobuf.Any `protobuf:"bytes,2,opt,name=resources" json:"resources,omitempty"` } func (m *UpdateTaskRequest) Reset() { *m = UpdateTaskRequest{} } @@ -221,7 +231,8 @@ func (*UpdateTaskRequest) ProtoMessage() {} func (*UpdateTaskRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{14} } type StartRequest struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` } func (m *StartRequest) Reset() { *m = StartRequest{} } @@ -229,8 +240,7 @@ func (*StartRequest) ProtoMessage() {} func (*StartRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{15} } type StartResponse struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"` + Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` } func (m *StartResponse) Reset() { *m = StartResponse{} } @@ -238,7 +248,8 @@ func (*StartResponse) ProtoMessage() {} func (*StartResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{16} } type WaitRequest struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` } func (m *WaitRequest) Reset() { *m = WaitRequest{} } @@ -255,6 +266,7 @@ func (*WaitResponse) ProtoMessage() {} func (*WaitResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{18} } type StatsRequest struct { + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } func (m *StatsRequest) Reset() { *m = StatsRequest{} } @@ -270,6 +282,7 @@ func (*StatsResponse) ProtoMessage() {} func (*StatsResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{20} } type ConnectRequest struct { + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } func (m *ConnectRequest) Reset() { *m = ConnectRequest{} } @@ -287,13 +300,30 @@ func (*ConnectResponse) ProtoMessage() {} func (*ConnectResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{22} } type ShutdownRequest struct { - Now bool `protobuf:"varint,1,opt,name=now,proto3" json:"now,omitempty"` + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Now bool `protobuf:"varint,2,opt,name=now,proto3" json:"now,omitempty"` } func (m *ShutdownRequest) Reset() { *m = ShutdownRequest{} } func (*ShutdownRequest) ProtoMessage() {} func (*ShutdownRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{23} } +type PauseRequest struct { + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *PauseRequest) Reset() { *m = PauseRequest{} } +func (*PauseRequest) ProtoMessage() {} +func (*PauseRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{24} } + +type ResumeRequest struct { + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *ResumeRequest) Reset() { *m = ResumeRequest{} } +func (*ResumeRequest) ProtoMessage() {} +func (*ResumeRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{25} } + func init() { proto.RegisterType((*CreateTaskRequest)(nil), "containerd.task.v2.CreateTaskRequest") proto.RegisterType((*CreateTaskResponse)(nil), "containerd.task.v2.CreateTaskResponse") @@ -319,6 +349,8 @@ func init() { proto.RegisterType((*ConnectRequest)(nil), "containerd.task.v2.ConnectRequest") proto.RegisterType((*ConnectResponse)(nil), "containerd.task.v2.ConnectResponse") proto.RegisterType((*ShutdownRequest)(nil), "containerd.task.v2.ShutdownRequest") + proto.RegisterType((*PauseRequest)(nil), "containerd.task.v2.PauseRequest") + proto.RegisterType((*ResumeRequest)(nil), "containerd.task.v2.ResumeRequest") } func (m *CreateTaskRequest) Marshal() (dAtA []byte, err error) { size := m.Size() @@ -456,6 +488,12 @@ func (m *DeleteRequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) i += copy(dAtA[i:], m.ID) } + if len(m.ExecID) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID))) + i += copy(dAtA[i:], m.ExecID) + } return i, nil } @@ -516,8 +554,14 @@ func (m *ExecProcessRequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) i += copy(dAtA[i:], m.ID) } + if len(m.ExecID) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID))) + i += copy(dAtA[i:], m.ExecID) + } if m.Terminal { - dAtA[i] = 0x10 + dAtA[i] = 0x18 i++ if m.Terminal { dAtA[i] = 1 @@ -527,25 +571,25 @@ func (m *ExecProcessRequest) MarshalTo(dAtA []byte) (int, error) { i++ } if len(m.Stdin) > 0 { - dAtA[i] = 0x1a + dAtA[i] = 0x22 i++ i = encodeVarintShim(dAtA, i, uint64(len(m.Stdin))) i += copy(dAtA[i:], m.Stdin) } if len(m.Stdout) > 0 { - dAtA[i] = 0x22 + dAtA[i] = 0x2a i++ i = encodeVarintShim(dAtA, i, uint64(len(m.Stdout))) i += copy(dAtA[i:], m.Stdout) } if len(m.Stderr) > 0 { - dAtA[i] = 0x2a + dAtA[i] = 0x32 i++ i = encodeVarintShim(dAtA, i, uint64(len(m.Stderr))) i += copy(dAtA[i:], m.Stderr) } if m.Spec != nil { - dAtA[i] = 0x32 + dAtA[i] = 0x3a i++ i = encodeVarintShim(dAtA, i, uint64(m.Spec.Size())) n3, err := m.Spec.MarshalTo(dAtA[i:]) @@ -596,13 +640,19 @@ func (m *ResizePtyRequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) i += copy(dAtA[i:], m.ID) } + if len(m.ExecID) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID))) + i += copy(dAtA[i:], m.ExecID) + } if m.Width != 0 { - dAtA[i] = 0x10 + dAtA[i] = 0x18 i++ i = encodeVarintShim(dAtA, i, uint64(m.Width)) } if m.Height != 0 { - dAtA[i] = 0x18 + dAtA[i] = 0x20 i++ i = encodeVarintShim(dAtA, i, uint64(m.Height)) } @@ -630,6 +680,12 @@ func (m *StateRequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) i += copy(dAtA[i:], m.ID) } + if len(m.ExecID) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID))) + i += copy(dAtA[i:], m.ExecID) + } return i, nil } @@ -735,13 +791,19 @@ func (m *KillRequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) i += copy(dAtA[i:], m.ID) } + if len(m.ExecID) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID))) + i += copy(dAtA[i:], m.ExecID) + } if m.Signal != 0 { - dAtA[i] = 0x10 + dAtA[i] = 0x18 i++ i = encodeVarintShim(dAtA, i, uint64(m.Signal)) } if m.All { - dAtA[i] = 0x18 + dAtA[i] = 0x20 i++ if m.All { dAtA[i] = 1 @@ -774,8 +836,14 @@ func (m *CloseIORequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) i += copy(dAtA[i:], m.ID) } + if len(m.ExecID) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID))) + i += copy(dAtA[i:], m.ExecID) + } if m.Stdin { - dAtA[i] = 0x10 + dAtA[i] = 0x18 i++ if m.Stdin { dAtA[i] = 1 @@ -856,14 +924,20 @@ func (m *CheckpointTaskRequest) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Path) > 0 { + if len(m.ID) > 0 { dAtA[i] = 0xa i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) + i += copy(dAtA[i:], m.ID) + } + if len(m.Path) > 0 { + dAtA[i] = 0x12 + i++ i = encodeVarintShim(dAtA, i, uint64(len(m.Path))) i += copy(dAtA[i:], m.Path) } if m.Options != nil { - dAtA[i] = 0x12 + dAtA[i] = 0x1a i++ i = encodeVarintShim(dAtA, i, uint64(m.Options.Size())) n5, err := m.Options.MarshalTo(dAtA[i:]) @@ -890,9 +964,15 @@ func (m *UpdateTaskRequest) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Resources != nil { + if len(m.ID) > 0 { dAtA[i] = 0xa i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) + i += copy(dAtA[i:], m.ID) + } + if m.Resources != nil { + dAtA[i] = 0x12 + i++ i = encodeVarintShim(dAtA, i, uint64(m.Resources.Size())) n6, err := m.Resources.MarshalTo(dAtA[i:]) if err != nil { @@ -924,6 +1004,12 @@ func (m *StartRequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) i += copy(dAtA[i:], m.ID) } + if len(m.ExecID) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID))) + i += copy(dAtA[i:], m.ExecID) + } return i, nil } @@ -942,14 +1028,8 @@ func (m *StartResponse) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } if m.Pid != 0 { - dAtA[i] = 0x10 + dAtA[i] = 0x8 i++ i = encodeVarintShim(dAtA, i, uint64(m.Pid)) } @@ -977,6 +1057,12 @@ func (m *WaitRequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) i += copy(dAtA[i:], m.ID) } + if len(m.ExecID) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID))) + i += copy(dAtA[i:], m.ExecID) + } return i, nil } @@ -1026,6 +1112,12 @@ func (m *StatsRequest) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) + i += copy(dAtA[i:], m.ID) + } return i, nil } @@ -1072,6 +1164,12 @@ func (m *ConnectRequest) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) + i += copy(dAtA[i:], m.ID) + } return i, nil } @@ -1124,8 +1222,14 @@ func (m *ShutdownRequest) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) + i += copy(dAtA[i:], m.ID) + } if m.Now { - dAtA[i] = 0x8 + dAtA[i] = 0x10 i++ if m.Now { dAtA[i] = 1 @@ -1137,6 +1241,54 @@ func (m *ShutdownRequest) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *PauseRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PauseRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) + i += copy(dAtA[i:], m.ID) + } + return i, nil +} + +func (m *ResumeRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResumeRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) + i += copy(dAtA[i:], m.ID) + } + return i, nil +} + func encodeVarintShim(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -1209,6 +1361,10 @@ func (m *DeleteRequest) Size() (n int) { if l > 0 { n += 1 + l + sovShim(uint64(l)) } + l = len(m.ExecID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } return n } @@ -1233,6 +1389,10 @@ func (m *ExecProcessRequest) Size() (n int) { if l > 0 { n += 1 + l + sovShim(uint64(l)) } + l = len(m.ExecID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } if m.Terminal { n += 2 } @@ -1268,6 +1428,10 @@ func (m *ResizePtyRequest) Size() (n int) { if l > 0 { n += 1 + l + sovShim(uint64(l)) } + l = len(m.ExecID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } if m.Width != 0 { n += 1 + sovShim(uint64(m.Width)) } @@ -1284,6 +1448,10 @@ func (m *StateRequest) Size() (n int) { if l > 0 { n += 1 + l + sovShim(uint64(l)) } + l = len(m.ExecID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } return n } @@ -1334,6 +1502,10 @@ func (m *KillRequest) Size() (n int) { if l > 0 { n += 1 + l + sovShim(uint64(l)) } + l = len(m.ExecID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } if m.Signal != 0 { n += 1 + sovShim(uint64(m.Signal)) } @@ -1350,6 +1522,10 @@ func (m *CloseIORequest) Size() (n int) { if l > 0 { n += 1 + l + sovShim(uint64(l)) } + l = len(m.ExecID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } if m.Stdin { n += 2 } @@ -1381,6 +1557,10 @@ func (m *PidsResponse) Size() (n int) { func (m *CheckpointTaskRequest) Size() (n int) { var l int _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } l = len(m.Path) if l > 0 { n += 1 + l + sovShim(uint64(l)) @@ -1395,6 +1575,10 @@ func (m *CheckpointTaskRequest) Size() (n int) { func (m *UpdateTaskRequest) Size() (n int) { var l int _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } if m.Resources != nil { l = m.Resources.Size() n += 1 + l + sovShim(uint64(l)) @@ -1409,16 +1593,16 @@ func (m *StartRequest) Size() (n int) { if l > 0 { n += 1 + l + sovShim(uint64(l)) } + l = len(m.ExecID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } return n } func (m *StartResponse) Size() (n int) { var l int _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovShim(uint64(l)) - } if m.Pid != 0 { n += 1 + sovShim(uint64(m.Pid)) } @@ -1432,6 +1616,10 @@ func (m *WaitRequest) Size() (n int) { if l > 0 { n += 1 + l + sovShim(uint64(l)) } + l = len(m.ExecID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } return n } @@ -1449,6 +1637,10 @@ func (m *WaitResponse) Size() (n int) { func (m *StatsRequest) Size() (n int) { var l int _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } return n } @@ -1465,6 +1657,10 @@ func (m *StatsResponse) Size() (n int) { func (m *ConnectRequest) Size() (n int) { var l int _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } return n } @@ -1487,12 +1683,36 @@ func (m *ConnectResponse) Size() (n int) { func (m *ShutdownRequest) Size() (n int) { var l int _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } if m.Now { n += 2 } return n } +func (m *PauseRequest) Size() (n int) { + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } + return n +} + +func (m *ResumeRequest) Size() (n int) { + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } + return n +} + func sovShim(x uint64) (n int) { for { n++ @@ -1541,6 +1761,7 @@ func (this *DeleteRequest) String() string { } s := strings.Join([]string{`&DeleteRequest{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`, `}`, }, "") return s @@ -1563,6 +1784,7 @@ func (this *ExecProcessRequest) String() string { } s := strings.Join([]string{`&ExecProcessRequest{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`, `Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`, `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, @@ -1587,6 +1809,7 @@ func (this *ResizePtyRequest) String() string { } s := strings.Join([]string{`&ResizePtyRequest{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`, `Width:` + fmt.Sprintf("%v", this.Width) + `,`, `Height:` + fmt.Sprintf("%v", this.Height) + `,`, `}`, @@ -1599,6 +1822,7 @@ func (this *StateRequest) String() string { } s := strings.Join([]string{`&StateRequest{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`, `}`, }, "") return s @@ -1628,6 +1852,7 @@ func (this *KillRequest) String() string { } s := strings.Join([]string{`&KillRequest{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`, `Signal:` + fmt.Sprintf("%v", this.Signal) + `,`, `All:` + fmt.Sprintf("%v", this.All) + `,`, `}`, @@ -1640,6 +1865,7 @@ func (this *CloseIORequest) String() string { } s := strings.Join([]string{`&CloseIORequest{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`, `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, `}`, }, "") @@ -1670,6 +1896,7 @@ func (this *CheckpointTaskRequest) String() string { return "nil" } s := strings.Join([]string{`&CheckpointTaskRequest{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Path:` + fmt.Sprintf("%v", this.Path) + `,`, `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Any", "google_protobuf.Any", 1) + `,`, `}`, @@ -1681,6 +1908,7 @@ func (this *UpdateTaskRequest) String() string { return "nil" } s := strings.Join([]string{`&UpdateTaskRequest{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Any", "google_protobuf.Any", 1) + `,`, `}`, }, "") @@ -1692,6 +1920,7 @@ func (this *StartRequest) String() string { } s := strings.Join([]string{`&StartRequest{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`, `}`, }, "") return s @@ -1701,7 +1930,6 @@ func (this *StartResponse) String() string { return "nil" } s := strings.Join([]string{`&StartResponse{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, `}`, }, "") @@ -1713,6 +1941,7 @@ func (this *WaitRequest) String() string { } s := strings.Join([]string{`&WaitRequest{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`, `}`, }, "") return s @@ -1733,6 +1962,7 @@ func (this *StatsRequest) String() string { return "nil" } s := strings.Join([]string{`&StatsRequest{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `}`, }, "") return s @@ -1752,6 +1982,7 @@ func (this *ConnectRequest) String() string { return "nil" } s := strings.Join([]string{`&ConnectRequest{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `}`, }, "") return s @@ -1773,11 +2004,32 @@ func (this *ShutdownRequest) String() string { return "nil" } s := strings.Join([]string{`&ShutdownRequest{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Now:` + fmt.Sprintf("%v", this.Now) + `,`, `}`, }, "") return s } +func (this *PauseRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PauseRequest{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `}`, + }, "") + return s +} +func (this *ResumeRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ResumeRequest{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `}`, + }, "") + return s +} func valueToStringShim(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -1793,8 +2045,8 @@ type TaskService interface { Start(ctx context.Context, req *StartRequest) (*StartResponse, error) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error) Pids(ctx context.Context, req *PidsRequest) (*PidsResponse, error) - Pause(ctx context.Context, req *google_protobuf1.Empty) (*google_protobuf1.Empty, error) - Resume(ctx context.Context, req *google_protobuf1.Empty) (*google_protobuf1.Empty, error) + Pause(ctx context.Context, req *PauseRequest) (*google_protobuf1.Empty, error) + Resume(ctx context.Context, req *ResumeRequest) (*google_protobuf1.Empty, error) Checkpoint(ctx context.Context, req *CheckpointTaskRequest) (*google_protobuf1.Empty, error) Kill(ctx context.Context, req *KillRequest) (*google_protobuf1.Empty, error) Exec(ctx context.Context, req *ExecProcessRequest) (*google_protobuf1.Empty, error) @@ -1845,14 +2097,14 @@ func RegisterTaskService(srv *ttrpc.Server, svc TaskService) { return svc.Pids(ctx, &req) }, "Pause": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req google_protobuf1.Empty + var req PauseRequest if err := unmarshal(&req); err != nil { return nil, err } return svc.Pause(ctx, &req) }, "Resume": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req google_protobuf1.Empty + var req ResumeRequest if err := unmarshal(&req); err != nil { return nil, err } @@ -1981,7 +2233,7 @@ func (c *taskClient) Pids(ctx context.Context, req *PidsRequest) (*PidsResponse, return &resp, nil } -func (c *taskClient) Pause(ctx context.Context, req *google_protobuf1.Empty) (*google_protobuf1.Empty, error) { +func (c *taskClient) Pause(ctx context.Context, req *PauseRequest) (*google_protobuf1.Empty, error) { var resp google_protobuf1.Empty if err := c.client.Call(ctx, "containerd.task.v2.Task", "Pause", req, &resp); err != nil { return nil, err @@ -1989,7 +2241,7 @@ func (c *taskClient) Pause(ctx context.Context, req *google_protobuf1.Empty) (*g return &resp, nil } -func (c *taskClient) Resume(ctx context.Context, req *google_protobuf1.Empty) (*google_protobuf1.Empty, error) { +func (c *taskClient) Resume(ctx context.Context, req *ResumeRequest) (*google_protobuf1.Empty, error) { var resp google_protobuf1.Empty if err := c.client.Call(ctx, "containerd.task.v2.Task", "Resume", req, &resp); err != nil { return nil, err @@ -2540,6 +2792,35 @@ func (m *DeleteRequest) Unmarshal(dAtA []byte) error { } m.ID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipShim(dAtA[iNdEx:]) @@ -2738,6 +3019,35 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { m.ID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Terminal", wireType) } @@ -2757,7 +3067,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { } } m.Terminal = bool(v != 0) - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType) } @@ -2786,7 +3096,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { } m.Stdin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType) } @@ -2815,7 +3125,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { } m.Stdout = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType) } @@ -2844,7 +3154,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { } m.Stderr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } @@ -3007,6 +3317,35 @@ func (m *ResizePtyRequest) Unmarshal(dAtA []byte) error { m.ID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Width", wireType) } @@ -3025,7 +3364,7 @@ func (m *ResizePtyRequest) Unmarshal(dAtA []byte) error { break } } - case 3: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } @@ -3123,6 +3462,35 @@ func (m *StateRequest) Unmarshal(dAtA []byte) error { } m.ID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipShim(dAtA[iNdEx:]) @@ -3505,6 +3873,35 @@ func (m *KillRequest) Unmarshal(dAtA []byte) error { m.ID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Signal", wireType) } @@ -3523,7 +3920,7 @@ func (m *KillRequest) Unmarshal(dAtA []byte) error { break } } - case 3: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field All", wireType) } @@ -3623,6 +4020,35 @@ func (m *CloseIORequest) Unmarshal(dAtA []byte) error { m.ID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType) } @@ -3853,6 +4279,35 @@ func (m *CheckpointTaskRequest) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) } @@ -3881,7 +4336,7 @@ func (m *CheckpointTaskRequest) Unmarshal(dAtA []byte) error { } m.Path = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) } @@ -3965,6 +4420,35 @@ func (m *UpdateTaskRequest) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) } @@ -4076,6 +4560,35 @@ func (m *StartRequest) Unmarshal(dAtA []byte) error { } m.ID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipShim(dAtA[iNdEx:]) @@ -4127,35 +4640,6 @@ func (m *StartResponse) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowShim - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthShim - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) } @@ -4253,6 +4737,35 @@ func (m *WaitRequest) Unmarshal(dAtA []byte) error { } m.ID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipShim(dAtA[iNdEx:]) @@ -4402,6 +4915,35 @@ func (m *StatsRequest) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: StatsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipShim(dAtA[iNdEx:]) @@ -4535,6 +5077,35 @@ func (m *ConnectRequest) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: ConnectRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipShim(dAtA[iNdEx:]) @@ -4703,6 +5274,35 @@ func (m *ShutdownRequest) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Now", wireType) } @@ -4743,6 +5343,164 @@ func (m *ShutdownRequest) Unmarshal(dAtA []byte) error { } return nil } +func (m *PauseRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PauseRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PauseRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipShim(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthShim + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResumeRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResumeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResumeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipShim(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthShim + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipShim(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 @@ -4853,80 +5611,83 @@ func init() { } var fileDescriptorShim = []byte{ - // 1189 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4d, 0x6f, 0xdb, 0x46, - 0x13, 0x0e, 0xf5, 0xad, 0x51, 0xe4, 0xd8, 0xfb, 0x3a, 0x79, 0x19, 0x05, 0x90, 0x54, 0xa6, 0x76, - 0xdd, 0x16, 0xa0, 0x50, 0x05, 0xfd, 0x34, 0x90, 0xc2, 0x76, 0x5c, 0xc3, 0xe8, 0x87, 0x0d, 0x26, - 0x45, 0x82, 0xf6, 0x60, 0xd0, 0xe2, 0x5a, 0x22, 0x2c, 0x71, 0x59, 0xee, 0xd2, 0x8e, 0x7b, 0xea, - 0xa9, 0xe7, 0xfe, 0x9c, 0xfe, 0x04, 0x1f, 0x7a, 0x28, 0xd0, 0x4b, 0x4f, 0x69, 0xe3, 0xff, 0xd0, - 0x7b, 0xb1, 0x1f, 0x34, 0x29, 0x99, 0x14, 0xed, 0xa0, 0x17, 0x81, 0xb3, 0xfb, 0xec, 0xec, 0xee, - 0xcc, 0x33, 0xcf, 0x8e, 0x60, 0x7d, 0xe8, 0xb2, 0x51, 0x78, 0x68, 0x0e, 0xc8, 0xa4, 0x37, 0x20, - 0x1e, 0xb3, 0x5d, 0x0f, 0x07, 0x4e, 0xf2, 0x33, 0x08, 0x3d, 0xe6, 0x4e, 0x70, 0xef, 0xa4, 0xdf, - 0x63, 0x36, 0x3d, 0xee, 0xd1, 0x91, 0x3b, 0x31, 0xfd, 0x80, 0x30, 0x82, 0x50, 0x0c, 0x33, 0xf9, - 0x9c, 0x79, 0xd2, 0x6f, 0xdd, 0x1f, 0x12, 0x32, 0x1c, 0xe3, 0x9e, 0x40, 0x1c, 0x86, 0x47, 0x3d, - 0xdb, 0x3b, 0x93, 0xf0, 0xd6, 0x83, 0xd9, 0x29, 0x3c, 0xf1, 0x59, 0x34, 0xb9, 0x3c, 0x24, 0x43, - 0x22, 0x3e, 0x7b,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0xc9, 0xb7, 0xd9, 0x48, 0x1e, 0xc1, 0x12, 0xdf, 0x49, 0x85, - 0x2b, 0x5c, 0x47, 0xe1, 0x76, 0x60, 0xe9, 0x5b, 0xdf, 0x99, 0x79, 0x36, 0xfa, 0x50, 0x0f, 0x30, - 0x25, 0x61, 0x30, 0x10, 0x27, 0xce, 0x76, 0x13, 0xc3, 0x54, 0x91, 0x04, 0x2c, 0x2f, 0x3a, 0x9f, - 0x8a, 0x1a, 0xe1, 0xb8, 0x9c, 0x1a, 0x51, 0xb5, 0x50, 0x88, 0x55, 0x76, 0x05, 0x1a, 0xcf, 0x6d, - 0x37, 0x77, 0x87, 0x00, 0x6e, 0x4b, 0x98, 0xda, 0x60, 0x86, 0xab, 0xda, 0x7c, 0xae, 0x16, 0xde, - 0x88, 0xab, 0x0b, 0x52, 0x22, 0x22, 0x6e, 0x18, 0xeb, 0x52, 0x09, 0x62, 0x12, 0xbc, 0xc7, 0x19, - 0x65, 0xb3, 0xf9, 0xe1, 0x94, 0x10, 0x63, 0x11, 0x16, 0xb6, 0x88, 0xe7, 0xe1, 0x41, 0x74, 0x55, - 0xc3, 0x86, 0x3b, 0x97, 0x23, 0xca, 0xe1, 0x7d, 0xa8, 0xf1, 0xae, 0xe7, 0x20, 0x7e, 0x3b, 0xaa, - 0xdc, 0xde, 0x77, 0x1d, 0x3e, 0xc5, 0x3b, 0x83, 0x83, 0x38, 0x7c, 0x55, 0x6e, 0xf3, 0x29, 0x1d, - 0xaa, 0x27, 0x38, 0xa0, 0x2e, 0x89, 0xd4, 0x3a, 0x32, 0x8d, 0x87, 0x70, 0xe7, 0xe9, 0x28, 0x64, - 0x0e, 0x39, 0xf5, 0xa2, 0x00, 0x2f, 0x42, 0xd1, 0x23, 0xa7, 0xc2, 0x7b, 0xcd, 0xe2, 0x9f, 0xfd, - 0x7f, 0xea, 0x50, 0xe2, 0x44, 0x41, 0x5f, 0x41, 0x59, 0x28, 0x1d, 0x9a, 0x62, 0xb2, 0xea, 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 0x29, 0x5d, 0x55, 0x1a, 0x40, 0xb3, 0x35, 0x80, 0xe6, 0x6a, - 0x40, 0x4c, 0x60, 0x0b, 0xaa, 0x4a, 0xe2, 0x32, 0x02, 0x35, 0xa5, 0x88, 0xad, 0x87, 0x73, 0x31, - 0xca, 0xe7, 0x0e, 0xd4, 0x22, 0x4d, 0x43, 0xa9, 0x0b, 0x66, 0x14, 0x2f, 0x2b, 0x6a, 0x9b, 0x7b, - 0xe7, 0xaf, 0xdb, 0xb7, 0xfe, 0x7c, 0xdd, 0xbe, 0xf5, 0xd3, 0x45, 0x5b, 0x3b, 0xbf, 0x68, 0x6b, - 0xbf, 0x5f, 0xb4, 0xb5, 0xbf, 0x2f, 0xda, 0xda, 0x77, 0x1f, 0xde, 0xf4, 0xbf, 0xea, 0x3a, 0xff, - 0x79, 0x51, 0x38, 0xac, 0x88, 0x2d, 0x1e, 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xd3, 0x2b, 0xdc, - 0xfb, 0xed, 0x0e, 0x00, 0x00, + // 1240 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xdb, 0x6f, 0x1b, 0xc5, + 0x17, 0xee, 0xfa, 0xb2, 0xb6, 0x8f, 0xeb, 0x34, 0x9d, 0x5f, 0x9a, 0xdf, 0xd6, 0x95, 0x6c, 0x77, + 0x4b, 0x83, 0x01, 0xc9, 0x16, 0xae, 0xe0, 0x81, 0x48, 0xa0, 0xdc, 0xa8, 0x4c, 0x0b, 0x89, 0xb6, + 0x45, 0x45, 0xbc, 0x58, 0x1b, 0xef, 0xc4, 0x5e, 0xc5, 0xde, 0x59, 0x76, 0x66, 0x73, 0x41, 0x42, + 0xe2, 0x89, 0x07, 0x9e, 0xf8, 0xb3, 0xf2, 0xc0, 0x03, 0x12, 0x2f, 0xbc, 0x10, 0xa8, 0xff, 0x12, + 0x34, 0x17, 0xc7, 0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7c, 0x0e, 0xf9, 0xb1, 0xa2, 0xa2, 0xd8, 0x05, 0x33, 0x7a, 0x9b, 0x94, + 0xb5, 0xed, 0xfd, 0x8b, 0xb7, 0x95, 0x3b, 0x7f, 0xbd, 0xad, 0xdc, 0xf9, 0x79, 0x54, 0xd1, 0x2e, + 0x46, 0x15, 0xed, 0x8f, 0x51, 0x45, 0xfb, 0x77, 0x54, 0xd1, 0xbe, 0xff, 0xe4, 0xb6, 0xbf, 0x4c, + 0x6c, 0xf2, 0x3f, 0xdf, 0xa5, 0x0e, 0x75, 0xb1, 0xc5, 0xb3, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x11, 0x4c, 0x17, 0x02, 0xdb, 0x10, 0x00, 0x00, } diff --git a/runtime/v2/task/shim.proto b/runtime/v2/task/shim.proto index 4800d4c50..5521ff799 100644 --- a/runtime/v2/task/shim.proto +++ b/runtime/v2/task/shim.proto @@ -21,8 +21,8 @@ service Task { rpc Start(StartRequest) returns (StartResponse); rpc Delete(DeleteRequest) returns (DeleteResponse); rpc Pids(PidsRequest) returns (PidsResponse); - rpc Pause(google.protobuf.Empty) returns (google.protobuf.Empty); - rpc Resume(google.protobuf.Empty) returns (google.protobuf.Empty); + rpc Pause(PauseRequest) returns (google.protobuf.Empty); + rpc Resume(ResumeRequest) returns (google.protobuf.Empty); rpc Checkpoint(CheckpointTaskRequest) returns (google.protobuf.Empty); rpc Kill(KillRequest) returns (google.protobuf.Empty); rpc Exec(ExecProcessRequest) returns (google.protobuf.Empty); @@ -54,6 +54,7 @@ message CreateTaskResponse { message DeleteRequest { string id = 1; + string exec_id = 2; } message DeleteResponse { @@ -64,11 +65,12 @@ message DeleteResponse { message ExecProcessRequest { string id = 1; - bool terminal = 2; - string stdin = 3; - string stdout = 4; - string stderr = 5; - google.protobuf.Any spec = 6; + string exec_id = 2; + bool terminal = 3; + string stdin = 4; + string stdout = 5; + string stderr = 6; + google.protobuf.Any spec = 7; } message ExecProcessResponse { @@ -76,12 +78,14 @@ message ExecProcessResponse { message ResizePtyRequest { string id = 1; - uint32 width = 2; - uint32 height = 3; + string exec_id = 2; + uint32 width = 3; + uint32 height = 4; } message StateRequest { string id = 1; + string exec_id = 2; } message StateResponse { @@ -99,13 +103,15 @@ message StateResponse { message KillRequest { string id = 1; - uint32 signal = 2; - bool all = 3; + string exec_id = 2; + uint32 signal = 3; + bool all = 4; } message CloseIORequest { string id = 1; - bool stdin = 2; + string exec_id = 2; + bool stdin = 3; } message PidsRequest { @@ -117,25 +123,28 @@ message PidsResponse { } message CheckpointTaskRequest { - string path = 1; - google.protobuf.Any options = 2; + string id = 1; + string path = 2; + google.protobuf.Any options = 3; } message UpdateTaskRequest { - google.protobuf.Any resources = 1; + string id = 1; + google.protobuf.Any resources = 2; } message StartRequest { string id = 1; + string exec_id = 2; } message StartResponse { - string id = 1; - uint32 pid = 2; + uint32 pid = 1; } message WaitRequest { string id = 1; + string exec_id = 2; } message WaitResponse { @@ -144,7 +153,7 @@ message WaitResponse { } message StatsRequest { - + string id = 1; } message StatsResponse { @@ -152,7 +161,7 @@ message StatsResponse { } message ConnectRequest { - + string id = 1; } message ConnectResponse { @@ -162,5 +171,14 @@ message ConnectResponse { } message ShutdownRequest { - bool now = 1; + string id = 1; + bool now = 2; +} + +message PauseRequest { + string id = 1; +} + +message ResumeRequest { + string id = 1; } diff --git a/services/tasks/local.go b/services/tasks/local.go index 30290e9f8..d01cdbfc3 100644 --- a/services/tasks/local.go +++ b/services/tasks/local.go @@ -585,9 +585,9 @@ func getTasksMetrics(ctx context.Context, filter filters.Filter, tasks []runtime case "id": return t.ID(), true case "namespace": - // return t.Info().Namespace, true + return t.Namespace(), true case "runtime": - // return t.Info().Runtime, true + // return t.Info().Runtime, true } return "", false })) {