Browse code

daemon: support other containerd runtimes (MVP)

Contrary to popular belief, the OCI Runtime specification does not
specify the command-line API for runtimes. Looking at containerd's
architecture from the lens of the OCI Runtime spec, the _shim_ is the
OCI Runtime and runC is "just" an implementation detail of the
io.containerd.runc.v2 runtime. When one configures a non-default runtime
in Docker, what they're really doing is instructing Docker to create
containers using the io.containerd.runc.v2 runtime with a configuration
option telling the runtime that the runC binary is at some non-default
path. Consequently, only OCI runtimes which are compatible with the
io.containerd.runc.v2 shim, such as crun, can be used in this manner.
Other OCI runtimes, including kata-containers v2, come with their own
containerd shim and are not compatible with io.containerd.runc.v2.
As Docker has not historically provided a way to select a non-default
runtime which requires its own shim, runtimes such as kata-containers v2
could not be used with Docker.

Allow other containerd shims to be used with Docker; no daemon
configuration required. If the daemon is instructed to create a
container with a runtime name which does not match any of the configured
or stock runtimes, it passes the name along to containerd verbatim. A
user can start a container with the kata-containers runtime, for
example, simply by calling

docker run --runtime io.containerd.kata.v2

Runtime names which containerd would interpret as a path to an arbitrary
binary are disallowed. While handy for development and testing it is not
strictly necessary and would allow anyone with Engine API access to
trivially execute any binary on the host as root, so we have decided it
would be safest for our users if it was not allowed.

It is not yet possible to set an alternative containerd shim as the
default runtime; it can only be configured per-container.

Signed-off-by: Cory Snider <csnider@mirantis.com>

Cory Snider authored on 2022/07/21 05:12:01
Showing 29 changed files
... ...
@@ -707,8 +707,8 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes.
707 707
 		hostConfig.Runtime = daemon.configStore.GetDefaultRuntimeName()
708 708
 	}
709 709
 
710
-	if rt := daemon.configStore.GetRuntime(hostConfig.Runtime); rt == nil {
711
-		return warnings, fmt.Errorf("Unknown runtime specified %s", hostConfig.Runtime)
710
+	if _, err := daemon.getRuntime(hostConfig.Runtime); err != nil {
711
+		return warnings, err
712 712
 	}
713 713
 
714 714
 	parser := volumemounts.NewParser()
... ...
@@ -11,6 +11,7 @@ import (
11 11
 	"strings"
12 12
 
13 13
 	v2runcoptions "github.com/containerd/containerd/runtime/v2/runc/options"
14
+	"github.com/containerd/containerd/runtime/v2/shim"
14 15
 	"github.com/docker/docker/api/types"
15 16
 	"github.com/docker/docker/daemon/config"
16 17
 	"github.com/docker/docker/errdefs"
... ...
@@ -116,7 +117,10 @@ func (daemon *Daemon) rewriteRuntimePath(name, p string, args []string) (string,
116 116
 func (daemon *Daemon) getRuntime(name string) (*types.Runtime, error) {
117 117
 	rt := daemon.configStore.GetRuntime(name)
118 118
 	if rt == nil {
119
-		return nil, errdefs.InvalidParameter(errors.Errorf("runtime not found in config: %s", name))
119
+		if !isPermissibleC8dRuntimeName(name) {
120
+			return nil, errdefs.InvalidParameter(errors.Errorf("unknown or invalid runtime name: %s", name))
121
+		}
122
+		return &types.Runtime{Shim: &types.ShimConfig{Binary: name}}, nil
120 123
 	}
121 124
 
122 125
 	if len(rt.Args) > 0 {
... ...
@@ -134,3 +138,37 @@ func (daemon *Daemon) getRuntime(name string) (*types.Runtime, error) {
134 134
 
135 135
 	return rt, nil
136 136
 }
137
+
138
+// isPermissibleC8dRuntimeName tests whether name is safe to pass into
139
+// containerd as a runtime name, and whether the name is well-formed.
140
+// It does not check if the runtime is installed.
141
+//
142
+// A runtime name containing slash characters is interpreted by containerd as
143
+// the path to a runtime binary. If we allowed this, anyone with Engine API
144
+// access could get containerd to execute an arbitrary binary as root. Although
145
+// Engine API access is already equivalent to root on the host, the runtime name
146
+// has not historically been a vector to run arbitrary code as root so users are
147
+// not expecting it to become one.
148
+//
149
+// This restriction is not configurable. There are viable workarounds for
150
+// legitimate use cases: administrators and runtime developers can make runtimes
151
+// available for use with Docker by installing them onto PATH following the
152
+// [binary naming convention] for containerd Runtime v2.
153
+//
154
+// [binary naming convention]: https://github.com/containerd/containerd/blob/main/runtime/v2/README.md#binary-naming
155
+func isPermissibleC8dRuntimeName(name string) bool {
156
+	// containerd uses a rather permissive test to validate runtime names:
157
+	//
158
+	//   - Any name for which filepath.IsAbs(name) is interpreted as the absolute
159
+	//     path to a shim binary. We want to block this behaviour.
160
+	//   - Any name which contains at least one '.' character and no '/' characters
161
+	//     and does not begin with a '.' character is a valid runtime name. The shim
162
+	//     binary name is derived from the final two components of the name and
163
+	//     searched for on the PATH. The name "a.." is technically valid per
164
+	//     containerd's implementation: it would resolve to a binary named
165
+	//     "containerd-shim---".
166
+	//
167
+	// https://github.com/containerd/containerd/blob/11ded166c15f92450958078cd13c6d87131ec563/runtime/v2/manager.go#L297-L317
168
+	// https://github.com/containerd/containerd/blob/11ded166c15f92450958078cd13c6d87131ec563/runtime/v2/shim/util.go#L83-L93
169
+	return !filepath.IsAbs(name) && !strings.ContainsRune(name, '/') && shim.BinaryName(name) != ""
170
+}
137 171
new file mode 100644
... ...
@@ -0,0 +1,107 @@
0
+//go:build !windows
1
+// +build !windows
2
+
3
+package daemon
4
+
5
+import (
6
+	"os"
7
+	"path/filepath"
8
+	"testing"
9
+
10
+	v2runcoptions "github.com/containerd/containerd/runtime/v2/runc/options"
11
+	"gotest.tools/v3/assert"
12
+	is "gotest.tools/v3/assert/cmp"
13
+
14
+	"github.com/docker/docker/api/types"
15
+	"github.com/docker/docker/daemon/config"
16
+	"github.com/docker/docker/errdefs"
17
+)
18
+
19
+func TestGetRuntime(t *testing.T) {
20
+	// Configured runtimes can have any arbitrary name, including names
21
+	// which would not be allowed as implicit runtime names. Explicit takes
22
+	// precedence over implicit.
23
+	const configuredRtName = "my/custom.shim.v1"
24
+	configuredRuntime := types.Runtime{Path: "/bin/true"}
25
+
26
+	d := &Daemon{configStore: config.New()}
27
+	d.configStore.Root = t.TempDir()
28
+	assert.Assert(t, os.Mkdir(filepath.Join(d.configStore.Root, "runtimes"), 0700))
29
+	d.configStore.Runtimes = map[string]types.Runtime{
30
+		configuredRtName: configuredRuntime,
31
+	}
32
+	configureRuntimes(d.configStore)
33
+	assert.Assert(t, d.loadRuntimes())
34
+
35
+	stockRuntime, ok := d.configStore.Runtimes[config.StockRuntimeName]
36
+	assert.Assert(t, ok, "stock runtime could not be found (test needs to be updated)")
37
+
38
+	configdOpts := *stockRuntime.Shim.Opts.(*v2runcoptions.Options)
39
+	configdOpts.BinaryName = configuredRuntime.Path
40
+	wantConfigdRuntime := configuredRuntime
41
+	wantConfigdRuntime.Shim = &types.ShimConfig{
42
+		Binary: stockRuntime.Shim.Binary,
43
+		Opts:   &configdOpts,
44
+	}
45
+
46
+	for _, tt := range []struct {
47
+		name, runtime string
48
+		want          *types.Runtime
49
+	}{
50
+		{
51
+			name:    "StockRuntime",
52
+			runtime: config.StockRuntimeName,
53
+			want:    &stockRuntime,
54
+		},
55
+		{
56
+			name:    "ShimName",
57
+			runtime: "io.containerd.my-shim.v42",
58
+			want:    &types.Runtime{Shim: &types.ShimConfig{Binary: "io.containerd.my-shim.v42"}},
59
+		},
60
+		{
61
+			// containerd is pretty loose about the format of runtime names. Perhaps too
62
+			// loose. The only requirements are that the name contain a dot and (depending
63
+			// on the containerd version) not start with a dot. It does not enforce any
64
+			// particular format of the dot-delimited components of the name.
65
+			name:    "VersionlessShimName",
66
+			runtime: "io.containerd.my-shim",
67
+			want:    &types.Runtime{Shim: &types.ShimConfig{Binary: "io.containerd.my-shim"}},
68
+		},
69
+		{
70
+			name:    "IllformedShimName",
71
+			runtime: "myshim",
72
+		},
73
+		{
74
+			name:    "EmptyString",
75
+			runtime: "",
76
+		},
77
+		{
78
+			name:    "PathToShim",
79
+			runtime: "/path/to/runc",
80
+		},
81
+		{
82
+			name:    "PathToShimName",
83
+			runtime: "/path/to/io.containerd.runc.v2",
84
+		},
85
+		{
86
+			name:    "RelPathToShim",
87
+			runtime: "my/io.containerd.runc.v2",
88
+		},
89
+		{
90
+			name:    "ConfiguredRuntime",
91
+			runtime: configuredRtName,
92
+			want:    &wantConfigdRuntime,
93
+		},
94
+	} {
95
+		tt := tt
96
+		t.Run(tt.name, func(t *testing.T) {
97
+			got, err := d.getRuntime(tt.runtime)
98
+			assert.Check(t, is.DeepEqual(got, tt.want))
99
+			if tt.want != nil {
100
+				assert.Check(t, err)
101
+			} else {
102
+				assert.Check(t, errdefs.IsInvalidParameter(err))
103
+			}
104
+		})
105
+	}
106
+}
... ...
@@ -39,6 +39,7 @@ import (
39 39
 	"github.com/moby/sys/mount"
40 40
 	"golang.org/x/sys/unix"
41 41
 	"gotest.tools/v3/assert"
42
+	is "gotest.tools/v3/assert/cmp"
42 43
 	"gotest.tools/v3/icmd"
43 44
 	"gotest.tools/v3/poll"
44 45
 )
... ...
@@ -2384,7 +2385,7 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromConfigFile(c *testing.T) {
2384 2384
 	// Run with "vm"
2385 2385
 	out, err = s.d.Cmd("run", "--rm", "--runtime=vm", "busybox", "ls")
2386 2386
 	assert.ErrorContains(c, err, "", out)
2387
-	assert.Assert(c, strings.Contains(out, "/usr/local/bin/vm-manager: no such file or directory"))
2387
+	assert.Assert(c, is.Contains(out, "/usr/local/bin/vm-manager: no such file or directory"))
2388 2388
 	// Reset config to only have the default
2389 2389
 	config = `
2390 2390
 {
... ...
@@ -2404,11 +2405,11 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromConfigFile(c *testing.T) {
2404 2404
 	// Run with "oci"
2405 2405
 	out, err = s.d.Cmd("run", "--rm", "--runtime=oci", "busybox", "ls")
2406 2406
 	assert.ErrorContains(c, err, "", out)
2407
-	assert.Assert(c, strings.Contains(out, "Unknown runtime specified oci"))
2407
+	assert.Assert(c, is.Contains(out, "unknown or invalid runtime name: oci"))
2408 2408
 	// Start previously created container with oci
2409 2409
 	out, err = s.d.Cmd("start", "oci-runtime-ls")
2410 2410
 	assert.ErrorContains(c, err, "", out)
2411
-	assert.Assert(c, strings.Contains(out, "Unknown runtime specified oci"))
2411
+	assert.Assert(c, is.Contains(out, "unknown or invalid runtime name: oci"))
2412 2412
 	// Check that we can't override the default runtime
2413 2413
 	config = `
2414 2414
 {
... ...
@@ -2426,7 +2427,7 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromConfigFile(c *testing.T) {
2426 2426
 
2427 2427
 	content, err := s.d.ReadLogFile()
2428 2428
 	assert.NilError(c, err)
2429
-	assert.Assert(c, strings.Contains(string(content), `file configuration validation failed: runtime name 'runc' is reserved`))
2429
+	assert.Assert(c, is.Contains(string(content), `file configuration validation failed: runtime name 'runc' is reserved`))
2430 2430
 	// Check that we can select a default runtime
2431 2431
 	config = `
2432 2432
 {
... ...
@@ -2451,7 +2452,7 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromConfigFile(c *testing.T) {
2451 2451
 
2452 2452
 	out, err = s.d.Cmd("run", "--rm", "busybox", "ls")
2453 2453
 	assert.ErrorContains(c, err, "", out)
2454
-	assert.Assert(c, strings.Contains(out, "/usr/local/bin/vm-manager: no such file or directory"))
2454
+	assert.Assert(c, is.Contains(out, "/usr/local/bin/vm-manager: no such file or directory"))
2455 2455
 	// Run with default runtime explicitly
2456 2456
 	out, err = s.d.Cmd("run", "--rm", "--runtime=runc", "busybox", "ls")
2457 2457
 	assert.NilError(c, err, out)
... ...
@@ -2475,7 +2476,7 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromCommandLine(c *testing.T) {
2475 2475
 	// Run with "vm"
2476 2476
 	out, err = s.d.Cmd("run", "--rm", "--runtime=vm", "busybox", "ls")
2477 2477
 	assert.ErrorContains(c, err, "", out)
2478
-	assert.Assert(c, strings.Contains(out, "/usr/local/bin/vm-manager: no such file or directory"))
2478
+	assert.Assert(c, is.Contains(out, "/usr/local/bin/vm-manager: no such file or directory"))
2479 2479
 	// Start a daemon without any extra runtimes
2480 2480
 	s.d.Stop(c)
2481 2481
 	s.d.StartWithBusybox(c)
... ...
@@ -2487,25 +2488,25 @@ func (s *DockerDaemonSuite) TestRunWithRuntimeFromCommandLine(c *testing.T) {
2487 2487
 	// Run with "oci"
2488 2488
 	out, err = s.d.Cmd("run", "--rm", "--runtime=oci", "busybox", "ls")
2489 2489
 	assert.ErrorContains(c, err, "", out)
2490
-	assert.Assert(c, strings.Contains(out, "Unknown runtime specified oci"))
2490
+	assert.Assert(c, is.Contains(out, "unknown or invalid runtime name: oci"))
2491 2491
 	// Start previously created container with oci
2492 2492
 	out, err = s.d.Cmd("start", "oci-runtime-ls")
2493 2493
 	assert.ErrorContains(c, err, "", out)
2494
-	assert.Assert(c, strings.Contains(out, "Unknown runtime specified oci"))
2494
+	assert.Assert(c, is.Contains(out, "unknown or invalid runtime name: oci"))
2495 2495
 	// Check that we can't override the default runtime
2496 2496
 	s.d.Stop(c)
2497 2497
 	assert.Assert(c, s.d.StartWithError("--add-runtime", "runc=my-runc") != nil)
2498 2498
 
2499 2499
 	content, err := s.d.ReadLogFile()
2500 2500
 	assert.NilError(c, err)
2501
-	assert.Assert(c, strings.Contains(string(content), `runtime name 'runc' is reserved`))
2501
+	assert.Assert(c, is.Contains(string(content), `runtime name 'runc' is reserved`))
2502 2502
 	// Check that we can select a default runtime
2503 2503
 	s.d.Stop(c)
2504 2504
 	s.d.StartWithBusybox(c, "--default-runtime=vm", "--add-runtime", "oci=runc", "--add-runtime", "vm=/usr/local/bin/vm-manager")
2505 2505
 
2506 2506
 	out, err = s.d.Cmd("run", "--rm", "busybox", "ls")
2507 2507
 	assert.ErrorContains(c, err, "", out)
2508
-	assert.Assert(c, strings.Contains(out, "/usr/local/bin/vm-manager: no such file or directory"))
2508
+	assert.Assert(c, is.Contains(out, "/usr/local/bin/vm-manager: no such file or directory"))
2509 2509
 	// Run with default runtime explicitly
2510 2510
 	out, err = s.d.Cmd("run", "--rm", "--runtime=runc", "busybox", "ls")
2511 2511
 	assert.NilError(c, err, out)
... ...
@@ -5,6 +5,7 @@ import (
5 5
 	"context"
6 6
 	"io"
7 7
 	"os"
8
+	"os/exec"
8 9
 	"path/filepath"
9 10
 	"strings"
10 11
 	"testing"
... ...
@@ -15,7 +16,9 @@ import (
15 15
 	"github.com/docker/docker/api/types/versions"
16 16
 	"github.com/docker/docker/integration/internal/container"
17 17
 	net "github.com/docker/docker/integration/internal/network"
18
+	"github.com/docker/docker/pkg/stdcopy"
18 19
 	"github.com/docker/docker/pkg/system"
20
+	"github.com/docker/docker/testutil/daemon"
19 21
 	"golang.org/x/sys/unix"
20 22
 	"gotest.tools/v3/assert"
21 23
 	is "gotest.tools/v3/assert/cmp"
... ...
@@ -214,3 +217,57 @@ func TestRunConsoleSize(t *testing.T) {
214 214
 
215 215
 	assert.Equal(t, strings.TrimSpace(b.String()), "123 57")
216 216
 }
217
+
218
+func TestRunWithAlternativeContainerdShim(t *testing.T) {
219
+	skip.If(t, testEnv.IsRemoteDaemon)
220
+	skip.If(t, testEnv.DaemonInfo.OSType != "linux")
221
+
222
+	realShimPath, err := exec.LookPath("containerd-shim-runc-v2")
223
+	assert.Assert(t, err)
224
+	realShimPath, err = filepath.Abs(realShimPath)
225
+	assert.Assert(t, err)
226
+
227
+	// t.TempDir() can't be used here as the temporary directory returned by
228
+	// that function cannot be accessed by the fake-root user for rootless
229
+	// Docker. It creates a nested hierarchy of directories where the
230
+	// outermost has permission 0700.
231
+	shimDir, err := os.MkdirTemp("", t.Name())
232
+	assert.Assert(t, err)
233
+	t.Cleanup(func() {
234
+		if err := os.RemoveAll(shimDir); err != nil {
235
+			t.Errorf("shimDir RemoveAll cleanup: %v", err)
236
+		}
237
+	})
238
+	assert.Assert(t, os.Chmod(shimDir, 0777))
239
+	shimDir, err = filepath.Abs(shimDir)
240
+	assert.Assert(t, err)
241
+	assert.Assert(t, os.Symlink(realShimPath, filepath.Join(shimDir, "containerd-shim-realfake-v42")))
242
+
243
+	d := daemon.New(t,
244
+		daemon.WithEnvVars("PATH="+shimDir+":"+os.Getenv("PATH")),
245
+		daemon.WithContainerdSocket(""), // A new containerd instance needs to be started which inherits the PATH env var defined above.
246
+	)
247
+	d.StartWithBusybox(t)
248
+	defer d.Stop(t)
249
+
250
+	client := d.NewClientT(t)
251
+	ctx := context.Background()
252
+
253
+	cID := container.Run(ctx, t, client,
254
+		container.WithImage("busybox"),
255
+		container.WithCmd("sh", "-c", `echo 'Hello, world!'`),
256
+		container.WithRuntime("io.containerd.realfake.v42"),
257
+	)
258
+
259
+	poll.WaitOn(t, container.IsStopped(ctx, client, cID), poll.WithDelay(100*time.Millisecond))
260
+
261
+	out, err := client.ContainerLogs(ctx, cID, types.ContainerLogsOptions{ShowStdout: true})
262
+	assert.NilError(t, err)
263
+	defer out.Close()
264
+
265
+	var b bytes.Buffer
266
+	_, err = stdcopy.StdCopy(&b, io.Discard, out)
267
+	assert.NilError(t, err)
268
+
269
+	assert.Equal(t, strings.TrimSpace(b.String()), "Hello, world!")
270
+}
... ...
@@ -234,3 +234,10 @@ func WithConsoleSize(width, height uint) func(*TestContainerConfig) {
234 234
 		c.HostConfig.ConsoleSize = [2]uint{height, width}
235 235
 	}
236 236
 }
237
+
238
+// WithRuntime sets the runtime to use to start the container
239
+func WithRuntime(name string) func(*TestContainerConfig) {
240
+	return func(c *TestContainerConfig) {
241
+		c.HostConfig.Runtime = name
242
+	}
243
+}
... ...
@@ -76,6 +76,7 @@ type Daemon struct {
76 76
 	log                        LogT
77 77
 	pidFile                    string
78 78
 	args                       []string
79
+	extraEnv                   []string
79 80
 	containerdSocket           string
80 81
 	rootlessUser               *user.User
81 82
 	rootlessXDGRuntimeDir      string
... ...
@@ -334,9 +335,10 @@ func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error {
334 334
 		dockerdBinary = "sudo"
335 335
 		d.args = append(d.args,
336 336
 			"-u", d.rootlessUser.Username,
337
-			"-E", "XDG_RUNTIME_DIR="+d.rootlessXDGRuntimeDir,
338
-			"-E", "HOME="+d.rootlessUser.HomeDir,
339
-			"-E", "PATH="+os.Getenv("PATH"),
337
+			"--preserve-env",
338
+			"--preserve-env=PATH", // Pass through PATH, overriding secure_path.
339
+			"XDG_RUNTIME_DIR="+d.rootlessXDGRuntimeDir,
340
+			"HOME="+d.rootlessUser.HomeDir,
340 341
 			"--",
341 342
 			defaultDockerdRootlessBinary,
342 343
 		)
... ...
@@ -392,6 +394,7 @@ func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error {
392 392
 	d.args = append(d.args, providedArgs...)
393 393
 	d.cmd = exec.Command(dockerdBinary, d.args...)
394 394
 	d.cmd.Env = append(os.Environ(), "DOCKER_SERVICE_PREFER_OFFLINE_IMAGE=1")
395
+	d.cmd.Env = append(d.cmd.Env, d.extraEnv...)
395 396
 	d.cmd.Stdout = out
396 397
 	d.cmd.Stderr = out
397 398
 	d.logFile = out
... ...
@@ -122,3 +122,10 @@ func WithOOMScoreAdjust(score int) Option {
122 122
 		d.OOMScoreAdjust = score
123 123
 	}
124 124
 }
125
+
126
+// WithEnvVars sets additional environment variables for the daemon
127
+func WithEnvVars(vars ...string) Option {
128
+	return func(d *Daemon) {
129
+		d.extraEnv = append(d.extraEnv, vars...)
130
+	}
131
+}
125 132
new file mode 100644
... ...
@@ -0,0 +1,18 @@
0
+/*
1
+   Copyright The containerd Authors.
2
+
3
+   Licensed under the Apache License, Version 2.0 (the "License");
4
+   you may not use this file except in compliance with the License.
5
+   You may obtain a copy of the License at
6
+
7
+       http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+   Unless required by applicable law or agreed to in writing, software
10
+   distributed under the License is distributed on an "AS IS" BASIS,
11
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+   See the License for the specific language governing permissions and
13
+   limitations under the License.
14
+*/
15
+
16
+// Package events defines the ttrpc event service.
17
+package events
0 18
new file mode 100644
... ...
@@ -0,0 +1,760 @@
0
+// Code generated by protoc-gen-gogo. DO NOT EDIT.
1
+// source: github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto
2
+
3
+package events
4
+
5
+import (
6
+	context "context"
7
+	fmt "fmt"
8
+	github_com_containerd_ttrpc "github.com/containerd/ttrpc"
9
+	github_com_containerd_typeurl "github.com/containerd/typeurl"
10
+	proto "github.com/gogo/protobuf/proto"
11
+	github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
12
+	types "github.com/gogo/protobuf/types"
13
+	io "io"
14
+	math "math"
15
+	math_bits "math/bits"
16
+	reflect "reflect"
17
+	strings "strings"
18
+	time "time"
19
+)
20
+
21
+// Reference imports to suppress errors if they are not otherwise used.
22
+var _ = proto.Marshal
23
+var _ = fmt.Errorf
24
+var _ = math.Inf
25
+var _ = time.Kitchen
26
+
27
+// This is a compile-time assertion to ensure that this generated file
28
+// is compatible with the proto package it is being compiled against.
29
+// A compilation error at this line likely means your copy of the
30
+// proto package needs to be updated.
31
+const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
32
+
33
+type ForwardRequest struct {
34
+	Envelope             *Envelope `protobuf:"bytes,1,opt,name=envelope,proto3" json:"envelope,omitempty"`
35
+	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
36
+	XXX_unrecognized     []byte    `json:"-"`
37
+	XXX_sizecache        int32     `json:"-"`
38
+}
39
+
40
+func (m *ForwardRequest) Reset()      { *m = ForwardRequest{} }
41
+func (*ForwardRequest) ProtoMessage() {}
42
+func (*ForwardRequest) Descriptor() ([]byte, []int) {
43
+	return fileDescriptor_19f98672016720b5, []int{0}
44
+}
45
+func (m *ForwardRequest) XXX_Unmarshal(b []byte) error {
46
+	return m.Unmarshal(b)
47
+}
48
+func (m *ForwardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
49
+	if deterministic {
50
+		return xxx_messageInfo_ForwardRequest.Marshal(b, m, deterministic)
51
+	} else {
52
+		b = b[:cap(b)]
53
+		n, err := m.MarshalToSizedBuffer(b)
54
+		if err != nil {
55
+			return nil, err
56
+		}
57
+		return b[:n], nil
58
+	}
59
+}
60
+func (m *ForwardRequest) XXX_Merge(src proto.Message) {
61
+	xxx_messageInfo_ForwardRequest.Merge(m, src)
62
+}
63
+func (m *ForwardRequest) XXX_Size() int {
64
+	return m.Size()
65
+}
66
+func (m *ForwardRequest) XXX_DiscardUnknown() {
67
+	xxx_messageInfo_ForwardRequest.DiscardUnknown(m)
68
+}
69
+
70
+var xxx_messageInfo_ForwardRequest proto.InternalMessageInfo
71
+
72
+type Envelope struct {
73
+	Timestamp            time.Time  `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
74
+	Namespace            string     `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
75
+	Topic                string     `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"`
76
+	Event                *types.Any `protobuf:"bytes,4,opt,name=event,proto3" json:"event,omitempty"`
77
+	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
78
+	XXX_unrecognized     []byte     `json:"-"`
79
+	XXX_sizecache        int32      `json:"-"`
80
+}
81
+
82
+func (m *Envelope) Reset()      { *m = Envelope{} }
83
+func (*Envelope) ProtoMessage() {}
84
+func (*Envelope) Descriptor() ([]byte, []int) {
85
+	return fileDescriptor_19f98672016720b5, []int{1}
86
+}
87
+func (m *Envelope) XXX_Unmarshal(b []byte) error {
88
+	return m.Unmarshal(b)
89
+}
90
+func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
91
+	if deterministic {
92
+		return xxx_messageInfo_Envelope.Marshal(b, m, deterministic)
93
+	} else {
94
+		b = b[:cap(b)]
95
+		n, err := m.MarshalToSizedBuffer(b)
96
+		if err != nil {
97
+			return nil, err
98
+		}
99
+		return b[:n], nil
100
+	}
101
+}
102
+func (m *Envelope) XXX_Merge(src proto.Message) {
103
+	xxx_messageInfo_Envelope.Merge(m, src)
104
+}
105
+func (m *Envelope) XXX_Size() int {
106
+	return m.Size()
107
+}
108
+func (m *Envelope) XXX_DiscardUnknown() {
109
+	xxx_messageInfo_Envelope.DiscardUnknown(m)
110
+}
111
+
112
+var xxx_messageInfo_Envelope proto.InternalMessageInfo
113
+
114
+func init() {
115
+	proto.RegisterType((*ForwardRequest)(nil), "containerd.services.events.ttrpc.v1.ForwardRequest")
116
+	proto.RegisterType((*Envelope)(nil), "containerd.services.events.ttrpc.v1.Envelope")
117
+}
118
+
119
+func init() {
120
+	proto.RegisterFile("github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto", fileDescriptor_19f98672016720b5)
121
+}
122
+
123
+var fileDescriptor_19f98672016720b5 = []byte{
124
+	// 396 bytes of a gzipped FileDescriptorProto
125
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x52, 0xc1, 0x8e, 0xd3, 0x30,
126
+	0x10, 0x8d, 0x61, 0x77, 0x69, 0x8d, 0xc4, 0xc1, 0xaa, 0x50, 0x08, 0x28, 0x59, 0x2d, 0x97, 0x15,
127
+	0x12, 0xb6, 0x76, 0xf7, 0x06, 0x17, 0xa8, 0x28, 0x12, 0x1c, 0x23, 0x84, 0x2a, 0x90, 0x10, 0x6e,
128
+	0x3a, 0x4d, 0x2d, 0x25, 0xb6, 0x49, 0x9c, 0xa0, 0xde, 0xfa, 0x09, 0x7c, 0x0c, 0x17, 0xfe, 0xa0,
129
+	0x47, 0x8e, 0x9c, 0x80, 0xe6, 0x4b, 0x50, 0x9d, 0xa4, 0x81, 0xf6, 0x40, 0xa5, 0xbd, 0xbd, 0xcc,
130
+	0x7b, 0x6f, 0xde, 0xcc, 0xc4, 0xf8, 0x75, 0x2c, 0xcc, 0xbc, 0x98, 0xd0, 0x48, 0xa5, 0x2c, 0x52,
131
+	0xd2, 0x70, 0x21, 0x21, 0x9b, 0xfe, 0x0d, 0xb9, 0x16, 0x2c, 0x87, 0xac, 0x14, 0x11, 0xe4, 0xcc,
132
+	0x98, 0x4c, 0x47, 0x0c, 0x4a, 0x90, 0x26, 0x67, 0xe5, 0x45, 0x83, 0xa8, 0xce, 0x94, 0x51, 0xe4,
133
+	0x61, 0xe7, 0xa2, 0xad, 0x83, 0x36, 0x0a, 0x6b, 0xa4, 0xe5, 0x85, 0xf7, 0xec, 0xbf, 0x81, 0xb6,
134
+	0xd9, 0xa4, 0x98, 0x31, 0x9d, 0x14, 0xb1, 0x90, 0x6c, 0x26, 0x20, 0x99, 0x6a, 0x6e, 0xe6, 0x75,
135
+	0x8c, 0x37, 0x88, 0x55, 0xac, 0x2c, 0x64, 0x1b, 0xd4, 0x54, 0xef, 0xc5, 0x4a, 0xc5, 0x09, 0x74,
136
+	0x6e, 0x2e, 0x17, 0x0d, 0x75, 0x7f, 0x97, 0x82, 0x54, 0x9b, 0x96, 0x0c, 0x76, 0x49, 0x23, 0x52,
137
+	0xc8, 0x0d, 0x4f, 0x75, 0x2d, 0x38, 0x7b, 0x8f, 0xef, 0xbc, 0x54, 0xd9, 0x67, 0x9e, 0x4d, 0x43,
138
+	0xf8, 0x54, 0x40, 0x6e, 0xc8, 0x2b, 0xdc, 0x03, 0x59, 0x42, 0xa2, 0x34, 0xb8, 0xe8, 0x14, 0x9d,
139
+	0xdf, 0xbe, 0x7c, 0x4c, 0x0f, 0x58, 0x9d, 0x8e, 0x1a, 0x53, 0xb8, 0xb5, 0x9f, 0x7d, 0x45, 0xb8,
140
+	0xd7, 0x96, 0xc9, 0x10, 0xf7, 0xb7, 0xe1, 0x4d, 0x63, 0x8f, 0xd6, 0xe3, 0xd1, 0x76, 0x3c, 0xfa,
141
+	0xa6, 0x55, 0x0c, 0x7b, 0xab, 0x9f, 0x81, 0xf3, 0xe5, 0x57, 0x80, 0xc2, 0xce, 0x46, 0x1e, 0xe0,
142
+	0xbe, 0xe4, 0x29, 0xe4, 0x9a, 0x47, 0xe0, 0xde, 0x38, 0x45, 0xe7, 0xfd, 0xb0, 0x2b, 0x90, 0x01,
143
+	0x3e, 0x36, 0x4a, 0x8b, 0xc8, 0xbd, 0x69, 0x99, 0xfa, 0x83, 0x3c, 0xc2, 0xc7, 0x76, 0x54, 0xf7,
144
+	0xc8, 0x66, 0x0e, 0xf6, 0x32, 0x9f, 0xcb, 0x45, 0x58, 0x4b, 0x9e, 0x1c, 0x2d, 0xbf, 0x05, 0xe8,
145
+	0xf2, 0x23, 0x3e, 0x19, 0xd9, 0xe5, 0xc8, 0x5b, 0x7c, 0xab, 0xb9, 0x0e, 0xb9, 0x3a, 0xe8, 0x08,
146
+	0xff, 0xde, 0xd2, 0xbb, 0xbb, 0x17, 0x36, 0xda, 0xfc, 0x9c, 0xe1, 0x87, 0xd5, 0xda, 0x77, 0x7e,
147
+	0xac, 0x7d, 0x67, 0x59, 0xf9, 0x68, 0x55, 0xf9, 0xe8, 0x7b, 0xe5, 0xa3, 0xdf, 0x95, 0x8f, 0xde,
148
+	0xbd, 0xb8, 0xd6, 0x8b, 0x7d, 0x5a, 0xa3, 0xb1, 0x33, 0x46, 0x93, 0x13, 0x9b, 0x79, 0xf5, 0x27,
149
+	0x00, 0x00, 0xff, 0xff, 0xd4, 0x90, 0xbd, 0x09, 0x04, 0x03, 0x00, 0x00,
150
+}
151
+
152
+// Field returns the value for the given fieldpath as a string, if defined.
153
+// If the value is not defined, the second value will be false.
154
+func (m *Envelope) Field(fieldpath []string) (string, bool) {
155
+	if len(fieldpath) == 0 {
156
+		return "", false
157
+	}
158
+
159
+	switch fieldpath[0] {
160
+	// unhandled: timestamp
161
+	case "namespace":
162
+		return string(m.Namespace), len(m.Namespace) > 0
163
+	case "topic":
164
+		return string(m.Topic), len(m.Topic) > 0
165
+	case "event":
166
+		decoded, err := github_com_containerd_typeurl.UnmarshalAny(m.Event)
167
+		if err != nil {
168
+			return "", false
169
+		}
170
+
171
+		adaptor, ok := decoded.(interface{ Field([]string) (string, bool) })
172
+		if !ok {
173
+			return "", false
174
+		}
175
+		return adaptor.Field(fieldpath[1:])
176
+	}
177
+	return "", false
178
+}
179
+func (m *ForwardRequest) Marshal() (dAtA []byte, err error) {
180
+	size := m.Size()
181
+	dAtA = make([]byte, size)
182
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
183
+	if err != nil {
184
+		return nil, err
185
+	}
186
+	return dAtA[:n], nil
187
+}
188
+
189
+func (m *ForwardRequest) MarshalTo(dAtA []byte) (int, error) {
190
+	size := m.Size()
191
+	return m.MarshalToSizedBuffer(dAtA[:size])
192
+}
193
+
194
+func (m *ForwardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
195
+	i := len(dAtA)
196
+	_ = i
197
+	var l int
198
+	_ = l
199
+	if m.XXX_unrecognized != nil {
200
+		i -= len(m.XXX_unrecognized)
201
+		copy(dAtA[i:], m.XXX_unrecognized)
202
+	}
203
+	if m.Envelope != nil {
204
+		{
205
+			size, err := m.Envelope.MarshalToSizedBuffer(dAtA[:i])
206
+			if err != nil {
207
+				return 0, err
208
+			}
209
+			i -= size
210
+			i = encodeVarintEvents(dAtA, i, uint64(size))
211
+		}
212
+		i--
213
+		dAtA[i] = 0xa
214
+	}
215
+	return len(dAtA) - i, nil
216
+}
217
+
218
+func (m *Envelope) Marshal() (dAtA []byte, err error) {
219
+	size := m.Size()
220
+	dAtA = make([]byte, size)
221
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
222
+	if err != nil {
223
+		return nil, err
224
+	}
225
+	return dAtA[:n], nil
226
+}
227
+
228
+func (m *Envelope) MarshalTo(dAtA []byte) (int, error) {
229
+	size := m.Size()
230
+	return m.MarshalToSizedBuffer(dAtA[:size])
231
+}
232
+
233
+func (m *Envelope) MarshalToSizedBuffer(dAtA []byte) (int, error) {
234
+	i := len(dAtA)
235
+	_ = i
236
+	var l int
237
+	_ = l
238
+	if m.XXX_unrecognized != nil {
239
+		i -= len(m.XXX_unrecognized)
240
+		copy(dAtA[i:], m.XXX_unrecognized)
241
+	}
242
+	if m.Event != nil {
243
+		{
244
+			size, err := m.Event.MarshalToSizedBuffer(dAtA[:i])
245
+			if err != nil {
246
+				return 0, err
247
+			}
248
+			i -= size
249
+			i = encodeVarintEvents(dAtA, i, uint64(size))
250
+		}
251
+		i--
252
+		dAtA[i] = 0x22
253
+	}
254
+	if len(m.Topic) > 0 {
255
+		i -= len(m.Topic)
256
+		copy(dAtA[i:], m.Topic)
257
+		i = encodeVarintEvents(dAtA, i, uint64(len(m.Topic)))
258
+		i--
259
+		dAtA[i] = 0x1a
260
+	}
261
+	if len(m.Namespace) > 0 {
262
+		i -= len(m.Namespace)
263
+		copy(dAtA[i:], m.Namespace)
264
+		i = encodeVarintEvents(dAtA, i, uint64(len(m.Namespace)))
265
+		i--
266
+		dAtA[i] = 0x12
267
+	}
268
+	n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
269
+	if err3 != nil {
270
+		return 0, err3
271
+	}
272
+	i -= n3
273
+	i = encodeVarintEvents(dAtA, i, uint64(n3))
274
+	i--
275
+	dAtA[i] = 0xa
276
+	return len(dAtA) - i, nil
277
+}
278
+
279
+func encodeVarintEvents(dAtA []byte, offset int, v uint64) int {
280
+	offset -= sovEvents(v)
281
+	base := offset
282
+	for v >= 1<<7 {
283
+		dAtA[offset] = uint8(v&0x7f | 0x80)
284
+		v >>= 7
285
+		offset++
286
+	}
287
+	dAtA[offset] = uint8(v)
288
+	return base
289
+}
290
+func (m *ForwardRequest) Size() (n int) {
291
+	if m == nil {
292
+		return 0
293
+	}
294
+	var l int
295
+	_ = l
296
+	if m.Envelope != nil {
297
+		l = m.Envelope.Size()
298
+		n += 1 + l + sovEvents(uint64(l))
299
+	}
300
+	if m.XXX_unrecognized != nil {
301
+		n += len(m.XXX_unrecognized)
302
+	}
303
+	return n
304
+}
305
+
306
+func (m *Envelope) Size() (n int) {
307
+	if m == nil {
308
+		return 0
309
+	}
310
+	var l int
311
+	_ = l
312
+	l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
313
+	n += 1 + l + sovEvents(uint64(l))
314
+	l = len(m.Namespace)
315
+	if l > 0 {
316
+		n += 1 + l + sovEvents(uint64(l))
317
+	}
318
+	l = len(m.Topic)
319
+	if l > 0 {
320
+		n += 1 + l + sovEvents(uint64(l))
321
+	}
322
+	if m.Event != nil {
323
+		l = m.Event.Size()
324
+		n += 1 + l + sovEvents(uint64(l))
325
+	}
326
+	if m.XXX_unrecognized != nil {
327
+		n += len(m.XXX_unrecognized)
328
+	}
329
+	return n
330
+}
331
+
332
+func sovEvents(x uint64) (n int) {
333
+	return (math_bits.Len64(x|1) + 6) / 7
334
+}
335
+func sozEvents(x uint64) (n int) {
336
+	return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63))))
337
+}
338
+func (this *ForwardRequest) String() string {
339
+	if this == nil {
340
+		return "nil"
341
+	}
342
+	s := strings.Join([]string{`&ForwardRequest{`,
343
+		`Envelope:` + strings.Replace(this.Envelope.String(), "Envelope", "Envelope", 1) + `,`,
344
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
345
+		`}`,
346
+	}, "")
347
+	return s
348
+}
349
+func (this *Envelope) String() string {
350
+	if this == nil {
351
+		return "nil"
352
+	}
353
+	s := strings.Join([]string{`&Envelope{`,
354
+		`Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
355
+		`Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`,
356
+		`Topic:` + fmt.Sprintf("%v", this.Topic) + `,`,
357
+		`Event:` + strings.Replace(fmt.Sprintf("%v", this.Event), "Any", "types.Any", 1) + `,`,
358
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
359
+		`}`,
360
+	}, "")
361
+	return s
362
+}
363
+func valueToStringEvents(v interface{}) string {
364
+	rv := reflect.ValueOf(v)
365
+	if rv.IsNil() {
366
+		return "nil"
367
+	}
368
+	pv := reflect.Indirect(rv).Interface()
369
+	return fmt.Sprintf("*%v", pv)
370
+}
371
+
372
+type EventsService interface {
373
+	Forward(ctx context.Context, req *ForwardRequest) (*types.Empty, error)
374
+}
375
+
376
+func RegisterEventsService(srv *github_com_containerd_ttrpc.Server, svc EventsService) {
377
+	srv.Register("containerd.services.events.ttrpc.v1.Events", map[string]github_com_containerd_ttrpc.Method{
378
+		"Forward": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
379
+			var req ForwardRequest
380
+			if err := unmarshal(&req); err != nil {
381
+				return nil, err
382
+			}
383
+			return svc.Forward(ctx, &req)
384
+		},
385
+	})
386
+}
387
+
388
+type eventsClient struct {
389
+	client *github_com_containerd_ttrpc.Client
390
+}
391
+
392
+func NewEventsClient(client *github_com_containerd_ttrpc.Client) EventsService {
393
+	return &eventsClient{
394
+		client: client,
395
+	}
396
+}
397
+
398
+func (c *eventsClient) Forward(ctx context.Context, req *ForwardRequest) (*types.Empty, error) {
399
+	var resp types.Empty
400
+	if err := c.client.Call(ctx, "containerd.services.events.ttrpc.v1.Events", "Forward", req, &resp); err != nil {
401
+		return nil, err
402
+	}
403
+	return &resp, nil
404
+}
405
+func (m *ForwardRequest) Unmarshal(dAtA []byte) error {
406
+	l := len(dAtA)
407
+	iNdEx := 0
408
+	for iNdEx < l {
409
+		preIndex := iNdEx
410
+		var wire uint64
411
+		for shift := uint(0); ; shift += 7 {
412
+			if shift >= 64 {
413
+				return ErrIntOverflowEvents
414
+			}
415
+			if iNdEx >= l {
416
+				return io.ErrUnexpectedEOF
417
+			}
418
+			b := dAtA[iNdEx]
419
+			iNdEx++
420
+			wire |= uint64(b&0x7F) << shift
421
+			if b < 0x80 {
422
+				break
423
+			}
424
+		}
425
+		fieldNum := int32(wire >> 3)
426
+		wireType := int(wire & 0x7)
427
+		if wireType == 4 {
428
+			return fmt.Errorf("proto: ForwardRequest: wiretype end group for non-group")
429
+		}
430
+		if fieldNum <= 0 {
431
+			return fmt.Errorf("proto: ForwardRequest: illegal tag %d (wire type %d)", fieldNum, wire)
432
+		}
433
+		switch fieldNum {
434
+		case 1:
435
+			if wireType != 2 {
436
+				return fmt.Errorf("proto: wrong wireType = %d for field Envelope", wireType)
437
+			}
438
+			var msglen int
439
+			for shift := uint(0); ; shift += 7 {
440
+				if shift >= 64 {
441
+					return ErrIntOverflowEvents
442
+				}
443
+				if iNdEx >= l {
444
+					return io.ErrUnexpectedEOF
445
+				}
446
+				b := dAtA[iNdEx]
447
+				iNdEx++
448
+				msglen |= int(b&0x7F) << shift
449
+				if b < 0x80 {
450
+					break
451
+				}
452
+			}
453
+			if msglen < 0 {
454
+				return ErrInvalidLengthEvents
455
+			}
456
+			postIndex := iNdEx + msglen
457
+			if postIndex < 0 {
458
+				return ErrInvalidLengthEvents
459
+			}
460
+			if postIndex > l {
461
+				return io.ErrUnexpectedEOF
462
+			}
463
+			if m.Envelope == nil {
464
+				m.Envelope = &Envelope{}
465
+			}
466
+			if err := m.Envelope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
467
+				return err
468
+			}
469
+			iNdEx = postIndex
470
+		default:
471
+			iNdEx = preIndex
472
+			skippy, err := skipEvents(dAtA[iNdEx:])
473
+			if err != nil {
474
+				return err
475
+			}
476
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
477
+				return ErrInvalidLengthEvents
478
+			}
479
+			if (iNdEx + skippy) > l {
480
+				return io.ErrUnexpectedEOF
481
+			}
482
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
483
+			iNdEx += skippy
484
+		}
485
+	}
486
+
487
+	if iNdEx > l {
488
+		return io.ErrUnexpectedEOF
489
+	}
490
+	return nil
491
+}
492
+func (m *Envelope) Unmarshal(dAtA []byte) error {
493
+	l := len(dAtA)
494
+	iNdEx := 0
495
+	for iNdEx < l {
496
+		preIndex := iNdEx
497
+		var wire uint64
498
+		for shift := uint(0); ; shift += 7 {
499
+			if shift >= 64 {
500
+				return ErrIntOverflowEvents
501
+			}
502
+			if iNdEx >= l {
503
+				return io.ErrUnexpectedEOF
504
+			}
505
+			b := dAtA[iNdEx]
506
+			iNdEx++
507
+			wire |= uint64(b&0x7F) << shift
508
+			if b < 0x80 {
509
+				break
510
+			}
511
+		}
512
+		fieldNum := int32(wire >> 3)
513
+		wireType := int(wire & 0x7)
514
+		if wireType == 4 {
515
+			return fmt.Errorf("proto: Envelope: wiretype end group for non-group")
516
+		}
517
+		if fieldNum <= 0 {
518
+			return fmt.Errorf("proto: Envelope: illegal tag %d (wire type %d)", fieldNum, wire)
519
+		}
520
+		switch fieldNum {
521
+		case 1:
522
+			if wireType != 2 {
523
+				return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
524
+			}
525
+			var msglen int
526
+			for shift := uint(0); ; shift += 7 {
527
+				if shift >= 64 {
528
+					return ErrIntOverflowEvents
529
+				}
530
+				if iNdEx >= l {
531
+					return io.ErrUnexpectedEOF
532
+				}
533
+				b := dAtA[iNdEx]
534
+				iNdEx++
535
+				msglen |= int(b&0x7F) << shift
536
+				if b < 0x80 {
537
+					break
538
+				}
539
+			}
540
+			if msglen < 0 {
541
+				return ErrInvalidLengthEvents
542
+			}
543
+			postIndex := iNdEx + msglen
544
+			if postIndex < 0 {
545
+				return ErrInvalidLengthEvents
546
+			}
547
+			if postIndex > l {
548
+				return io.ErrUnexpectedEOF
549
+			}
550
+			if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
551
+				return err
552
+			}
553
+			iNdEx = postIndex
554
+		case 2:
555
+			if wireType != 2 {
556
+				return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType)
557
+			}
558
+			var stringLen uint64
559
+			for shift := uint(0); ; shift += 7 {
560
+				if shift >= 64 {
561
+					return ErrIntOverflowEvents
562
+				}
563
+				if iNdEx >= l {
564
+					return io.ErrUnexpectedEOF
565
+				}
566
+				b := dAtA[iNdEx]
567
+				iNdEx++
568
+				stringLen |= uint64(b&0x7F) << shift
569
+				if b < 0x80 {
570
+					break
571
+				}
572
+			}
573
+			intStringLen := int(stringLen)
574
+			if intStringLen < 0 {
575
+				return ErrInvalidLengthEvents
576
+			}
577
+			postIndex := iNdEx + intStringLen
578
+			if postIndex < 0 {
579
+				return ErrInvalidLengthEvents
580
+			}
581
+			if postIndex > l {
582
+				return io.ErrUnexpectedEOF
583
+			}
584
+			m.Namespace = string(dAtA[iNdEx:postIndex])
585
+			iNdEx = postIndex
586
+		case 3:
587
+			if wireType != 2 {
588
+				return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType)
589
+			}
590
+			var stringLen uint64
591
+			for shift := uint(0); ; shift += 7 {
592
+				if shift >= 64 {
593
+					return ErrIntOverflowEvents
594
+				}
595
+				if iNdEx >= l {
596
+					return io.ErrUnexpectedEOF
597
+				}
598
+				b := dAtA[iNdEx]
599
+				iNdEx++
600
+				stringLen |= uint64(b&0x7F) << shift
601
+				if b < 0x80 {
602
+					break
603
+				}
604
+			}
605
+			intStringLen := int(stringLen)
606
+			if intStringLen < 0 {
607
+				return ErrInvalidLengthEvents
608
+			}
609
+			postIndex := iNdEx + intStringLen
610
+			if postIndex < 0 {
611
+				return ErrInvalidLengthEvents
612
+			}
613
+			if postIndex > l {
614
+				return io.ErrUnexpectedEOF
615
+			}
616
+			m.Topic = string(dAtA[iNdEx:postIndex])
617
+			iNdEx = postIndex
618
+		case 4:
619
+			if wireType != 2 {
620
+				return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType)
621
+			}
622
+			var msglen int
623
+			for shift := uint(0); ; shift += 7 {
624
+				if shift >= 64 {
625
+					return ErrIntOverflowEvents
626
+				}
627
+				if iNdEx >= l {
628
+					return io.ErrUnexpectedEOF
629
+				}
630
+				b := dAtA[iNdEx]
631
+				iNdEx++
632
+				msglen |= int(b&0x7F) << shift
633
+				if b < 0x80 {
634
+					break
635
+				}
636
+			}
637
+			if msglen < 0 {
638
+				return ErrInvalidLengthEvents
639
+			}
640
+			postIndex := iNdEx + msglen
641
+			if postIndex < 0 {
642
+				return ErrInvalidLengthEvents
643
+			}
644
+			if postIndex > l {
645
+				return io.ErrUnexpectedEOF
646
+			}
647
+			if m.Event == nil {
648
+				m.Event = &types.Any{}
649
+			}
650
+			if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
651
+				return err
652
+			}
653
+			iNdEx = postIndex
654
+		default:
655
+			iNdEx = preIndex
656
+			skippy, err := skipEvents(dAtA[iNdEx:])
657
+			if err != nil {
658
+				return err
659
+			}
660
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
661
+				return ErrInvalidLengthEvents
662
+			}
663
+			if (iNdEx + skippy) > l {
664
+				return io.ErrUnexpectedEOF
665
+			}
666
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
667
+			iNdEx += skippy
668
+		}
669
+	}
670
+
671
+	if iNdEx > l {
672
+		return io.ErrUnexpectedEOF
673
+	}
674
+	return nil
675
+}
676
+func skipEvents(dAtA []byte) (n int, err error) {
677
+	l := len(dAtA)
678
+	iNdEx := 0
679
+	depth := 0
680
+	for iNdEx < l {
681
+		var wire uint64
682
+		for shift := uint(0); ; shift += 7 {
683
+			if shift >= 64 {
684
+				return 0, ErrIntOverflowEvents
685
+			}
686
+			if iNdEx >= l {
687
+				return 0, io.ErrUnexpectedEOF
688
+			}
689
+			b := dAtA[iNdEx]
690
+			iNdEx++
691
+			wire |= (uint64(b) & 0x7F) << shift
692
+			if b < 0x80 {
693
+				break
694
+			}
695
+		}
696
+		wireType := int(wire & 0x7)
697
+		switch wireType {
698
+		case 0:
699
+			for shift := uint(0); ; shift += 7 {
700
+				if shift >= 64 {
701
+					return 0, ErrIntOverflowEvents
702
+				}
703
+				if iNdEx >= l {
704
+					return 0, io.ErrUnexpectedEOF
705
+				}
706
+				iNdEx++
707
+				if dAtA[iNdEx-1] < 0x80 {
708
+					break
709
+				}
710
+			}
711
+		case 1:
712
+			iNdEx += 8
713
+		case 2:
714
+			var length int
715
+			for shift := uint(0); ; shift += 7 {
716
+				if shift >= 64 {
717
+					return 0, ErrIntOverflowEvents
718
+				}
719
+				if iNdEx >= l {
720
+					return 0, io.ErrUnexpectedEOF
721
+				}
722
+				b := dAtA[iNdEx]
723
+				iNdEx++
724
+				length |= (int(b) & 0x7F) << shift
725
+				if b < 0x80 {
726
+					break
727
+				}
728
+			}
729
+			if length < 0 {
730
+				return 0, ErrInvalidLengthEvents
731
+			}
732
+			iNdEx += length
733
+		case 3:
734
+			depth++
735
+		case 4:
736
+			if depth == 0 {
737
+				return 0, ErrUnexpectedEndOfGroupEvents
738
+			}
739
+			depth--
740
+		case 5:
741
+			iNdEx += 4
742
+		default:
743
+			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
744
+		}
745
+		if iNdEx < 0 {
746
+			return 0, ErrInvalidLengthEvents
747
+		}
748
+		if depth == 0 {
749
+			return iNdEx, nil
750
+		}
751
+	}
752
+	return 0, io.ErrUnexpectedEOF
753
+}
754
+
755
+var (
756
+	ErrInvalidLengthEvents        = fmt.Errorf("proto: negative length found during unmarshaling")
757
+	ErrIntOverflowEvents          = fmt.Errorf("proto: integer overflow")
758
+	ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group")
759
+)
0 760
new file mode 100644
... ...
@@ -0,0 +1,48 @@
0
+/*
1
+	Copyright The containerd Authors.
2
+
3
+	Licensed under the Apache License, Version 2.0 (the "License");
4
+	you may not use this file except in compliance with the License.
5
+	You may obtain a copy of the License at
6
+
7
+		http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+	Unless required by applicable law or agreed to in writing, software
10
+	distributed under the License is distributed on an "AS IS" BASIS,
11
+	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+	See the License for the specific language governing permissions and
13
+	limitations under the License.
14
+*/
15
+
16
+syntax = "proto3";
17
+
18
+package containerd.services.events.ttrpc.v1;
19
+
20
+import weak "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
21
+import weak "gogoproto/gogo.proto";
22
+import "google/protobuf/any.proto";
23
+import "google/protobuf/empty.proto";
24
+import "google/protobuf/timestamp.proto";
25
+
26
+option go_package = "github.com/containerd/containerd/api/services/ttrpc/events/v1;events";
27
+
28
+service Events {
29
+	// Forward sends an event that has already been packaged into an envelope
30
+	// with a timestamp and namespace.
31
+	//
32
+	// This is useful if earlier timestamping is required or when forwarding on
33
+	// behalf of another component, namespace or publisher.
34
+	rpc Forward(ForwardRequest) returns (google.protobuf.Empty);
35
+}
36
+
37
+message ForwardRequest {
38
+	Envelope envelope = 1;
39
+}
40
+
41
+message Envelope {
42
+	option (containerd.plugin.fieldpath) = true;
43
+	google.protobuf.Timestamp timestamp = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
44
+	string namespace = 2;
45
+	string topic = 3;
46
+	google.protobuf.Any event = 4;
47
+}
0 48
new file mode 100644
... ...
@@ -0,0 +1,109 @@
0
+/*
1
+   Copyright The containerd Authors.
2
+
3
+   Licensed under the Apache License, Version 2.0 (the "License");
4
+   you may not use this file except in compliance with the License.
5
+   You may obtain a copy of the License at
6
+
7
+       http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+   Unless required by applicable law or agreed to in writing, software
10
+   distributed under the License is distributed on an "AS IS" BASIS,
11
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+   See the License for the specific language governing permissions and
13
+   limitations under the License.
14
+*/
15
+
16
+package shutdown
17
+
18
+import (
19
+	"context"
20
+	"errors"
21
+	"sync"
22
+	"time"
23
+
24
+	"golang.org/x/sync/errgroup"
25
+)
26
+
27
+// ErrShutdown is the error condition when a context has been fully shutdown
28
+var ErrShutdown = errors.New("shutdown")
29
+
30
+// Service is used to facilitate shutdown by through callback
31
+// registration and shutdown initiation
32
+type Service interface {
33
+	// Shutdown initiates shutdown
34
+	Shutdown()
35
+	// RegisterCallback registers functions to be called on shutdown and before
36
+	// the shutdown channel is closed. A callback error will propagate to the
37
+	// context error
38
+	RegisterCallback(func(context.Context) error)
39
+}
40
+
41
+// WithShutdown returns a context which is similar to a cancel context, but
42
+// with callbacks which can propagate to the context error. Unlike a cancel
43
+// context, the shutdown context cannot be canceled from the parent context.
44
+// However, future child contexes will be canceled upon shutdown.
45
+func WithShutdown(ctx context.Context) (context.Context, Service) {
46
+	ss := &shutdownService{
47
+		Context: ctx,
48
+		doneC:   make(chan struct{}),
49
+		timeout: 30 * time.Second,
50
+	}
51
+	return ss, ss
52
+}
53
+
54
+type shutdownService struct {
55
+	context.Context
56
+
57
+	mu         sync.Mutex
58
+	isShutdown bool
59
+	callbacks  []func(context.Context) error
60
+	doneC      chan struct{}
61
+	err        error
62
+	timeout    time.Duration
63
+}
64
+
65
+func (s *shutdownService) Shutdown() {
66
+	s.mu.Lock()
67
+	defer s.mu.Unlock()
68
+	if s.isShutdown {
69
+		return
70
+	}
71
+	s.isShutdown = true
72
+
73
+	go func(callbacks []func(context.Context) error) {
74
+		ctx, cancel := context.WithTimeout(context.Background(), s.timeout)
75
+		defer cancel()
76
+		grp, ctx := errgroup.WithContext(ctx)
77
+		for i := range callbacks {
78
+			fn := callbacks[i]
79
+			grp.Go(func() error { return fn(ctx) })
80
+		}
81
+		err := grp.Wait()
82
+		if err == nil {
83
+			err = ErrShutdown
84
+		}
85
+		s.mu.Lock()
86
+		s.err = err
87
+		close(s.doneC)
88
+		s.mu.Unlock()
89
+	}(s.callbacks)
90
+}
91
+
92
+func (s *shutdownService) Done() <-chan struct{} {
93
+	return s.doneC
94
+}
95
+
96
+func (s *shutdownService) Err() error {
97
+	s.mu.Lock()
98
+	defer s.mu.Unlock()
99
+	return s.err
100
+}
101
+func (s *shutdownService) RegisterCallback(fn func(context.Context) error) {
102
+	s.mu.Lock()
103
+	defer s.mu.Unlock()
104
+	if s.callbacks == nil {
105
+		s.callbacks = []func(context.Context) error{}
106
+	}
107
+	s.callbacks = append(s.callbacks, fn)
108
+}
0 109
new file mode 100644
... ...
@@ -0,0 +1,120 @@
0
+/*
1
+   Copyright The containerd Authors.
2
+
3
+   Licensed under the Apache License, Version 2.0 (the "License");
4
+   you may not use this file except in compliance with the License.
5
+   You may obtain a copy of the License at
6
+
7
+       http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+   Unless required by applicable law or agreed to in writing, software
10
+   distributed under the License is distributed on an "AS IS" BASIS,
11
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+   See the License for the specific language governing permissions and
13
+   limitations under the License.
14
+*/
15
+
16
+package ttrpcutil
17
+
18
+import (
19
+	"errors"
20
+	"fmt"
21
+	"sync"
22
+	"time"
23
+
24
+	v1 "github.com/containerd/containerd/api/services/ttrpc/events/v1"
25
+	"github.com/containerd/containerd/pkg/dialer"
26
+	"github.com/containerd/ttrpc"
27
+)
28
+
29
+const ttrpcDialTimeout = 5 * time.Second
30
+
31
+type ttrpcConnector func() (*ttrpc.Client, error)
32
+
33
+// Client is the client to interact with TTRPC part of containerd server (plugins, events)
34
+type Client struct {
35
+	mu        sync.Mutex
36
+	connector ttrpcConnector
37
+	client    *ttrpc.Client
38
+	closed    bool
39
+}
40
+
41
+// NewClient returns a new containerd TTRPC client that is connected to the containerd instance provided by address
42
+func NewClient(address string, opts ...ttrpc.ClientOpts) (*Client, error) {
43
+	connector := func() (*ttrpc.Client, error) {
44
+		conn, err := dialer.Dialer(address, ttrpcDialTimeout)
45
+		if err != nil {
46
+			return nil, fmt.Errorf("failed to connect: %w", err)
47
+		}
48
+
49
+		client := ttrpc.NewClient(conn, opts...)
50
+		return client, nil
51
+	}
52
+
53
+	return &Client{
54
+		connector: connector,
55
+	}, nil
56
+}
57
+
58
+// Reconnect re-establishes the TTRPC connection to the containerd daemon
59
+func (c *Client) Reconnect() error {
60
+	c.mu.Lock()
61
+	defer c.mu.Unlock()
62
+
63
+	if c.connector == nil {
64
+		return errors.New("unable to reconnect to containerd, no connector available")
65
+	}
66
+
67
+	if c.closed {
68
+		return errors.New("client is closed")
69
+	}
70
+
71
+	if c.client != nil {
72
+		if err := c.client.Close(); err != nil {
73
+			return err
74
+		}
75
+	}
76
+
77
+	client, err := c.connector()
78
+	if err != nil {
79
+		return err
80
+	}
81
+
82
+	c.client = client
83
+	return nil
84
+}
85
+
86
+// EventsService creates an EventsService client
87
+func (c *Client) EventsService() (v1.EventsService, error) {
88
+	client, err := c.Client()
89
+	if err != nil {
90
+		return nil, err
91
+	}
92
+	return v1.NewEventsClient(client), nil
93
+}
94
+
95
+// Client returns the underlying TTRPC client object
96
+func (c *Client) Client() (*ttrpc.Client, error) {
97
+	c.mu.Lock()
98
+	defer c.mu.Unlock()
99
+	if c.client == nil {
100
+		client, err := c.connector()
101
+		if err != nil {
102
+			return nil, err
103
+		}
104
+		c.client = client
105
+	}
106
+	return c.client, nil
107
+}
108
+
109
+// Close closes the clients TTRPC connection to containerd
110
+func (c *Client) Close() error {
111
+	c.mu.Lock()
112
+	defer c.mu.Unlock()
113
+
114
+	c.closed = true
115
+	if c.client != nil {
116
+		return c.client.Close()
117
+	}
118
+	return nil
119
+}
0 120
new file mode 100644
... ...
@@ -0,0 +1,169 @@
0
+/*
1
+   Copyright The containerd Authors.
2
+
3
+   Licensed under the Apache License, Version 2.0 (the "License");
4
+   you may not use this file except in compliance with the License.
5
+   You may obtain a copy of the License at
6
+
7
+       http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+   Unless required by applicable law or agreed to in writing, software
10
+   distributed under the License is distributed on an "AS IS" BASIS,
11
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+   See the License for the specific language governing permissions and
13
+   limitations under the License.
14
+*/
15
+
16
+package shim
17
+
18
+import (
19
+	"context"
20
+	"sync"
21
+	"time"
22
+
23
+	v1 "github.com/containerd/containerd/api/services/ttrpc/events/v1"
24
+	"github.com/containerd/containerd/events"
25
+	"github.com/containerd/containerd/namespaces"
26
+	"github.com/containerd/containerd/pkg/ttrpcutil"
27
+	"github.com/containerd/ttrpc"
28
+	"github.com/containerd/typeurl"
29
+	"github.com/sirupsen/logrus"
30
+)
31
+
32
+const (
33
+	queueSize  = 2048
34
+	maxRequeue = 5
35
+)
36
+
37
+type item struct {
38
+	ev    *v1.Envelope
39
+	ctx   context.Context
40
+	count int
41
+}
42
+
43
+// NewPublisher creates a new remote events publisher
44
+func NewPublisher(address string) (*RemoteEventsPublisher, error) {
45
+	client, err := ttrpcutil.NewClient(address)
46
+	if err != nil {
47
+		return nil, err
48
+	}
49
+
50
+	l := &RemoteEventsPublisher{
51
+		client:  client,
52
+		closed:  make(chan struct{}),
53
+		requeue: make(chan *item, queueSize),
54
+	}
55
+
56
+	go l.processQueue()
57
+	return l, nil
58
+}
59
+
60
+// RemoteEventsPublisher forwards events to a ttrpc server
61
+type RemoteEventsPublisher struct {
62
+	client  *ttrpcutil.Client
63
+	closed  chan struct{}
64
+	closer  sync.Once
65
+	requeue chan *item
66
+}
67
+
68
+// Done returns a channel which closes when done
69
+func (l *RemoteEventsPublisher) Done() <-chan struct{} {
70
+	return l.closed
71
+}
72
+
73
+// Close closes the remote connection and closes the done channel
74
+func (l *RemoteEventsPublisher) Close() (err error) {
75
+	err = l.client.Close()
76
+	l.closer.Do(func() {
77
+		close(l.closed)
78
+	})
79
+	return err
80
+}
81
+
82
+func (l *RemoteEventsPublisher) processQueue() {
83
+	for i := range l.requeue {
84
+		if i.count > maxRequeue {
85
+			logrus.Errorf("evicting %s from queue because of retry count", i.ev.Topic)
86
+			// drop the event
87
+			continue
88
+		}
89
+
90
+		if err := l.forwardRequest(i.ctx, &v1.ForwardRequest{Envelope: i.ev}); err != nil {
91
+			logrus.WithError(err).Error("forward event")
92
+			l.queue(i)
93
+		}
94
+	}
95
+}
96
+
97
+func (l *RemoteEventsPublisher) queue(i *item) {
98
+	go func() {
99
+		i.count++
100
+		// re-queue after a short delay
101
+		time.Sleep(time.Duration(1*i.count) * time.Second)
102
+		l.requeue <- i
103
+	}()
104
+}
105
+
106
+// Publish publishes the event by forwarding it to the configured ttrpc server
107
+func (l *RemoteEventsPublisher) Publish(ctx context.Context, topic string, event events.Event) error {
108
+	ns, err := namespaces.NamespaceRequired(ctx)
109
+	if err != nil {
110
+		return err
111
+	}
112
+	any, err := typeurl.MarshalAny(event)
113
+	if err != nil {
114
+		return err
115
+	}
116
+	i := &item{
117
+		ev: &v1.Envelope{
118
+			Timestamp: time.Now(),
119
+			Namespace: ns,
120
+			Topic:     topic,
121
+			Event:     any,
122
+		},
123
+		ctx: ctx,
124
+	}
125
+
126
+	if err := l.forwardRequest(i.ctx, &v1.ForwardRequest{Envelope: i.ev}); err != nil {
127
+		l.queue(i)
128
+		return err
129
+	}
130
+
131
+	return nil
132
+}
133
+
134
+func (l *RemoteEventsPublisher) forwardRequest(ctx context.Context, req *v1.ForwardRequest) error {
135
+	service, err := l.client.EventsService()
136
+	if err == nil {
137
+		fCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
138
+		_, err = service.Forward(fCtx, req)
139
+		cancel()
140
+		if err == nil {
141
+			return nil
142
+		}
143
+	}
144
+
145
+	if err != ttrpc.ErrClosed {
146
+		return err
147
+	}
148
+
149
+	// Reconnect and retry request
150
+	if err = l.client.Reconnect(); err != nil {
151
+		return err
152
+	}
153
+
154
+	service, err = l.client.EventsService()
155
+	if err != nil {
156
+		return err
157
+	}
158
+
159
+	// try again with a fresh context, otherwise we may get a context timeout unexpectedly.
160
+	fCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
161
+	_, err = service.Forward(fCtx, req)
162
+	cancel()
163
+	if err != nil {
164
+		return err
165
+	}
166
+
167
+	return nil
168
+}
0 169
new file mode 100644
... ...
@@ -0,0 +1,501 @@
0
+/*
1
+   Copyright The containerd Authors.
2
+
3
+   Licensed under the Apache License, Version 2.0 (the "License");
4
+   you may not use this file except in compliance with the License.
5
+   You may obtain a copy of the License at
6
+
7
+       http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+   Unless required by applicable law or agreed to in writing, software
10
+   distributed under the License is distributed on an "AS IS" BASIS,
11
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+   See the License for the specific language governing permissions and
13
+   limitations under the License.
14
+*/
15
+
16
+package shim
17
+
18
+import (
19
+	"context"
20
+	"errors"
21
+	"flag"
22
+	"fmt"
23
+	"io"
24
+	"os"
25
+	"runtime"
26
+	"runtime/debug"
27
+	"strings"
28
+	"time"
29
+
30
+	"github.com/containerd/containerd/events"
31
+	"github.com/containerd/containerd/log"
32
+	"github.com/containerd/containerd/namespaces"
33
+	"github.com/containerd/containerd/pkg/shutdown"
34
+	"github.com/containerd/containerd/plugin"
35
+	shimapi "github.com/containerd/containerd/runtime/v2/task"
36
+	"github.com/containerd/containerd/version"
37
+	"github.com/containerd/ttrpc"
38
+	"github.com/gogo/protobuf/proto"
39
+	"github.com/sirupsen/logrus"
40
+)
41
+
42
+// Publisher for events
43
+type Publisher interface {
44
+	events.Publisher
45
+	io.Closer
46
+}
47
+
48
+// StartOpts describes shim start configuration received from containerd
49
+type StartOpts struct {
50
+	ID               string // TODO(2.0): Remove ID, passed directly to start for call symmetry
51
+	ContainerdBinary string
52
+	Address          string
53
+	TTRPCAddress     string
54
+}
55
+
56
+type StopStatus struct {
57
+	Pid        int
58
+	ExitStatus int
59
+	ExitedAt   time.Time
60
+}
61
+
62
+// Init func for the creation of a shim server
63
+// TODO(2.0): Remove init function
64
+type Init func(context.Context, string, Publisher, func()) (Shim, error)
65
+
66
+// Shim server interface
67
+// TODO(2.0): Remove unified shim interface
68
+type Shim interface {
69
+	shimapi.TaskService
70
+	Cleanup(ctx context.Context) (*shimapi.DeleteResponse, error)
71
+	StartShim(ctx context.Context, opts StartOpts) (string, error)
72
+}
73
+
74
+// Manager is the interface which manages the shim process
75
+type Manager interface {
76
+	Name() string
77
+	Start(ctx context.Context, id string, opts StartOpts) (string, error)
78
+	Stop(ctx context.Context, id string) (StopStatus, error)
79
+}
80
+
81
+// OptsKey is the context key for the Opts value.
82
+type OptsKey struct{}
83
+
84
+// Opts are context options associated with the shim invocation.
85
+type Opts struct {
86
+	BundlePath string
87
+	Debug      bool
88
+}
89
+
90
+// BinaryOpts allows the configuration of a shims binary setup
91
+type BinaryOpts func(*Config)
92
+
93
+// Config of shim binary options provided by shim implementations
94
+type Config struct {
95
+	// NoSubreaper disables setting the shim as a child subreaper
96
+	NoSubreaper bool
97
+	// NoReaper disables the shim binary from reaping any child process implicitly
98
+	NoReaper bool
99
+	// NoSetupLogger disables automatic configuration of logrus to use the shim FIFO
100
+	NoSetupLogger bool
101
+}
102
+
103
+type ttrpcService interface {
104
+	RegisterTTRPC(*ttrpc.Server) error
105
+}
106
+
107
+type taskService struct {
108
+	shimapi.TaskService
109
+}
110
+
111
+func (t taskService) RegisterTTRPC(server *ttrpc.Server) error {
112
+	shimapi.RegisterTaskService(server, t.TaskService)
113
+	return nil
114
+}
115
+
116
+var (
117
+	debugFlag            bool
118
+	versionFlag          bool
119
+	id                   string
120
+	namespaceFlag        string
121
+	socketFlag           string
122
+	bundlePath           string
123
+	addressFlag          string
124
+	containerdBinaryFlag string
125
+	action               string
126
+)
127
+
128
+const (
129
+	ttrpcAddressEnv = "TTRPC_ADDRESS"
130
+)
131
+
132
+func parseFlags() {
133
+	flag.BoolVar(&debugFlag, "debug", false, "enable debug output in logs")
134
+	flag.BoolVar(&versionFlag, "v", false, "show the shim version and exit")
135
+	flag.StringVar(&namespaceFlag, "namespace", "", "namespace that owns the shim")
136
+	flag.StringVar(&id, "id", "", "id of the task")
137
+	flag.StringVar(&socketFlag, "socket", "", "socket path to serve")
138
+	flag.StringVar(&bundlePath, "bundle", "", "path to the bundle if not workdir")
139
+
140
+	flag.StringVar(&addressFlag, "address", "", "grpc address back to main containerd")
141
+	flag.StringVar(&containerdBinaryFlag, "publish-binary", "containerd", "path to publish binary (used for publishing events)")
142
+
143
+	flag.Parse()
144
+	action = flag.Arg(0)
145
+}
146
+
147
+func setRuntime() {
148
+	debug.SetGCPercent(40)
149
+	go func() {
150
+		for range time.Tick(30 * time.Second) {
151
+			debug.FreeOSMemory()
152
+		}
153
+	}()
154
+	if os.Getenv("GOMAXPROCS") == "" {
155
+		// If GOMAXPROCS hasn't been set, we default to a value of 2 to reduce
156
+		// the number of Go stacks present in the shim.
157
+		runtime.GOMAXPROCS(2)
158
+	}
159
+}
160
+
161
+func setLogger(ctx context.Context, id string) (context.Context, error) {
162
+	l := log.G(ctx)
163
+	l.Logger.SetFormatter(&logrus.TextFormatter{
164
+		TimestampFormat: log.RFC3339NanoFixed,
165
+		FullTimestamp:   true,
166
+	})
167
+	if debugFlag {
168
+		l.Logger.SetLevel(logrus.DebugLevel)
169
+	}
170
+	f, err := openLog(ctx, id)
171
+	if err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
172
+		return ctx, err
173
+	}
174
+	l.Logger.SetOutput(f)
175
+	return log.WithLogger(ctx, l), nil
176
+}
177
+
178
+// Run initializes and runs a shim server
179
+// TODO(2.0): Remove function
180
+func Run(name string, initFunc Init, opts ...BinaryOpts) {
181
+	var config Config
182
+	for _, o := range opts {
183
+		o(&config)
184
+	}
185
+
186
+	ctx := context.Background()
187
+	ctx = log.WithLogger(ctx, log.G(ctx).WithField("runtime", name))
188
+
189
+	if err := run(ctx, nil, initFunc, name, config); err != nil {
190
+		fmt.Fprintf(os.Stderr, "%s: %s", name, err)
191
+		os.Exit(1)
192
+	}
193
+}
194
+
195
+// TODO(2.0): Remove this type
196
+type shimToManager struct {
197
+	shim Shim
198
+	name string
199
+}
200
+
201
+func (stm shimToManager) Name() string {
202
+	return stm.name
203
+}
204
+
205
+func (stm shimToManager) Start(ctx context.Context, id string, opts StartOpts) (string, error) {
206
+	opts.ID = id
207
+	return stm.shim.StartShim(ctx, opts)
208
+}
209
+
210
+func (stm shimToManager) Stop(ctx context.Context, id string) (StopStatus, error) {
211
+	// shim must already have id
212
+	dr, err := stm.shim.Cleanup(ctx)
213
+	if err != nil {
214
+		return StopStatus{}, err
215
+	}
216
+	return StopStatus{
217
+		Pid:        int(dr.Pid),
218
+		ExitStatus: int(dr.ExitStatus),
219
+		ExitedAt:   dr.ExitedAt,
220
+	}, nil
221
+}
222
+
223
+// RunManager initialzes and runs a shim server
224
+// TODO(2.0): Rename to Run
225
+func RunManager(ctx context.Context, manager Manager, opts ...BinaryOpts) {
226
+	var config Config
227
+	for _, o := range opts {
228
+		o(&config)
229
+	}
230
+
231
+	ctx = log.WithLogger(ctx, log.G(ctx).WithField("runtime", manager.Name()))
232
+
233
+	if err := run(ctx, manager, nil, "", config); err != nil {
234
+		fmt.Fprintf(os.Stderr, "%s: %s", manager.Name(), err)
235
+		os.Exit(1)
236
+	}
237
+}
238
+
239
+func run(ctx context.Context, manager Manager, initFunc Init, name string, config Config) error {
240
+	parseFlags()
241
+	if versionFlag {
242
+		fmt.Printf("%s:\n", os.Args[0])
243
+		fmt.Println("  Version: ", version.Version)
244
+		fmt.Println("  Revision:", version.Revision)
245
+		fmt.Println("  Go version:", version.GoVersion)
246
+		fmt.Println("")
247
+		return nil
248
+	}
249
+
250
+	if namespaceFlag == "" {
251
+		return fmt.Errorf("shim namespace cannot be empty")
252
+	}
253
+
254
+	setRuntime()
255
+
256
+	signals, err := setupSignals(config)
257
+	if err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
258
+		return err
259
+	}
260
+
261
+	if !config.NoSubreaper {
262
+		if err := subreaper(); err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
263
+			return err
264
+		}
265
+	}
266
+
267
+	ttrpcAddress := os.Getenv(ttrpcAddressEnv)
268
+	publisher, err := NewPublisher(ttrpcAddress)
269
+	if err != nil {
270
+		return err
271
+	}
272
+	defer publisher.Close()
273
+
274
+	ctx = namespaces.WithNamespace(ctx, namespaceFlag)
275
+	ctx = context.WithValue(ctx, OptsKey{}, Opts{BundlePath: bundlePath, Debug: debugFlag})
276
+	ctx, sd := shutdown.WithShutdown(ctx)
277
+	defer sd.Shutdown()
278
+
279
+	if manager == nil {
280
+		service, err := initFunc(ctx, id, publisher, sd.Shutdown)
281
+		if err != nil {
282
+			return err
283
+		}
284
+		plugin.Register(&plugin.Registration{
285
+			Type: plugin.TTRPCPlugin,
286
+			ID:   "task",
287
+			Requires: []plugin.Type{
288
+				plugin.EventPlugin,
289
+			},
290
+			InitFn: func(ic *plugin.InitContext) (interface{}, error) {
291
+				return taskService{service}, nil
292
+			},
293
+		})
294
+		manager = shimToManager{
295
+			shim: service,
296
+			name: name,
297
+		}
298
+	}
299
+
300
+	// Handle explicit actions
301
+	switch action {
302
+	case "delete":
303
+		logger := log.G(ctx).WithFields(logrus.Fields{
304
+			"pid":       os.Getpid(),
305
+			"namespace": namespaceFlag,
306
+		})
307
+		go reap(ctx, logger, signals)
308
+		ss, err := manager.Stop(ctx, id)
309
+		if err != nil {
310
+			return err
311
+		}
312
+		data, err := proto.Marshal(&shimapi.DeleteResponse{
313
+			Pid:        uint32(ss.Pid),
314
+			ExitStatus: uint32(ss.ExitStatus),
315
+			ExitedAt:   ss.ExitedAt,
316
+		})
317
+		if err != nil {
318
+			return err
319
+		}
320
+		if _, err := os.Stdout.Write(data); err != nil {
321
+			return err
322
+		}
323
+		return nil
324
+	case "start":
325
+		opts := StartOpts{
326
+			ContainerdBinary: containerdBinaryFlag,
327
+			Address:          addressFlag,
328
+			TTRPCAddress:     ttrpcAddress,
329
+		}
330
+
331
+		address, err := manager.Start(ctx, id, opts)
332
+		if err != nil {
333
+			return err
334
+		}
335
+		if _, err := os.Stdout.WriteString(address); err != nil {
336
+			return err
337
+		}
338
+		return nil
339
+	}
340
+
341
+	if !config.NoSetupLogger {
342
+		ctx, err = setLogger(ctx, id)
343
+		if err != nil {
344
+			return err
345
+		}
346
+	}
347
+
348
+	plugin.Register(&plugin.Registration{
349
+		Type: plugin.InternalPlugin,
350
+		ID:   "shutdown",
351
+		InitFn: func(ic *plugin.InitContext) (interface{}, error) {
352
+			return sd, nil
353
+		},
354
+	})
355
+
356
+	// Register event plugin
357
+	plugin.Register(&plugin.Registration{
358
+		Type: plugin.EventPlugin,
359
+		ID:   "publisher",
360
+		InitFn: func(ic *plugin.InitContext) (interface{}, error) {
361
+			return publisher, nil
362
+		},
363
+	})
364
+
365
+	var (
366
+		initialized   = plugin.NewPluginSet()
367
+		ttrpcServices = []ttrpcService{}
368
+	)
369
+	plugins := plugin.Graph(func(*plugin.Registration) bool { return false })
370
+	for _, p := range plugins {
371
+		id := p.URI()
372
+		log.G(ctx).WithField("type", p.Type).Infof("loading plugin %q...", id)
373
+
374
+		initContext := plugin.NewContext(
375
+			ctx,
376
+			p,
377
+			initialized,
378
+			// NOTE: Root is empty since the shim does not support persistent storage,
379
+			// shim plugins should make use state directory for writing files to disk.
380
+			// The state directory will be destroyed when the shim if cleaned up or
381
+			// on reboot
382
+			"",
383
+			bundlePath,
384
+		)
385
+		initContext.Address = addressFlag
386
+		initContext.TTRPCAddress = ttrpcAddress
387
+
388
+		// load the plugin specific configuration if it is provided
389
+		//TODO: Read configuration passed into shim, or from state directory?
390
+		//if p.Config != nil {
391
+		//	pc, err := config.Decode(p)
392
+		//	if err != nil {
393
+		//		return nil, err
394
+		//	}
395
+		//	initContext.Config = pc
396
+		//}
397
+
398
+		result := p.Init(initContext)
399
+		if err := initialized.Add(result); err != nil {
400
+			return fmt.Errorf("could not add plugin result to plugin set: %w", err)
401
+		}
402
+
403
+		instance, err := result.Instance()
404
+		if err != nil {
405
+			if plugin.IsSkipPlugin(err) {
406
+				log.G(ctx).WithError(err).WithField("type", p.Type).Infof("skip loading plugin %q...", id)
407
+			} else {
408
+				log.G(ctx).WithError(err).Warnf("failed to load plugin %s", id)
409
+			}
410
+			continue
411
+		}
412
+
413
+		if src, ok := instance.(ttrpcService); ok {
414
+			logrus.WithField("id", id).Debug("registering ttrpc service")
415
+			ttrpcServices = append(ttrpcServices, src)
416
+		}
417
+	}
418
+
419
+	server, err := newServer()
420
+	if err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
421
+		return fmt.Errorf("failed creating server: %w", err)
422
+	}
423
+
424
+	for _, srv := range ttrpcServices {
425
+		if err := srv.RegisterTTRPC(server); err != nil {
426
+			return fmt.Errorf("failed to register service: %w", err)
427
+		}
428
+	}
429
+
430
+	if err := serve(ctx, server, signals, sd.Shutdown); err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
431
+		if err != shutdown.ErrShutdown {
432
+			return err
433
+		}
434
+	}
435
+
436
+	// NOTE: If the shim server is down(like oom killer), the address
437
+	// socket might be leaking.
438
+	if address, err := ReadAddress("address"); err == nil {
439
+		_ = RemoveSocket(address)
440
+	}
441
+
442
+	select {
443
+	case <-publisher.Done():
444
+		return nil
445
+	case <-time.After(5 * time.Second):
446
+		return errors.New("publisher not closed")
447
+	}
448
+}
449
+
450
+// serve serves the ttrpc API over a unix socket in the current working directory
451
+// and blocks until the context is canceled
452
+func serve(ctx context.Context, server *ttrpc.Server, signals chan os.Signal, shutdown func()) error {
453
+	dump := make(chan os.Signal, 32)
454
+	setupDumpStacks(dump)
455
+
456
+	path, err := os.Getwd()
457
+	if err != nil {
458
+		return err
459
+	}
460
+
461
+	l, err := serveListener(socketFlag)
462
+	if err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
463
+		return err
464
+	}
465
+	go func() {
466
+		defer l.Close()
467
+		if err := server.Serve(ctx, l); err != nil &&
468
+			!strings.Contains(err.Error(), "use of closed network connection") {
469
+			log.G(ctx).WithError(err).Fatal("containerd-shim: ttrpc server failure")
470
+		}
471
+	}()
472
+	logger := log.G(ctx).WithFields(logrus.Fields{
473
+		"pid":       os.Getpid(),
474
+		"path":      path,
475
+		"namespace": namespaceFlag,
476
+	})
477
+	go func() {
478
+		for range dump {
479
+			dumpStacks(logger)
480
+		}
481
+	}()
482
+
483
+	go handleExitSignals(ctx, logger, shutdown)
484
+	return reap(ctx, logger, signals)
485
+}
486
+
487
+func dumpStacks(logger *logrus.Entry) {
488
+	var (
489
+		buf       []byte
490
+		stackSize int
491
+	)
492
+	bufferLen := 16384
493
+	for stackSize == len(buf) {
494
+		buf = make([]byte, bufferLen)
495
+		stackSize = runtime.Stack(buf, true)
496
+		bufferLen *= 2
497
+	}
498
+	buf = buf[:stackSize]
499
+	logger.Infof("=== BEGIN goroutine stack dump ===\n%s\n=== END goroutine stack dump ===", buf)
500
+}
0 501
new file mode 100644
... ...
@@ -0,0 +1,27 @@
0
+/*
1
+   Copyright The containerd Authors.
2
+
3
+   Licensed under the Apache License, Version 2.0 (the "License");
4
+   you may not use this file except in compliance with the License.
5
+   You may obtain a copy of the License at
6
+
7
+       http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+   Unless required by applicable law or agreed to in writing, software
10
+   distributed under the License is distributed on an "AS IS" BASIS,
11
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+   See the License for the specific language governing permissions and
13
+   limitations under the License.
14
+*/
15
+
16
+package shim
17
+
18
+import "github.com/containerd/ttrpc"
19
+
20
+func newServer() (*ttrpc.Server, error) {
21
+	return ttrpc.NewServer()
22
+}
23
+
24
+func subreaper() error {
25
+	return nil
26
+}
0 27
new file mode 100644
... ...
@@ -0,0 +1,27 @@
0
+/*
1
+   Copyright The containerd Authors.
2
+
3
+   Licensed under the Apache License, Version 2.0 (the "License");
4
+   you may not use this file except in compliance with the License.
5
+   You may obtain a copy of the License at
6
+
7
+       http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+   Unless required by applicable law or agreed to in writing, software
10
+   distributed under the License is distributed on an "AS IS" BASIS,
11
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+   See the License for the specific language governing permissions and
13
+   limitations under the License.
14
+*/
15
+
16
+package shim
17
+
18
+import "github.com/containerd/ttrpc"
19
+
20
+func newServer() (*ttrpc.Server, error) {
21
+	return ttrpc.NewServer()
22
+}
23
+
24
+func subreaper() error {
25
+	return nil
26
+}
0 27
new file mode 100644
... ...
@@ -0,0 +1,30 @@
0
+/*
1
+   Copyright The containerd Authors.
2
+
3
+   Licensed under the Apache License, Version 2.0 (the "License");
4
+   you may not use this file except in compliance with the License.
5
+   You may obtain a copy of the License at
6
+
7
+       http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+   Unless required by applicable law or agreed to in writing, software
10
+   distributed under the License is distributed on an "AS IS" BASIS,
11
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+   See the License for the specific language governing permissions and
13
+   limitations under the License.
14
+*/
15
+
16
+package shim
17
+
18
+import (
19
+	"github.com/containerd/containerd/sys/reaper"
20
+	"github.com/containerd/ttrpc"
21
+)
22
+
23
+func newServer() (*ttrpc.Server, error) {
24
+	return ttrpc.NewServer(ttrpc.WithServerHandshaker(ttrpc.UnixSocketRequireSameUser()))
25
+}
26
+
27
+func subreaper() error {
28
+	return reaper.SetSubreaper(1)
29
+}
0 30
new file mode 100644
... ...
@@ -0,0 +1,113 @@
0
+//go:build !windows
1
+// +build !windows
2
+
3
+/*
4
+   Copyright The containerd Authors.
5
+
6
+   Licensed under the Apache License, Version 2.0 (the "License");
7
+   you may not use this file except in compliance with the License.
8
+   You may obtain a copy of the License at
9
+
10
+       http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+   Unless required by applicable law or agreed to in writing, software
13
+   distributed under the License is distributed on an "AS IS" BASIS,
14
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+   See the License for the specific language governing permissions and
16
+   limitations under the License.
17
+*/
18
+
19
+package shim
20
+
21
+import (
22
+	"context"
23
+	"fmt"
24
+	"io"
25
+	"net"
26
+	"os"
27
+	"os/signal"
28
+	"syscall"
29
+
30
+	"github.com/containerd/containerd/sys/reaper"
31
+	"github.com/containerd/fifo"
32
+	"github.com/sirupsen/logrus"
33
+	"golang.org/x/sys/unix"
34
+)
35
+
36
+// setupSignals creates a new signal handler for all signals and sets the shim as a
37
+// sub-reaper so that the container processes are reparented
38
+func setupSignals(config Config) (chan os.Signal, error) {
39
+	signals := make(chan os.Signal, 32)
40
+	smp := []os.Signal{unix.SIGTERM, unix.SIGINT, unix.SIGPIPE}
41
+	if !config.NoReaper {
42
+		smp = append(smp, unix.SIGCHLD)
43
+	}
44
+	signal.Notify(signals, smp...)
45
+	return signals, nil
46
+}
47
+
48
+func setupDumpStacks(dump chan<- os.Signal) {
49
+	signal.Notify(dump, syscall.SIGUSR1)
50
+}
51
+
52
+func serveListener(path string) (net.Listener, error) {
53
+	var (
54
+		l   net.Listener
55
+		err error
56
+	)
57
+	if path == "" {
58
+		l, err = net.FileListener(os.NewFile(3, "socket"))
59
+		path = "[inherited from parent]"
60
+	} else {
61
+		if len(path) > socketPathLimit {
62
+			return nil, fmt.Errorf("%q: unix socket path too long (> %d)", path, socketPathLimit)
63
+		}
64
+		l, err = net.Listen("unix", path)
65
+	}
66
+	if err != nil {
67
+		return nil, err
68
+	}
69
+	logrus.WithField("socket", path).Debug("serving api on socket")
70
+	return l, nil
71
+}
72
+
73
+func reap(ctx context.Context, logger *logrus.Entry, signals chan os.Signal) error {
74
+	logger.Info("starting signal loop")
75
+
76
+	for {
77
+		select {
78
+		case <-ctx.Done():
79
+			return ctx.Err()
80
+		case s := <-signals:
81
+			// Exit signals are handled separately from this loop
82
+			// They get registered with this channel so that we can ignore such signals for short-running actions (e.g. `delete`)
83
+			switch s {
84
+			case unix.SIGCHLD:
85
+				if err := reaper.Reap(); err != nil {
86
+					logger.WithError(err).Error("reap exit status")
87
+				}
88
+			case unix.SIGPIPE:
89
+			}
90
+		}
91
+	}
92
+}
93
+
94
+func handleExitSignals(ctx context.Context, logger *logrus.Entry, cancel context.CancelFunc) {
95
+	ch := make(chan os.Signal, 32)
96
+	signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)
97
+
98
+	for {
99
+		select {
100
+		case s := <-ch:
101
+			logger.WithField("signal", s).Debugf("Caught exit signal")
102
+			cancel()
103
+			return
104
+		case <-ctx.Done():
105
+			return
106
+		}
107
+	}
108
+}
109
+
110
+func openLog(ctx context.Context, _ string) (io.Writer, error) {
111
+	return fifo.OpenFifoDup2(ctx, "log", unix.O_WRONLY, 0700, int(os.Stderr.Fd()))
112
+}
0 113
new file mode 100644
... ...
@@ -0,0 +1,58 @@
0
+/*
1
+   Copyright The containerd Authors.
2
+
3
+   Licensed under the Apache License, Version 2.0 (the "License");
4
+   you may not use this file except in compliance with the License.
5
+   You may obtain a copy of the License at
6
+
7
+       http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+   Unless required by applicable law or agreed to in writing, software
10
+   distributed under the License is distributed on an "AS IS" BASIS,
11
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+   See the License for the specific language governing permissions and
13
+   limitations under the License.
14
+*/
15
+
16
+package shim
17
+
18
+import (
19
+	"context"
20
+	"errors"
21
+	"io"
22
+	"net"
23
+	"os"
24
+
25
+	"github.com/containerd/ttrpc"
26
+	"github.com/sirupsen/logrus"
27
+)
28
+
29
+func setupSignals(config Config) (chan os.Signal, error) {
30
+	return nil, errors.New("not supported")
31
+}
32
+
33
+func newServer() (*ttrpc.Server, error) {
34
+	return nil, errors.New("not supported")
35
+}
36
+
37
+func subreaper() error {
38
+	return errors.New("not supported")
39
+}
40
+
41
+func setupDumpStacks(dump chan<- os.Signal) {
42
+}
43
+
44
+func serveListener(path string) (net.Listener, error) {
45
+	return nil, errors.New("not supported")
46
+}
47
+
48
+func reap(ctx context.Context, logger *logrus.Entry, signals chan os.Signal) error {
49
+	return errors.New("not supported")
50
+}
51
+
52
+func handleExitSignals(ctx context.Context, logger *logrus.Entry, cancel context.CancelFunc) {
53
+}
54
+
55
+func openLog(ctx context.Context, _ string) (io.Writer, error) {
56
+	return nil, errors.New("not supported")
57
+}
0 58
new file mode 100644
... ...
@@ -0,0 +1,169 @@
0
+/*
1
+   Copyright The containerd Authors.
2
+
3
+   Licensed under the Apache License, Version 2.0 (the "License");
4
+   you may not use this file except in compliance with the License.
5
+   You may obtain a copy of the License at
6
+
7
+       http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+   Unless required by applicable law or agreed to in writing, software
10
+   distributed under the License is distributed on an "AS IS" BASIS,
11
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+   See the License for the specific language governing permissions and
13
+   limitations under the License.
14
+*/
15
+
16
+package shim
17
+
18
+import (
19
+	"bytes"
20
+	"context"
21
+	"errors"
22
+	"fmt"
23
+	"net"
24
+	"os"
25
+	"path/filepath"
26
+	"strings"
27
+	"time"
28
+
29
+	"github.com/containerd/containerd/namespaces"
30
+	"github.com/gogo/protobuf/proto"
31
+	"github.com/gogo/protobuf/types"
32
+	exec "golang.org/x/sys/execabs"
33
+)
34
+
35
+type CommandConfig struct {
36
+	Runtime      string
37
+	Address      string
38
+	TTRPCAddress string
39
+	Path         string
40
+	SchedCore    bool
41
+	Args         []string
42
+	Opts         *types.Any
43
+}
44
+
45
+// Command returns the shim command with the provided args and configuration
46
+func Command(ctx context.Context, config *CommandConfig) (*exec.Cmd, error) {
47
+	ns, err := namespaces.NamespaceRequired(ctx)
48
+	if err != nil {
49
+		return nil, err
50
+	}
51
+	self, err := os.Executable()
52
+	if err != nil {
53
+		return nil, err
54
+	}
55
+	args := []string{
56
+		"-namespace", ns,
57
+		"-address", config.Address,
58
+		"-publish-binary", self,
59
+	}
60
+	args = append(args, config.Args...)
61
+	cmd := exec.CommandContext(ctx, config.Runtime, args...)
62
+	cmd.Dir = config.Path
63
+	cmd.Env = append(
64
+		os.Environ(),
65
+		"GOMAXPROCS=2",
66
+		fmt.Sprintf("%s=%s", ttrpcAddressEnv, config.TTRPCAddress),
67
+	)
68
+	if config.SchedCore {
69
+		cmd.Env = append(cmd.Env, "SCHED_CORE=1")
70
+	}
71
+	cmd.SysProcAttr = getSysProcAttr()
72
+	if config.Opts != nil {
73
+		d, err := proto.Marshal(config.Opts)
74
+		if err != nil {
75
+			return nil, err
76
+		}
77
+		cmd.Stdin = bytes.NewReader(d)
78
+	}
79
+	return cmd, nil
80
+}
81
+
82
+// BinaryName returns the shim binary name from the runtime name,
83
+// empty string returns means runtime name is invalid
84
+func BinaryName(runtime string) string {
85
+	// runtime name should format like $prefix.name.version
86
+	parts := strings.Split(runtime, ".")
87
+	if len(parts) < 2 {
88
+		return ""
89
+	}
90
+
91
+	return fmt.Sprintf(shimBinaryFormat, parts[len(parts)-2], parts[len(parts)-1])
92
+}
93
+
94
+// BinaryPath returns the full path for the shim binary from the runtime name,
95
+// empty string returns means runtime name is invalid
96
+func BinaryPath(runtime string) string {
97
+	dir := filepath.Dir(runtime)
98
+	binary := BinaryName(runtime)
99
+
100
+	path, err := filepath.Abs(filepath.Join(dir, binary))
101
+	if err != nil {
102
+		return ""
103
+	}
104
+
105
+	return path
106
+}
107
+
108
+// Connect to the provided address
109
+func Connect(address string, d func(string, time.Duration) (net.Conn, error)) (net.Conn, error) {
110
+	return d(address, 100*time.Second)
111
+}
112
+
113
+// WritePidFile writes a pid file atomically
114
+func WritePidFile(path string, pid int) error {
115
+	path, err := filepath.Abs(path)
116
+	if err != nil {
117
+		return err
118
+	}
119
+	tempPath := filepath.Join(filepath.Dir(path), fmt.Sprintf(".%s", filepath.Base(path)))
120
+	f, err := os.OpenFile(tempPath, os.O_RDWR|os.O_CREATE|os.O_EXCL|os.O_SYNC, 0666)
121
+	if err != nil {
122
+		return err
123
+	}
124
+	_, err = fmt.Fprintf(f, "%d", pid)
125
+	f.Close()
126
+	if err != nil {
127
+		return err
128
+	}
129
+	return os.Rename(tempPath, path)
130
+}
131
+
132
+// WriteAddress writes a address file atomically
133
+func WriteAddress(path, address string) error {
134
+	path, err := filepath.Abs(path)
135
+	if err != nil {
136
+		return err
137
+	}
138
+	tempPath := filepath.Join(filepath.Dir(path), fmt.Sprintf(".%s", filepath.Base(path)))
139
+	f, err := os.OpenFile(tempPath, os.O_RDWR|os.O_CREATE|os.O_EXCL|os.O_SYNC, 0666)
140
+	if err != nil {
141
+		return err
142
+	}
143
+	_, err = f.WriteString(address)
144
+	f.Close()
145
+	if err != nil {
146
+		return err
147
+	}
148
+	return os.Rename(tempPath, path)
149
+}
150
+
151
+// ErrNoAddress is returned when the address file has no content
152
+var ErrNoAddress = errors.New("no shim address")
153
+
154
+// ReadAddress returns the shim's socket address from the path
155
+func ReadAddress(path string) (string, error) {
156
+	path, err := filepath.Abs(path)
157
+	if err != nil {
158
+		return "", err
159
+	}
160
+	data, err := os.ReadFile(path)
161
+	if err != nil {
162
+		return "", err
163
+	}
164
+	if len(data) == 0 {
165
+		return "", ErrNoAddress
166
+	}
167
+	return string(data), nil
168
+}
0 169
new file mode 100644
... ...
@@ -0,0 +1,173 @@
0
+//go:build !windows
1
+// +build !windows
2
+
3
+/*
4
+   Copyright The containerd Authors.
5
+
6
+   Licensed under the Apache License, Version 2.0 (the "License");
7
+   you may not use this file except in compliance with the License.
8
+   You may obtain a copy of the License at
9
+
10
+       http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+   Unless required by applicable law or agreed to in writing, software
13
+   distributed under the License is distributed on an "AS IS" BASIS,
14
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+   See the License for the specific language governing permissions and
16
+   limitations under the License.
17
+*/
18
+
19
+package shim
20
+
21
+import (
22
+	"context"
23
+	"crypto/sha256"
24
+	"fmt"
25
+	"net"
26
+	"os"
27
+	"path/filepath"
28
+	"strings"
29
+	"syscall"
30
+	"time"
31
+
32
+	"github.com/containerd/containerd/defaults"
33
+	"github.com/containerd/containerd/namespaces"
34
+	"github.com/containerd/containerd/sys"
35
+)
36
+
37
+const (
38
+	shimBinaryFormat = "containerd-shim-%s-%s"
39
+	socketPathLimit  = 106
40
+)
41
+
42
+func getSysProcAttr() *syscall.SysProcAttr {
43
+	return &syscall.SysProcAttr{
44
+		Setpgid: true,
45
+	}
46
+}
47
+
48
+// AdjustOOMScore sets the OOM score for the process to the parents OOM score +1
49
+// to ensure that they parent has a lower* score than the shim
50
+// if not already at the maximum OOM Score
51
+func AdjustOOMScore(pid int) error {
52
+	parent := os.Getppid()
53
+	score, err := sys.GetOOMScoreAdj(parent)
54
+	if err != nil {
55
+		return fmt.Errorf("get parent OOM score: %w", err)
56
+	}
57
+	shimScore := score + 1
58
+	if err := sys.AdjustOOMScore(pid, shimScore); err != nil {
59
+		return fmt.Errorf("set shim OOM score: %w", err)
60
+	}
61
+	return nil
62
+}
63
+
64
+const socketRoot = defaults.DefaultStateDir
65
+
66
+// SocketAddress returns a socket address
67
+func SocketAddress(ctx context.Context, socketPath, id string) (string, error) {
68
+	ns, err := namespaces.NamespaceRequired(ctx)
69
+	if err != nil {
70
+		return "", err
71
+	}
72
+	d := sha256.Sum256([]byte(filepath.Join(socketPath, ns, id)))
73
+	return fmt.Sprintf("unix://%s/%x", filepath.Join(socketRoot, "s"), d), nil
74
+}
75
+
76
+// AnonDialer returns a dialer for a socket
77
+func AnonDialer(address string, timeout time.Duration) (net.Conn, error) {
78
+	return net.DialTimeout("unix", socket(address).path(), timeout)
79
+}
80
+
81
+// AnonReconnectDialer returns a dialer for an existing socket on reconnection
82
+func AnonReconnectDialer(address string, timeout time.Duration) (net.Conn, error) {
83
+	return AnonDialer(address, timeout)
84
+}
85
+
86
+// NewSocket returns a new socket
87
+func NewSocket(address string) (*net.UnixListener, error) {
88
+	var (
89
+		sock = socket(address)
90
+		path = sock.path()
91
+	)
92
+
93
+	isAbstract := sock.isAbstract()
94
+
95
+	if !isAbstract {
96
+		if err := os.MkdirAll(filepath.Dir(path), 0600); err != nil {
97
+			return nil, fmt.Errorf("%s: %w", path, err)
98
+		}
99
+	}
100
+	l, err := net.Listen("unix", path)
101
+	if err != nil {
102
+		return nil, err
103
+	}
104
+
105
+	if !isAbstract {
106
+		if err := os.Chmod(path, 0600); err != nil {
107
+			os.Remove(sock.path())
108
+			l.Close()
109
+			return nil, err
110
+		}
111
+	}
112
+	return l.(*net.UnixListener), nil
113
+}
114
+
115
+const abstractSocketPrefix = "\x00"
116
+
117
+type socket string
118
+
119
+func (s socket) isAbstract() bool {
120
+	return !strings.HasPrefix(string(s), "unix://")
121
+}
122
+
123
+func (s socket) path() string {
124
+	path := strings.TrimPrefix(string(s), "unix://")
125
+	// if there was no trim performed, we assume an abstract socket
126
+	if len(path) == len(s) {
127
+		path = abstractSocketPrefix + path
128
+	}
129
+	return path
130
+}
131
+
132
+// RemoveSocket removes the socket at the specified address if
133
+// it exists on the filesystem
134
+func RemoveSocket(address string) error {
135
+	sock := socket(address)
136
+	if !sock.isAbstract() {
137
+		return os.Remove(sock.path())
138
+	}
139
+	return nil
140
+}
141
+
142
+// SocketEaddrinuse returns true if the provided error is caused by the
143
+// EADDRINUSE error number
144
+func SocketEaddrinuse(err error) bool {
145
+	netErr, ok := err.(*net.OpError)
146
+	if !ok {
147
+		return false
148
+	}
149
+	if netErr.Op != "listen" {
150
+		return false
151
+	}
152
+	syscallErr, ok := netErr.Err.(*os.SyscallError)
153
+	if !ok {
154
+		return false
155
+	}
156
+	errno, ok := syscallErr.Err.(syscall.Errno)
157
+	if !ok {
158
+		return false
159
+	}
160
+	return errno == syscall.EADDRINUSE
161
+}
162
+
163
+// CanConnect returns true if the socket provided at the address
164
+// is accepting new connections
165
+func CanConnect(address string) bool {
166
+	conn, err := AnonDialer(address, 100*time.Millisecond)
167
+	if err != nil {
168
+		return false
169
+	}
170
+	conn.Close()
171
+	return true
172
+}
0 173
new file mode 100644
... ...
@@ -0,0 +1,87 @@
0
+/*
1
+   Copyright The containerd Authors.
2
+
3
+   Licensed under the Apache License, Version 2.0 (the "License");
4
+   you may not use this file except in compliance with the License.
5
+   You may obtain a copy of the License at
6
+
7
+       http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+   Unless required by applicable law or agreed to in writing, software
10
+   distributed under the License is distributed on an "AS IS" BASIS,
11
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+   See the License for the specific language governing permissions and
13
+   limitations under the License.
14
+*/
15
+
16
+package shim
17
+
18
+import (
19
+	"context"
20
+	"fmt"
21
+	"net"
22
+	"os"
23
+	"syscall"
24
+	"time"
25
+
26
+	winio "github.com/Microsoft/go-winio"
27
+)
28
+
29
+const shimBinaryFormat = "containerd-shim-%s-%s.exe"
30
+
31
+func getSysProcAttr() *syscall.SysProcAttr {
32
+	return nil
33
+}
34
+
35
+// AnonReconnectDialer returns a dialer for an existing npipe on containerd reconnection
36
+func AnonReconnectDialer(address string, timeout time.Duration) (net.Conn, error) {
37
+	ctx, cancel := context.WithTimeout(context.Background(), timeout)
38
+	defer cancel()
39
+
40
+	c, err := winio.DialPipeContext(ctx, address)
41
+	if os.IsNotExist(err) {
42
+		return nil, fmt.Errorf("npipe not found on reconnect: %w", os.ErrNotExist)
43
+	} else if err == context.DeadlineExceeded {
44
+		return nil, fmt.Errorf("timed out waiting for npipe %s: %w", address, err)
45
+	} else if err != nil {
46
+		return nil, err
47
+	}
48
+	return c, nil
49
+}
50
+
51
+// AnonDialer returns a dialer for a npipe
52
+func AnonDialer(address string, timeout time.Duration) (net.Conn, error) {
53
+	ctx, cancel := context.WithTimeout(context.Background(), timeout)
54
+	defer cancel()
55
+
56
+	// If there is nobody serving the pipe we limit the timeout for this case to
57
+	// 5 seconds because any shim that would serve this endpoint should serve it
58
+	// within 5 seconds.
59
+	serveTimer := time.NewTimer(5 * time.Second)
60
+	defer serveTimer.Stop()
61
+	for {
62
+		c, err := winio.DialPipeContext(ctx, address)
63
+		if err != nil {
64
+			if os.IsNotExist(err) {
65
+				select {
66
+				case <-serveTimer.C:
67
+					return nil, fmt.Errorf("pipe not found before timeout: %w", os.ErrNotExist)
68
+				default:
69
+					// Wait 10ms for the shim to serve and try again.
70
+					time.Sleep(10 * time.Millisecond)
71
+					continue
72
+				}
73
+			} else if err == context.DeadlineExceeded {
74
+				return nil, fmt.Errorf("timed out waiting for npipe %s: %w", address, err)
75
+			}
76
+			return nil, err
77
+		}
78
+		return c, nil
79
+	}
80
+}
81
+
82
+// RemoveSocket removes the socket at the specified address if
83
+// it exists on the filesystem
84
+func RemoveSocket(address string) error {
85
+	return nil
86
+}
0 87
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+/*
1
+   Copyright The containerd Authors.
2
+
3
+   Licensed under the Apache License, Version 2.0 (the "License");
4
+   you may not use this file except in compliance with the License.
5
+   You may obtain a copy of the License at
6
+
7
+       http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+   Unless required by applicable law or agreed to in writing, software
10
+   distributed under the License is distributed on an "AS IS" BASIS,
11
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+   See the License for the specific language governing permissions and
13
+   limitations under the License.
14
+*/
15
+
16
+package task
0 17
new file mode 100644
... ...
@@ -0,0 +1,7312 @@
0
+// Code generated by protoc-gen-gogo. DO NOT EDIT.
1
+// source: github.com/containerd/containerd/runtime/v2/task/shim.proto
2
+
3
+package task
4
+
5
+import (
6
+	context "context"
7
+	fmt "fmt"
8
+	types "github.com/containerd/containerd/api/types"
9
+	task "github.com/containerd/containerd/api/types/task"
10
+	github_com_containerd_ttrpc "github.com/containerd/ttrpc"
11
+	proto "github.com/gogo/protobuf/proto"
12
+	github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
13
+	github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
14
+	types1 "github.com/gogo/protobuf/types"
15
+	io "io"
16
+	math "math"
17
+	math_bits "math/bits"
18
+	reflect "reflect"
19
+	strings "strings"
20
+	time "time"
21
+)
22
+
23
+// Reference imports to suppress errors if they are not otherwise used.
24
+var _ = proto.Marshal
25
+var _ = fmt.Errorf
26
+var _ = math.Inf
27
+var _ = time.Kitchen
28
+
29
+// This is a compile-time assertion to ensure that this generated file
30
+// is compatible with the proto package it is being compiled against.
31
+// A compilation error at this line likely means your copy of the
32
+// proto package needs to be updated.
33
+const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
34
+
35
+type CreateTaskRequest struct {
36
+	ID                   string         `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
37
+	Bundle               string         `protobuf:"bytes,2,opt,name=bundle,proto3" json:"bundle,omitempty"`
38
+	Rootfs               []*types.Mount `protobuf:"bytes,3,rep,name=rootfs,proto3" json:"rootfs,omitempty"`
39
+	Terminal             bool           `protobuf:"varint,4,opt,name=terminal,proto3" json:"terminal,omitempty"`
40
+	Stdin                string         `protobuf:"bytes,5,opt,name=stdin,proto3" json:"stdin,omitempty"`
41
+	Stdout               string         `protobuf:"bytes,6,opt,name=stdout,proto3" json:"stdout,omitempty"`
42
+	Stderr               string         `protobuf:"bytes,7,opt,name=stderr,proto3" json:"stderr,omitempty"`
43
+	Checkpoint           string         `protobuf:"bytes,8,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"`
44
+	ParentCheckpoint     string         `protobuf:"bytes,9,opt,name=parent_checkpoint,json=parentCheckpoint,proto3" json:"parent_checkpoint,omitempty"`
45
+	Options              *types1.Any    `protobuf:"bytes,10,opt,name=options,proto3" json:"options,omitempty"`
46
+	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
47
+	XXX_unrecognized     []byte         `json:"-"`
48
+	XXX_sizecache        int32          `json:"-"`
49
+}
50
+
51
+func (m *CreateTaskRequest) Reset()      { *m = CreateTaskRequest{} }
52
+func (*CreateTaskRequest) ProtoMessage() {}
53
+func (*CreateTaskRequest) Descriptor() ([]byte, []int) {
54
+	return fileDescriptor_9202ee34bc3ad8ca, []int{0}
55
+}
56
+func (m *CreateTaskRequest) XXX_Unmarshal(b []byte) error {
57
+	return m.Unmarshal(b)
58
+}
59
+func (m *CreateTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
60
+	if deterministic {
61
+		return xxx_messageInfo_CreateTaskRequest.Marshal(b, m, deterministic)
62
+	} else {
63
+		b = b[:cap(b)]
64
+		n, err := m.MarshalToSizedBuffer(b)
65
+		if err != nil {
66
+			return nil, err
67
+		}
68
+		return b[:n], nil
69
+	}
70
+}
71
+func (m *CreateTaskRequest) XXX_Merge(src proto.Message) {
72
+	xxx_messageInfo_CreateTaskRequest.Merge(m, src)
73
+}
74
+func (m *CreateTaskRequest) XXX_Size() int {
75
+	return m.Size()
76
+}
77
+func (m *CreateTaskRequest) XXX_DiscardUnknown() {
78
+	xxx_messageInfo_CreateTaskRequest.DiscardUnknown(m)
79
+}
80
+
81
+var xxx_messageInfo_CreateTaskRequest proto.InternalMessageInfo
82
+
83
+type CreateTaskResponse struct {
84
+	Pid                  uint32   `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
85
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
86
+	XXX_unrecognized     []byte   `json:"-"`
87
+	XXX_sizecache        int32    `json:"-"`
88
+}
89
+
90
+func (m *CreateTaskResponse) Reset()      { *m = CreateTaskResponse{} }
91
+func (*CreateTaskResponse) ProtoMessage() {}
92
+func (*CreateTaskResponse) Descriptor() ([]byte, []int) {
93
+	return fileDescriptor_9202ee34bc3ad8ca, []int{1}
94
+}
95
+func (m *CreateTaskResponse) XXX_Unmarshal(b []byte) error {
96
+	return m.Unmarshal(b)
97
+}
98
+func (m *CreateTaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
99
+	if deterministic {
100
+		return xxx_messageInfo_CreateTaskResponse.Marshal(b, m, deterministic)
101
+	} else {
102
+		b = b[:cap(b)]
103
+		n, err := m.MarshalToSizedBuffer(b)
104
+		if err != nil {
105
+			return nil, err
106
+		}
107
+		return b[:n], nil
108
+	}
109
+}
110
+func (m *CreateTaskResponse) XXX_Merge(src proto.Message) {
111
+	xxx_messageInfo_CreateTaskResponse.Merge(m, src)
112
+}
113
+func (m *CreateTaskResponse) XXX_Size() int {
114
+	return m.Size()
115
+}
116
+func (m *CreateTaskResponse) XXX_DiscardUnknown() {
117
+	xxx_messageInfo_CreateTaskResponse.DiscardUnknown(m)
118
+}
119
+
120
+var xxx_messageInfo_CreateTaskResponse proto.InternalMessageInfo
121
+
122
+type DeleteRequest struct {
123
+	ID                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
124
+	ExecID               string   `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
125
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
126
+	XXX_unrecognized     []byte   `json:"-"`
127
+	XXX_sizecache        int32    `json:"-"`
128
+}
129
+
130
+func (m *DeleteRequest) Reset()      { *m = DeleteRequest{} }
131
+func (*DeleteRequest) ProtoMessage() {}
132
+func (*DeleteRequest) Descriptor() ([]byte, []int) {
133
+	return fileDescriptor_9202ee34bc3ad8ca, []int{2}
134
+}
135
+func (m *DeleteRequest) XXX_Unmarshal(b []byte) error {
136
+	return m.Unmarshal(b)
137
+}
138
+func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
139
+	if deterministic {
140
+		return xxx_messageInfo_DeleteRequest.Marshal(b, m, deterministic)
141
+	} else {
142
+		b = b[:cap(b)]
143
+		n, err := m.MarshalToSizedBuffer(b)
144
+		if err != nil {
145
+			return nil, err
146
+		}
147
+		return b[:n], nil
148
+	}
149
+}
150
+func (m *DeleteRequest) XXX_Merge(src proto.Message) {
151
+	xxx_messageInfo_DeleteRequest.Merge(m, src)
152
+}
153
+func (m *DeleteRequest) XXX_Size() int {
154
+	return m.Size()
155
+}
156
+func (m *DeleteRequest) XXX_DiscardUnknown() {
157
+	xxx_messageInfo_DeleteRequest.DiscardUnknown(m)
158
+}
159
+
160
+var xxx_messageInfo_DeleteRequest proto.InternalMessageInfo
161
+
162
+type DeleteResponse struct {
163
+	Pid                  uint32    `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
164
+	ExitStatus           uint32    `protobuf:"varint,2,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
165
+	ExitedAt             time.Time `protobuf:"bytes,3,opt,name=exited_at,json=exitedAt,proto3,stdtime" json:"exited_at"`
166
+	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
167
+	XXX_unrecognized     []byte    `json:"-"`
168
+	XXX_sizecache        int32     `json:"-"`
169
+}
170
+
171
+func (m *DeleteResponse) Reset()      { *m = DeleteResponse{} }
172
+func (*DeleteResponse) ProtoMessage() {}
173
+func (*DeleteResponse) Descriptor() ([]byte, []int) {
174
+	return fileDescriptor_9202ee34bc3ad8ca, []int{3}
175
+}
176
+func (m *DeleteResponse) XXX_Unmarshal(b []byte) error {
177
+	return m.Unmarshal(b)
178
+}
179
+func (m *DeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
180
+	if deterministic {
181
+		return xxx_messageInfo_DeleteResponse.Marshal(b, m, deterministic)
182
+	} else {
183
+		b = b[:cap(b)]
184
+		n, err := m.MarshalToSizedBuffer(b)
185
+		if err != nil {
186
+			return nil, err
187
+		}
188
+		return b[:n], nil
189
+	}
190
+}
191
+func (m *DeleteResponse) XXX_Merge(src proto.Message) {
192
+	xxx_messageInfo_DeleteResponse.Merge(m, src)
193
+}
194
+func (m *DeleteResponse) XXX_Size() int {
195
+	return m.Size()
196
+}
197
+func (m *DeleteResponse) XXX_DiscardUnknown() {
198
+	xxx_messageInfo_DeleteResponse.DiscardUnknown(m)
199
+}
200
+
201
+var xxx_messageInfo_DeleteResponse proto.InternalMessageInfo
202
+
203
+type ExecProcessRequest struct {
204
+	ID                   string      `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
205
+	ExecID               string      `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
206
+	Terminal             bool        `protobuf:"varint,3,opt,name=terminal,proto3" json:"terminal,omitempty"`
207
+	Stdin                string      `protobuf:"bytes,4,opt,name=stdin,proto3" json:"stdin,omitempty"`
208
+	Stdout               string      `protobuf:"bytes,5,opt,name=stdout,proto3" json:"stdout,omitempty"`
209
+	Stderr               string      `protobuf:"bytes,6,opt,name=stderr,proto3" json:"stderr,omitempty"`
210
+	Spec                 *types1.Any `protobuf:"bytes,7,opt,name=spec,proto3" json:"spec,omitempty"`
211
+	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
212
+	XXX_unrecognized     []byte      `json:"-"`
213
+	XXX_sizecache        int32       `json:"-"`
214
+}
215
+
216
+func (m *ExecProcessRequest) Reset()      { *m = ExecProcessRequest{} }
217
+func (*ExecProcessRequest) ProtoMessage() {}
218
+func (*ExecProcessRequest) Descriptor() ([]byte, []int) {
219
+	return fileDescriptor_9202ee34bc3ad8ca, []int{4}
220
+}
221
+func (m *ExecProcessRequest) XXX_Unmarshal(b []byte) error {
222
+	return m.Unmarshal(b)
223
+}
224
+func (m *ExecProcessRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
225
+	if deterministic {
226
+		return xxx_messageInfo_ExecProcessRequest.Marshal(b, m, deterministic)
227
+	} else {
228
+		b = b[:cap(b)]
229
+		n, err := m.MarshalToSizedBuffer(b)
230
+		if err != nil {
231
+			return nil, err
232
+		}
233
+		return b[:n], nil
234
+	}
235
+}
236
+func (m *ExecProcessRequest) XXX_Merge(src proto.Message) {
237
+	xxx_messageInfo_ExecProcessRequest.Merge(m, src)
238
+}
239
+func (m *ExecProcessRequest) XXX_Size() int {
240
+	return m.Size()
241
+}
242
+func (m *ExecProcessRequest) XXX_DiscardUnknown() {
243
+	xxx_messageInfo_ExecProcessRequest.DiscardUnknown(m)
244
+}
245
+
246
+var xxx_messageInfo_ExecProcessRequest proto.InternalMessageInfo
247
+
248
+type ExecProcessResponse struct {
249
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
250
+	XXX_unrecognized     []byte   `json:"-"`
251
+	XXX_sizecache        int32    `json:"-"`
252
+}
253
+
254
+func (m *ExecProcessResponse) Reset()      { *m = ExecProcessResponse{} }
255
+func (*ExecProcessResponse) ProtoMessage() {}
256
+func (*ExecProcessResponse) Descriptor() ([]byte, []int) {
257
+	return fileDescriptor_9202ee34bc3ad8ca, []int{5}
258
+}
259
+func (m *ExecProcessResponse) XXX_Unmarshal(b []byte) error {
260
+	return m.Unmarshal(b)
261
+}
262
+func (m *ExecProcessResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
263
+	if deterministic {
264
+		return xxx_messageInfo_ExecProcessResponse.Marshal(b, m, deterministic)
265
+	} else {
266
+		b = b[:cap(b)]
267
+		n, err := m.MarshalToSizedBuffer(b)
268
+		if err != nil {
269
+			return nil, err
270
+		}
271
+		return b[:n], nil
272
+	}
273
+}
274
+func (m *ExecProcessResponse) XXX_Merge(src proto.Message) {
275
+	xxx_messageInfo_ExecProcessResponse.Merge(m, src)
276
+}
277
+func (m *ExecProcessResponse) XXX_Size() int {
278
+	return m.Size()
279
+}
280
+func (m *ExecProcessResponse) XXX_DiscardUnknown() {
281
+	xxx_messageInfo_ExecProcessResponse.DiscardUnknown(m)
282
+}
283
+
284
+var xxx_messageInfo_ExecProcessResponse proto.InternalMessageInfo
285
+
286
+type ResizePtyRequest struct {
287
+	ID                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
288
+	ExecID               string   `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
289
+	Width                uint32   `protobuf:"varint,3,opt,name=width,proto3" json:"width,omitempty"`
290
+	Height               uint32   `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"`
291
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
292
+	XXX_unrecognized     []byte   `json:"-"`
293
+	XXX_sizecache        int32    `json:"-"`
294
+}
295
+
296
+func (m *ResizePtyRequest) Reset()      { *m = ResizePtyRequest{} }
297
+func (*ResizePtyRequest) ProtoMessage() {}
298
+func (*ResizePtyRequest) Descriptor() ([]byte, []int) {
299
+	return fileDescriptor_9202ee34bc3ad8ca, []int{6}
300
+}
301
+func (m *ResizePtyRequest) XXX_Unmarshal(b []byte) error {
302
+	return m.Unmarshal(b)
303
+}
304
+func (m *ResizePtyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
305
+	if deterministic {
306
+		return xxx_messageInfo_ResizePtyRequest.Marshal(b, m, deterministic)
307
+	} else {
308
+		b = b[:cap(b)]
309
+		n, err := m.MarshalToSizedBuffer(b)
310
+		if err != nil {
311
+			return nil, err
312
+		}
313
+		return b[:n], nil
314
+	}
315
+}
316
+func (m *ResizePtyRequest) XXX_Merge(src proto.Message) {
317
+	xxx_messageInfo_ResizePtyRequest.Merge(m, src)
318
+}
319
+func (m *ResizePtyRequest) XXX_Size() int {
320
+	return m.Size()
321
+}
322
+func (m *ResizePtyRequest) XXX_DiscardUnknown() {
323
+	xxx_messageInfo_ResizePtyRequest.DiscardUnknown(m)
324
+}
325
+
326
+var xxx_messageInfo_ResizePtyRequest proto.InternalMessageInfo
327
+
328
+type StateRequest struct {
329
+	ID                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
330
+	ExecID               string   `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
331
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
332
+	XXX_unrecognized     []byte   `json:"-"`
333
+	XXX_sizecache        int32    `json:"-"`
334
+}
335
+
336
+func (m *StateRequest) Reset()      { *m = StateRequest{} }
337
+func (*StateRequest) ProtoMessage() {}
338
+func (*StateRequest) Descriptor() ([]byte, []int) {
339
+	return fileDescriptor_9202ee34bc3ad8ca, []int{7}
340
+}
341
+func (m *StateRequest) XXX_Unmarshal(b []byte) error {
342
+	return m.Unmarshal(b)
343
+}
344
+func (m *StateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
345
+	if deterministic {
346
+		return xxx_messageInfo_StateRequest.Marshal(b, m, deterministic)
347
+	} else {
348
+		b = b[:cap(b)]
349
+		n, err := m.MarshalToSizedBuffer(b)
350
+		if err != nil {
351
+			return nil, err
352
+		}
353
+		return b[:n], nil
354
+	}
355
+}
356
+func (m *StateRequest) XXX_Merge(src proto.Message) {
357
+	xxx_messageInfo_StateRequest.Merge(m, src)
358
+}
359
+func (m *StateRequest) XXX_Size() int {
360
+	return m.Size()
361
+}
362
+func (m *StateRequest) XXX_DiscardUnknown() {
363
+	xxx_messageInfo_StateRequest.DiscardUnknown(m)
364
+}
365
+
366
+var xxx_messageInfo_StateRequest proto.InternalMessageInfo
367
+
368
+type StateResponse struct {
369
+	ID                   string      `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
370
+	Bundle               string      `protobuf:"bytes,2,opt,name=bundle,proto3" json:"bundle,omitempty"`
371
+	Pid                  uint32      `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"`
372
+	Status               task.Status `protobuf:"varint,4,opt,name=status,proto3,enum=containerd.v1.types.Status" json:"status,omitempty"`
373
+	Stdin                string      `protobuf:"bytes,5,opt,name=stdin,proto3" json:"stdin,omitempty"`
374
+	Stdout               string      `protobuf:"bytes,6,opt,name=stdout,proto3" json:"stdout,omitempty"`
375
+	Stderr               string      `protobuf:"bytes,7,opt,name=stderr,proto3" json:"stderr,omitempty"`
376
+	Terminal             bool        `protobuf:"varint,8,opt,name=terminal,proto3" json:"terminal,omitempty"`
377
+	ExitStatus           uint32      `protobuf:"varint,9,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
378
+	ExitedAt             time.Time   `protobuf:"bytes,10,opt,name=exited_at,json=exitedAt,proto3,stdtime" json:"exited_at"`
379
+	ExecID               string      `protobuf:"bytes,11,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
380
+	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
381
+	XXX_unrecognized     []byte      `json:"-"`
382
+	XXX_sizecache        int32       `json:"-"`
383
+}
384
+
385
+func (m *StateResponse) Reset()      { *m = StateResponse{} }
386
+func (*StateResponse) ProtoMessage() {}
387
+func (*StateResponse) Descriptor() ([]byte, []int) {
388
+	return fileDescriptor_9202ee34bc3ad8ca, []int{8}
389
+}
390
+func (m *StateResponse) XXX_Unmarshal(b []byte) error {
391
+	return m.Unmarshal(b)
392
+}
393
+func (m *StateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
394
+	if deterministic {
395
+		return xxx_messageInfo_StateResponse.Marshal(b, m, deterministic)
396
+	} else {
397
+		b = b[:cap(b)]
398
+		n, err := m.MarshalToSizedBuffer(b)
399
+		if err != nil {
400
+			return nil, err
401
+		}
402
+		return b[:n], nil
403
+	}
404
+}
405
+func (m *StateResponse) XXX_Merge(src proto.Message) {
406
+	xxx_messageInfo_StateResponse.Merge(m, src)
407
+}
408
+func (m *StateResponse) XXX_Size() int {
409
+	return m.Size()
410
+}
411
+func (m *StateResponse) XXX_DiscardUnknown() {
412
+	xxx_messageInfo_StateResponse.DiscardUnknown(m)
413
+}
414
+
415
+var xxx_messageInfo_StateResponse proto.InternalMessageInfo
416
+
417
+type KillRequest struct {
418
+	ID                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
419
+	ExecID               string   `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
420
+	Signal               uint32   `protobuf:"varint,3,opt,name=signal,proto3" json:"signal,omitempty"`
421
+	All                  bool     `protobuf:"varint,4,opt,name=all,proto3" json:"all,omitempty"`
422
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
423
+	XXX_unrecognized     []byte   `json:"-"`
424
+	XXX_sizecache        int32    `json:"-"`
425
+}
426
+
427
+func (m *KillRequest) Reset()      { *m = KillRequest{} }
428
+func (*KillRequest) ProtoMessage() {}
429
+func (*KillRequest) Descriptor() ([]byte, []int) {
430
+	return fileDescriptor_9202ee34bc3ad8ca, []int{9}
431
+}
432
+func (m *KillRequest) XXX_Unmarshal(b []byte) error {
433
+	return m.Unmarshal(b)
434
+}
435
+func (m *KillRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
436
+	if deterministic {
437
+		return xxx_messageInfo_KillRequest.Marshal(b, m, deterministic)
438
+	} else {
439
+		b = b[:cap(b)]
440
+		n, err := m.MarshalToSizedBuffer(b)
441
+		if err != nil {
442
+			return nil, err
443
+		}
444
+		return b[:n], nil
445
+	}
446
+}
447
+func (m *KillRequest) XXX_Merge(src proto.Message) {
448
+	xxx_messageInfo_KillRequest.Merge(m, src)
449
+}
450
+func (m *KillRequest) XXX_Size() int {
451
+	return m.Size()
452
+}
453
+func (m *KillRequest) XXX_DiscardUnknown() {
454
+	xxx_messageInfo_KillRequest.DiscardUnknown(m)
455
+}
456
+
457
+var xxx_messageInfo_KillRequest proto.InternalMessageInfo
458
+
459
+type CloseIORequest struct {
460
+	ID                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
461
+	ExecID               string   `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
462
+	Stdin                bool     `protobuf:"varint,3,opt,name=stdin,proto3" json:"stdin,omitempty"`
463
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
464
+	XXX_unrecognized     []byte   `json:"-"`
465
+	XXX_sizecache        int32    `json:"-"`
466
+}
467
+
468
+func (m *CloseIORequest) Reset()      { *m = CloseIORequest{} }
469
+func (*CloseIORequest) ProtoMessage() {}
470
+func (*CloseIORequest) Descriptor() ([]byte, []int) {
471
+	return fileDescriptor_9202ee34bc3ad8ca, []int{10}
472
+}
473
+func (m *CloseIORequest) XXX_Unmarshal(b []byte) error {
474
+	return m.Unmarshal(b)
475
+}
476
+func (m *CloseIORequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
477
+	if deterministic {
478
+		return xxx_messageInfo_CloseIORequest.Marshal(b, m, deterministic)
479
+	} else {
480
+		b = b[:cap(b)]
481
+		n, err := m.MarshalToSizedBuffer(b)
482
+		if err != nil {
483
+			return nil, err
484
+		}
485
+		return b[:n], nil
486
+	}
487
+}
488
+func (m *CloseIORequest) XXX_Merge(src proto.Message) {
489
+	xxx_messageInfo_CloseIORequest.Merge(m, src)
490
+}
491
+func (m *CloseIORequest) XXX_Size() int {
492
+	return m.Size()
493
+}
494
+func (m *CloseIORequest) XXX_DiscardUnknown() {
495
+	xxx_messageInfo_CloseIORequest.DiscardUnknown(m)
496
+}
497
+
498
+var xxx_messageInfo_CloseIORequest proto.InternalMessageInfo
499
+
500
+type PidsRequest struct {
501
+	ID                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
502
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
503
+	XXX_unrecognized     []byte   `json:"-"`
504
+	XXX_sizecache        int32    `json:"-"`
505
+}
506
+
507
+func (m *PidsRequest) Reset()      { *m = PidsRequest{} }
508
+func (*PidsRequest) ProtoMessage() {}
509
+func (*PidsRequest) Descriptor() ([]byte, []int) {
510
+	return fileDescriptor_9202ee34bc3ad8ca, []int{11}
511
+}
512
+func (m *PidsRequest) XXX_Unmarshal(b []byte) error {
513
+	return m.Unmarshal(b)
514
+}
515
+func (m *PidsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
516
+	if deterministic {
517
+		return xxx_messageInfo_PidsRequest.Marshal(b, m, deterministic)
518
+	} else {
519
+		b = b[:cap(b)]
520
+		n, err := m.MarshalToSizedBuffer(b)
521
+		if err != nil {
522
+			return nil, err
523
+		}
524
+		return b[:n], nil
525
+	}
526
+}
527
+func (m *PidsRequest) XXX_Merge(src proto.Message) {
528
+	xxx_messageInfo_PidsRequest.Merge(m, src)
529
+}
530
+func (m *PidsRequest) XXX_Size() int {
531
+	return m.Size()
532
+}
533
+func (m *PidsRequest) XXX_DiscardUnknown() {
534
+	xxx_messageInfo_PidsRequest.DiscardUnknown(m)
535
+}
536
+
537
+var xxx_messageInfo_PidsRequest proto.InternalMessageInfo
538
+
539
+type PidsResponse struct {
540
+	Processes            []*task.ProcessInfo `protobuf:"bytes,1,rep,name=processes,proto3" json:"processes,omitempty"`
541
+	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
542
+	XXX_unrecognized     []byte              `json:"-"`
543
+	XXX_sizecache        int32               `json:"-"`
544
+}
545
+
546
+func (m *PidsResponse) Reset()      { *m = PidsResponse{} }
547
+func (*PidsResponse) ProtoMessage() {}
548
+func (*PidsResponse) Descriptor() ([]byte, []int) {
549
+	return fileDescriptor_9202ee34bc3ad8ca, []int{12}
550
+}
551
+func (m *PidsResponse) XXX_Unmarshal(b []byte) error {
552
+	return m.Unmarshal(b)
553
+}
554
+func (m *PidsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
555
+	if deterministic {
556
+		return xxx_messageInfo_PidsResponse.Marshal(b, m, deterministic)
557
+	} else {
558
+		b = b[:cap(b)]
559
+		n, err := m.MarshalToSizedBuffer(b)
560
+		if err != nil {
561
+			return nil, err
562
+		}
563
+		return b[:n], nil
564
+	}
565
+}
566
+func (m *PidsResponse) XXX_Merge(src proto.Message) {
567
+	xxx_messageInfo_PidsResponse.Merge(m, src)
568
+}
569
+func (m *PidsResponse) XXX_Size() int {
570
+	return m.Size()
571
+}
572
+func (m *PidsResponse) XXX_DiscardUnknown() {
573
+	xxx_messageInfo_PidsResponse.DiscardUnknown(m)
574
+}
575
+
576
+var xxx_messageInfo_PidsResponse proto.InternalMessageInfo
577
+
578
+type CheckpointTaskRequest struct {
579
+	ID                   string      `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
580
+	Path                 string      `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
581
+	Options              *types1.Any `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"`
582
+	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
583
+	XXX_unrecognized     []byte      `json:"-"`
584
+	XXX_sizecache        int32       `json:"-"`
585
+}
586
+
587
+func (m *CheckpointTaskRequest) Reset()      { *m = CheckpointTaskRequest{} }
588
+func (*CheckpointTaskRequest) ProtoMessage() {}
589
+func (*CheckpointTaskRequest) Descriptor() ([]byte, []int) {
590
+	return fileDescriptor_9202ee34bc3ad8ca, []int{13}
591
+}
592
+func (m *CheckpointTaskRequest) XXX_Unmarshal(b []byte) error {
593
+	return m.Unmarshal(b)
594
+}
595
+func (m *CheckpointTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
596
+	if deterministic {
597
+		return xxx_messageInfo_CheckpointTaskRequest.Marshal(b, m, deterministic)
598
+	} else {
599
+		b = b[:cap(b)]
600
+		n, err := m.MarshalToSizedBuffer(b)
601
+		if err != nil {
602
+			return nil, err
603
+		}
604
+		return b[:n], nil
605
+	}
606
+}
607
+func (m *CheckpointTaskRequest) XXX_Merge(src proto.Message) {
608
+	xxx_messageInfo_CheckpointTaskRequest.Merge(m, src)
609
+}
610
+func (m *CheckpointTaskRequest) XXX_Size() int {
611
+	return m.Size()
612
+}
613
+func (m *CheckpointTaskRequest) XXX_DiscardUnknown() {
614
+	xxx_messageInfo_CheckpointTaskRequest.DiscardUnknown(m)
615
+}
616
+
617
+var xxx_messageInfo_CheckpointTaskRequest proto.InternalMessageInfo
618
+
619
+type UpdateTaskRequest struct {
620
+	ID                   string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
621
+	Resources            *types1.Any       `protobuf:"bytes,2,opt,name=resources,proto3" json:"resources,omitempty"`
622
+	Annotations          map[string]string `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
623
+	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
624
+	XXX_unrecognized     []byte            `json:"-"`
625
+	XXX_sizecache        int32             `json:"-"`
626
+}
627
+
628
+func (m *UpdateTaskRequest) Reset()      { *m = UpdateTaskRequest{} }
629
+func (*UpdateTaskRequest) ProtoMessage() {}
630
+func (*UpdateTaskRequest) Descriptor() ([]byte, []int) {
631
+	return fileDescriptor_9202ee34bc3ad8ca, []int{14}
632
+}
633
+func (m *UpdateTaskRequest) XXX_Unmarshal(b []byte) error {
634
+	return m.Unmarshal(b)
635
+}
636
+func (m *UpdateTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
637
+	if deterministic {
638
+		return xxx_messageInfo_UpdateTaskRequest.Marshal(b, m, deterministic)
639
+	} else {
640
+		b = b[:cap(b)]
641
+		n, err := m.MarshalToSizedBuffer(b)
642
+		if err != nil {
643
+			return nil, err
644
+		}
645
+		return b[:n], nil
646
+	}
647
+}
648
+func (m *UpdateTaskRequest) XXX_Merge(src proto.Message) {
649
+	xxx_messageInfo_UpdateTaskRequest.Merge(m, src)
650
+}
651
+func (m *UpdateTaskRequest) XXX_Size() int {
652
+	return m.Size()
653
+}
654
+func (m *UpdateTaskRequest) XXX_DiscardUnknown() {
655
+	xxx_messageInfo_UpdateTaskRequest.DiscardUnknown(m)
656
+}
657
+
658
+var xxx_messageInfo_UpdateTaskRequest proto.InternalMessageInfo
659
+
660
+type StartRequest struct {
661
+	ID                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
662
+	ExecID               string   `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
663
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
664
+	XXX_unrecognized     []byte   `json:"-"`
665
+	XXX_sizecache        int32    `json:"-"`
666
+}
667
+
668
+func (m *StartRequest) Reset()      { *m = StartRequest{} }
669
+func (*StartRequest) ProtoMessage() {}
670
+func (*StartRequest) Descriptor() ([]byte, []int) {
671
+	return fileDescriptor_9202ee34bc3ad8ca, []int{15}
672
+}
673
+func (m *StartRequest) XXX_Unmarshal(b []byte) error {
674
+	return m.Unmarshal(b)
675
+}
676
+func (m *StartRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
677
+	if deterministic {
678
+		return xxx_messageInfo_StartRequest.Marshal(b, m, deterministic)
679
+	} else {
680
+		b = b[:cap(b)]
681
+		n, err := m.MarshalToSizedBuffer(b)
682
+		if err != nil {
683
+			return nil, err
684
+		}
685
+		return b[:n], nil
686
+	}
687
+}
688
+func (m *StartRequest) XXX_Merge(src proto.Message) {
689
+	xxx_messageInfo_StartRequest.Merge(m, src)
690
+}
691
+func (m *StartRequest) XXX_Size() int {
692
+	return m.Size()
693
+}
694
+func (m *StartRequest) XXX_DiscardUnknown() {
695
+	xxx_messageInfo_StartRequest.DiscardUnknown(m)
696
+}
697
+
698
+var xxx_messageInfo_StartRequest proto.InternalMessageInfo
699
+
700
+type StartResponse struct {
701
+	Pid                  uint32   `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
702
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
703
+	XXX_unrecognized     []byte   `json:"-"`
704
+	XXX_sizecache        int32    `json:"-"`
705
+}
706
+
707
+func (m *StartResponse) Reset()      { *m = StartResponse{} }
708
+func (*StartResponse) ProtoMessage() {}
709
+func (*StartResponse) Descriptor() ([]byte, []int) {
710
+	return fileDescriptor_9202ee34bc3ad8ca, []int{16}
711
+}
712
+func (m *StartResponse) XXX_Unmarshal(b []byte) error {
713
+	return m.Unmarshal(b)
714
+}
715
+func (m *StartResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
716
+	if deterministic {
717
+		return xxx_messageInfo_StartResponse.Marshal(b, m, deterministic)
718
+	} else {
719
+		b = b[:cap(b)]
720
+		n, err := m.MarshalToSizedBuffer(b)
721
+		if err != nil {
722
+			return nil, err
723
+		}
724
+		return b[:n], nil
725
+	}
726
+}
727
+func (m *StartResponse) XXX_Merge(src proto.Message) {
728
+	xxx_messageInfo_StartResponse.Merge(m, src)
729
+}
730
+func (m *StartResponse) XXX_Size() int {
731
+	return m.Size()
732
+}
733
+func (m *StartResponse) XXX_DiscardUnknown() {
734
+	xxx_messageInfo_StartResponse.DiscardUnknown(m)
735
+}
736
+
737
+var xxx_messageInfo_StartResponse proto.InternalMessageInfo
738
+
739
+type WaitRequest struct {
740
+	ID                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
741
+	ExecID               string   `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
742
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
743
+	XXX_unrecognized     []byte   `json:"-"`
744
+	XXX_sizecache        int32    `json:"-"`
745
+}
746
+
747
+func (m *WaitRequest) Reset()      { *m = WaitRequest{} }
748
+func (*WaitRequest) ProtoMessage() {}
749
+func (*WaitRequest) Descriptor() ([]byte, []int) {
750
+	return fileDescriptor_9202ee34bc3ad8ca, []int{17}
751
+}
752
+func (m *WaitRequest) XXX_Unmarshal(b []byte) error {
753
+	return m.Unmarshal(b)
754
+}
755
+func (m *WaitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
756
+	if deterministic {
757
+		return xxx_messageInfo_WaitRequest.Marshal(b, m, deterministic)
758
+	} else {
759
+		b = b[:cap(b)]
760
+		n, err := m.MarshalToSizedBuffer(b)
761
+		if err != nil {
762
+			return nil, err
763
+		}
764
+		return b[:n], nil
765
+	}
766
+}
767
+func (m *WaitRequest) XXX_Merge(src proto.Message) {
768
+	xxx_messageInfo_WaitRequest.Merge(m, src)
769
+}
770
+func (m *WaitRequest) XXX_Size() int {
771
+	return m.Size()
772
+}
773
+func (m *WaitRequest) XXX_DiscardUnknown() {
774
+	xxx_messageInfo_WaitRequest.DiscardUnknown(m)
775
+}
776
+
777
+var xxx_messageInfo_WaitRequest proto.InternalMessageInfo
778
+
779
+type WaitResponse struct {
780
+	ExitStatus           uint32    `protobuf:"varint,1,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
781
+	ExitedAt             time.Time `protobuf:"bytes,2,opt,name=exited_at,json=exitedAt,proto3,stdtime" json:"exited_at"`
782
+	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
783
+	XXX_unrecognized     []byte    `json:"-"`
784
+	XXX_sizecache        int32     `json:"-"`
785
+}
786
+
787
+func (m *WaitResponse) Reset()      { *m = WaitResponse{} }
788
+func (*WaitResponse) ProtoMessage() {}
789
+func (*WaitResponse) Descriptor() ([]byte, []int) {
790
+	return fileDescriptor_9202ee34bc3ad8ca, []int{18}
791
+}
792
+func (m *WaitResponse) XXX_Unmarshal(b []byte) error {
793
+	return m.Unmarshal(b)
794
+}
795
+func (m *WaitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
796
+	if deterministic {
797
+		return xxx_messageInfo_WaitResponse.Marshal(b, m, deterministic)
798
+	} else {
799
+		b = b[:cap(b)]
800
+		n, err := m.MarshalToSizedBuffer(b)
801
+		if err != nil {
802
+			return nil, err
803
+		}
804
+		return b[:n], nil
805
+	}
806
+}
807
+func (m *WaitResponse) XXX_Merge(src proto.Message) {
808
+	xxx_messageInfo_WaitResponse.Merge(m, src)
809
+}
810
+func (m *WaitResponse) XXX_Size() int {
811
+	return m.Size()
812
+}
813
+func (m *WaitResponse) XXX_DiscardUnknown() {
814
+	xxx_messageInfo_WaitResponse.DiscardUnknown(m)
815
+}
816
+
817
+var xxx_messageInfo_WaitResponse proto.InternalMessageInfo
818
+
819
+type StatsRequest struct {
820
+	ID                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
821
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
822
+	XXX_unrecognized     []byte   `json:"-"`
823
+	XXX_sizecache        int32    `json:"-"`
824
+}
825
+
826
+func (m *StatsRequest) Reset()      { *m = StatsRequest{} }
827
+func (*StatsRequest) ProtoMessage() {}
828
+func (*StatsRequest) Descriptor() ([]byte, []int) {
829
+	return fileDescriptor_9202ee34bc3ad8ca, []int{19}
830
+}
831
+func (m *StatsRequest) XXX_Unmarshal(b []byte) error {
832
+	return m.Unmarshal(b)
833
+}
834
+func (m *StatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
835
+	if deterministic {
836
+		return xxx_messageInfo_StatsRequest.Marshal(b, m, deterministic)
837
+	} else {
838
+		b = b[:cap(b)]
839
+		n, err := m.MarshalToSizedBuffer(b)
840
+		if err != nil {
841
+			return nil, err
842
+		}
843
+		return b[:n], nil
844
+	}
845
+}
846
+func (m *StatsRequest) XXX_Merge(src proto.Message) {
847
+	xxx_messageInfo_StatsRequest.Merge(m, src)
848
+}
849
+func (m *StatsRequest) XXX_Size() int {
850
+	return m.Size()
851
+}
852
+func (m *StatsRequest) XXX_DiscardUnknown() {
853
+	xxx_messageInfo_StatsRequest.DiscardUnknown(m)
854
+}
855
+
856
+var xxx_messageInfo_StatsRequest proto.InternalMessageInfo
857
+
858
+type StatsResponse struct {
859
+	Stats                *types1.Any `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"`
860
+	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
861
+	XXX_unrecognized     []byte      `json:"-"`
862
+	XXX_sizecache        int32       `json:"-"`
863
+}
864
+
865
+func (m *StatsResponse) Reset()      { *m = StatsResponse{} }
866
+func (*StatsResponse) ProtoMessage() {}
867
+func (*StatsResponse) Descriptor() ([]byte, []int) {
868
+	return fileDescriptor_9202ee34bc3ad8ca, []int{20}
869
+}
870
+func (m *StatsResponse) XXX_Unmarshal(b []byte) error {
871
+	return m.Unmarshal(b)
872
+}
873
+func (m *StatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
874
+	if deterministic {
875
+		return xxx_messageInfo_StatsResponse.Marshal(b, m, deterministic)
876
+	} else {
877
+		b = b[:cap(b)]
878
+		n, err := m.MarshalToSizedBuffer(b)
879
+		if err != nil {
880
+			return nil, err
881
+		}
882
+		return b[:n], nil
883
+	}
884
+}
885
+func (m *StatsResponse) XXX_Merge(src proto.Message) {
886
+	xxx_messageInfo_StatsResponse.Merge(m, src)
887
+}
888
+func (m *StatsResponse) XXX_Size() int {
889
+	return m.Size()
890
+}
891
+func (m *StatsResponse) XXX_DiscardUnknown() {
892
+	xxx_messageInfo_StatsResponse.DiscardUnknown(m)
893
+}
894
+
895
+var xxx_messageInfo_StatsResponse proto.InternalMessageInfo
896
+
897
+type ConnectRequest struct {
898
+	ID                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
899
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
900
+	XXX_unrecognized     []byte   `json:"-"`
901
+	XXX_sizecache        int32    `json:"-"`
902
+}
903
+
904
+func (m *ConnectRequest) Reset()      { *m = ConnectRequest{} }
905
+func (*ConnectRequest) ProtoMessage() {}
906
+func (*ConnectRequest) Descriptor() ([]byte, []int) {
907
+	return fileDescriptor_9202ee34bc3ad8ca, []int{21}
908
+}
909
+func (m *ConnectRequest) XXX_Unmarshal(b []byte) error {
910
+	return m.Unmarshal(b)
911
+}
912
+func (m *ConnectRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
913
+	if deterministic {
914
+		return xxx_messageInfo_ConnectRequest.Marshal(b, m, deterministic)
915
+	} else {
916
+		b = b[:cap(b)]
917
+		n, err := m.MarshalToSizedBuffer(b)
918
+		if err != nil {
919
+			return nil, err
920
+		}
921
+		return b[:n], nil
922
+	}
923
+}
924
+func (m *ConnectRequest) XXX_Merge(src proto.Message) {
925
+	xxx_messageInfo_ConnectRequest.Merge(m, src)
926
+}
927
+func (m *ConnectRequest) XXX_Size() int {
928
+	return m.Size()
929
+}
930
+func (m *ConnectRequest) XXX_DiscardUnknown() {
931
+	xxx_messageInfo_ConnectRequest.DiscardUnknown(m)
932
+}
933
+
934
+var xxx_messageInfo_ConnectRequest proto.InternalMessageInfo
935
+
936
+type ConnectResponse struct {
937
+	ShimPid              uint32   `protobuf:"varint,1,opt,name=shim_pid,json=shimPid,proto3" json:"shim_pid,omitempty"`
938
+	TaskPid              uint32   `protobuf:"varint,2,opt,name=task_pid,json=taskPid,proto3" json:"task_pid,omitempty"`
939
+	Version              string   `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
940
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
941
+	XXX_unrecognized     []byte   `json:"-"`
942
+	XXX_sizecache        int32    `json:"-"`
943
+}
944
+
945
+func (m *ConnectResponse) Reset()      { *m = ConnectResponse{} }
946
+func (*ConnectResponse) ProtoMessage() {}
947
+func (*ConnectResponse) Descriptor() ([]byte, []int) {
948
+	return fileDescriptor_9202ee34bc3ad8ca, []int{22}
949
+}
950
+func (m *ConnectResponse) XXX_Unmarshal(b []byte) error {
951
+	return m.Unmarshal(b)
952
+}
953
+func (m *ConnectResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
954
+	if deterministic {
955
+		return xxx_messageInfo_ConnectResponse.Marshal(b, m, deterministic)
956
+	} else {
957
+		b = b[:cap(b)]
958
+		n, err := m.MarshalToSizedBuffer(b)
959
+		if err != nil {
960
+			return nil, err
961
+		}
962
+		return b[:n], nil
963
+	}
964
+}
965
+func (m *ConnectResponse) XXX_Merge(src proto.Message) {
966
+	xxx_messageInfo_ConnectResponse.Merge(m, src)
967
+}
968
+func (m *ConnectResponse) XXX_Size() int {
969
+	return m.Size()
970
+}
971
+func (m *ConnectResponse) XXX_DiscardUnknown() {
972
+	xxx_messageInfo_ConnectResponse.DiscardUnknown(m)
973
+}
974
+
975
+var xxx_messageInfo_ConnectResponse proto.InternalMessageInfo
976
+
977
+type ShutdownRequest struct {
978
+	ID                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
979
+	Now                  bool     `protobuf:"varint,2,opt,name=now,proto3" json:"now,omitempty"`
980
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
981
+	XXX_unrecognized     []byte   `json:"-"`
982
+	XXX_sizecache        int32    `json:"-"`
983
+}
984
+
985
+func (m *ShutdownRequest) Reset()      { *m = ShutdownRequest{} }
986
+func (*ShutdownRequest) ProtoMessage() {}
987
+func (*ShutdownRequest) Descriptor() ([]byte, []int) {
988
+	return fileDescriptor_9202ee34bc3ad8ca, []int{23}
989
+}
990
+func (m *ShutdownRequest) XXX_Unmarshal(b []byte) error {
991
+	return m.Unmarshal(b)
992
+}
993
+func (m *ShutdownRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
994
+	if deterministic {
995
+		return xxx_messageInfo_ShutdownRequest.Marshal(b, m, deterministic)
996
+	} else {
997
+		b = b[:cap(b)]
998
+		n, err := m.MarshalToSizedBuffer(b)
999
+		if err != nil {
1000
+			return nil, err
1001
+		}
1002
+		return b[:n], nil
1003
+	}
1004
+}
1005
+func (m *ShutdownRequest) XXX_Merge(src proto.Message) {
1006
+	xxx_messageInfo_ShutdownRequest.Merge(m, src)
1007
+}
1008
+func (m *ShutdownRequest) XXX_Size() int {
1009
+	return m.Size()
1010
+}
1011
+func (m *ShutdownRequest) XXX_DiscardUnknown() {
1012
+	xxx_messageInfo_ShutdownRequest.DiscardUnknown(m)
1013
+}
1014
+
1015
+var xxx_messageInfo_ShutdownRequest proto.InternalMessageInfo
1016
+
1017
+type PauseRequest struct {
1018
+	ID                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
1019
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
1020
+	XXX_unrecognized     []byte   `json:"-"`
1021
+	XXX_sizecache        int32    `json:"-"`
1022
+}
1023
+
1024
+func (m *PauseRequest) Reset()      { *m = PauseRequest{} }
1025
+func (*PauseRequest) ProtoMessage() {}
1026
+func (*PauseRequest) Descriptor() ([]byte, []int) {
1027
+	return fileDescriptor_9202ee34bc3ad8ca, []int{24}
1028
+}
1029
+func (m *PauseRequest) XXX_Unmarshal(b []byte) error {
1030
+	return m.Unmarshal(b)
1031
+}
1032
+func (m *PauseRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
1033
+	if deterministic {
1034
+		return xxx_messageInfo_PauseRequest.Marshal(b, m, deterministic)
1035
+	} else {
1036
+		b = b[:cap(b)]
1037
+		n, err := m.MarshalToSizedBuffer(b)
1038
+		if err != nil {
1039
+			return nil, err
1040
+		}
1041
+		return b[:n], nil
1042
+	}
1043
+}
1044
+func (m *PauseRequest) XXX_Merge(src proto.Message) {
1045
+	xxx_messageInfo_PauseRequest.Merge(m, src)
1046
+}
1047
+func (m *PauseRequest) XXX_Size() int {
1048
+	return m.Size()
1049
+}
1050
+func (m *PauseRequest) XXX_DiscardUnknown() {
1051
+	xxx_messageInfo_PauseRequest.DiscardUnknown(m)
1052
+}
1053
+
1054
+var xxx_messageInfo_PauseRequest proto.InternalMessageInfo
1055
+
1056
+type ResumeRequest struct {
1057
+	ID                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
1058
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
1059
+	XXX_unrecognized     []byte   `json:"-"`
1060
+	XXX_sizecache        int32    `json:"-"`
1061
+}
1062
+
1063
+func (m *ResumeRequest) Reset()      { *m = ResumeRequest{} }
1064
+func (*ResumeRequest) ProtoMessage() {}
1065
+func (*ResumeRequest) Descriptor() ([]byte, []int) {
1066
+	return fileDescriptor_9202ee34bc3ad8ca, []int{25}
1067
+}
1068
+func (m *ResumeRequest) XXX_Unmarshal(b []byte) error {
1069
+	return m.Unmarshal(b)
1070
+}
1071
+func (m *ResumeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
1072
+	if deterministic {
1073
+		return xxx_messageInfo_ResumeRequest.Marshal(b, m, deterministic)
1074
+	} else {
1075
+		b = b[:cap(b)]
1076
+		n, err := m.MarshalToSizedBuffer(b)
1077
+		if err != nil {
1078
+			return nil, err
1079
+		}
1080
+		return b[:n], nil
1081
+	}
1082
+}
1083
+func (m *ResumeRequest) XXX_Merge(src proto.Message) {
1084
+	xxx_messageInfo_ResumeRequest.Merge(m, src)
1085
+}
1086
+func (m *ResumeRequest) XXX_Size() int {
1087
+	return m.Size()
1088
+}
1089
+func (m *ResumeRequest) XXX_DiscardUnknown() {
1090
+	xxx_messageInfo_ResumeRequest.DiscardUnknown(m)
1091
+}
1092
+
1093
+var xxx_messageInfo_ResumeRequest proto.InternalMessageInfo
1094
+
1095
+func init() {
1096
+	proto.RegisterType((*CreateTaskRequest)(nil), "containerd.task.v2.CreateTaskRequest")
1097
+	proto.RegisterType((*CreateTaskResponse)(nil), "containerd.task.v2.CreateTaskResponse")
1098
+	proto.RegisterType((*DeleteRequest)(nil), "containerd.task.v2.DeleteRequest")
1099
+	proto.RegisterType((*DeleteResponse)(nil), "containerd.task.v2.DeleteResponse")
1100
+	proto.RegisterType((*ExecProcessRequest)(nil), "containerd.task.v2.ExecProcessRequest")
1101
+	proto.RegisterType((*ExecProcessResponse)(nil), "containerd.task.v2.ExecProcessResponse")
1102
+	proto.RegisterType((*ResizePtyRequest)(nil), "containerd.task.v2.ResizePtyRequest")
1103
+	proto.RegisterType((*StateRequest)(nil), "containerd.task.v2.StateRequest")
1104
+	proto.RegisterType((*StateResponse)(nil), "containerd.task.v2.StateResponse")
1105
+	proto.RegisterType((*KillRequest)(nil), "containerd.task.v2.KillRequest")
1106
+	proto.RegisterType((*CloseIORequest)(nil), "containerd.task.v2.CloseIORequest")
1107
+	proto.RegisterType((*PidsRequest)(nil), "containerd.task.v2.PidsRequest")
1108
+	proto.RegisterType((*PidsResponse)(nil), "containerd.task.v2.PidsResponse")
1109
+	proto.RegisterType((*CheckpointTaskRequest)(nil), "containerd.task.v2.CheckpointTaskRequest")
1110
+	proto.RegisterType((*UpdateTaskRequest)(nil), "containerd.task.v2.UpdateTaskRequest")
1111
+	proto.RegisterMapType((map[string]string)(nil), "containerd.task.v2.UpdateTaskRequest.AnnotationsEntry")
1112
+	proto.RegisterType((*StartRequest)(nil), "containerd.task.v2.StartRequest")
1113
+	proto.RegisterType((*StartResponse)(nil), "containerd.task.v2.StartResponse")
1114
+	proto.RegisterType((*WaitRequest)(nil), "containerd.task.v2.WaitRequest")
1115
+	proto.RegisterType((*WaitResponse)(nil), "containerd.task.v2.WaitResponse")
1116
+	proto.RegisterType((*StatsRequest)(nil), "containerd.task.v2.StatsRequest")
1117
+	proto.RegisterType((*StatsResponse)(nil), "containerd.task.v2.StatsResponse")
1118
+	proto.RegisterType((*ConnectRequest)(nil), "containerd.task.v2.ConnectRequest")
1119
+	proto.RegisterType((*ConnectResponse)(nil), "containerd.task.v2.ConnectResponse")
1120
+	proto.RegisterType((*ShutdownRequest)(nil), "containerd.task.v2.ShutdownRequest")
1121
+	proto.RegisterType((*PauseRequest)(nil), "containerd.task.v2.PauseRequest")
1122
+	proto.RegisterType((*ResumeRequest)(nil), "containerd.task.v2.ResumeRequest")
1123
+}
1124
+
1125
+func init() {
1126
+	proto.RegisterFile("github.com/containerd/containerd/runtime/v2/task/shim.proto", fileDescriptor_9202ee34bc3ad8ca)
1127
+}
1128
+
1129
+var fileDescriptor_9202ee34bc3ad8ca = []byte{
1130
+	// 1306 bytes of a gzipped FileDescriptorProto
1131
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4d, 0x6f, 0xdb, 0x46,
1132
+	0x13, 0x0e, 0xf5, 0x41, 0x49, 0xa3, 0xc8, 0x71, 0xf6, 0x75, 0xf2, 0x32, 0x0a, 0x20, 0x29, 0x4c,
1133
+	0x93, 0xaa, 0x2d, 0x40, 0xa1, 0x0a, 0x1a, 0x14, 0x31, 0x90, 0xc2, 0x76, 0xdc, 0x40, 0x4d, 0x5a,
1134
+	0x1b, 0x4c, 0x8a, 0x04, 0xbd, 0x18, 0xb4, 0xb8, 0x91, 0x08, 0x4b, 0x5c, 0x96, 0xbb, 0x74, 0xa2,
1135
+	0x02, 0x05, 0x7a, 0xea, 0xa1, 0xa7, 0xfe, 0xac, 0x1c, 0x0b, 0xf4, 0xd2, 0x4b, 0xd3, 0x46, 0xff,
1136
+	0xa0, 0xc7, 0xde, 0x8a, 0xfd, 0x90, 0x45, 0x49, 0xa4, 0x14, 0x07, 0xba, 0x18, 0x3b, 0xdc, 0x67,
1137
+	0x67, 0x67, 0x67, 0x9f, 0x79, 0x66, 0x65, 0xd8, 0xee, 0x79, 0xac, 0x1f, 0x1d, 0x5b, 0x5d, 0x32,
1138
+	0x6c, 0x75, 0x89, 0xcf, 0x1c, 0xcf, 0xc7, 0xa1, 0x1b, 0x1f, 0x86, 0x91, 0xcf, 0xbc, 0x21, 0x6e,
1139
+	0x9d, 0xb6, 0x5b, 0xcc, 0xa1, 0x27, 0x2d, 0xda, 0xf7, 0x86, 0x56, 0x10, 0x12, 0x46, 0x10, 0x9a,
1140
+	0xc2, 0x2c, 0x3e, 0x67, 0x9d, 0xb6, 0xab, 0xd7, 0x7a, 0x84, 0xf4, 0x06, 0xb8, 0x25, 0x10, 0xc7,
1141
+	0xd1, 0x8b, 0x96, 0xe3, 0x8f, 0x24, 0xbc, 0x7a, 0x7d, 0x7e, 0x0a, 0x0f, 0x03, 0x36, 0x99, 0xdc,
1142
+	0xea, 0x91, 0x1e, 0x11, 0xc3, 0x16, 0x1f, 0xa9, 0xaf, 0xf5, 0xf9, 0x25, 0x3c, 0x14, 0xca, 0x9c,
1143
+	0x61, 0xa0, 0x00, 0x77, 0x57, 0xc6, 0xef, 0x04, 0x5e, 0x8b, 0x8d, 0x02, 0x4c, 0x5b, 0x43, 0x12,
1144
+	0xf9, 0x4c, 0xad, 0xbb, 0x77, 0x8e, 0x75, 0xe2, 0xd8, 0xe2, 0x7c, 0x62, 0xad, 0xf9, 0x7b, 0x06,
1145
+	0x2e, 0xef, 0x85, 0xd8, 0x61, 0xf8, 0xa9, 0x43, 0x4f, 0x6c, 0xfc, 0x7d, 0x84, 0x29, 0x43, 0x57,
1146
+	0x21, 0xe3, 0xb9, 0x86, 0xd6, 0xd0, 0x9a, 0xa5, 0x5d, 0x7d, 0xfc, 0xa6, 0x9e, 0xe9, 0x3c, 0xb0,
1147
+	0x33, 0x9e, 0x8b, 0xae, 0x82, 0x7e, 0x1c, 0xf9, 0xee, 0x00, 0x1b, 0x19, 0x3e, 0x67, 0x2b, 0x0b,
1148
+	0xb5, 0x40, 0x0f, 0x09, 0x61, 0x2f, 0xa8, 0x91, 0x6d, 0x64, 0x9b, 0xe5, 0xf6, 0xff, 0xad, 0x78,
1149
+	0x36, 0xf9, 0xc6, 0xd6, 0xd7, 0x3c, 0x60, 0x5b, 0xc1, 0x50, 0x15, 0x8a, 0x0c, 0x87, 0x43, 0xcf,
1150
+	0x77, 0x06, 0x46, 0xae, 0xa1, 0x35, 0x8b, 0xf6, 0x99, 0x8d, 0xb6, 0x20, 0x4f, 0x99, 0xeb, 0xf9,
1151
+	0x46, 0x5e, 0xec, 0x21, 0x0d, 0xbe, 0x35, 0x65, 0x2e, 0x89, 0x98, 0xa1, 0xcb, 0xad, 0xa5, 0xa5,
1152
+	0xbe, 0xe3, 0x30, 0x34, 0x0a, 0x67, 0xdf, 0x71, 0x18, 0xa2, 0x1a, 0x40, 0xb7, 0x8f, 0xbb, 0x27,
1153
+	0x01, 0xf1, 0x7c, 0x66, 0x14, 0xc5, 0x5c, 0xec, 0x0b, 0xfa, 0x04, 0x2e, 0x07, 0x4e, 0x88, 0x7d,
1154
+	0x76, 0x14, 0x83, 0x95, 0x04, 0x6c, 0x53, 0x4e, 0xec, 0x4d, 0xc1, 0x16, 0x14, 0x48, 0xc0, 0x3c,
1155
+	0xe2, 0x53, 0x03, 0x1a, 0x5a, 0xb3, 0xdc, 0xde, 0xb2, 0xe4, 0x65, 0x5a, 0x93, 0xcb, 0xb4, 0x76,
1156
+	0xfc, 0x91, 0x3d, 0x01, 0x99, 0xb7, 0x01, 0xc5, 0x93, 0x4a, 0x03, 0xe2, 0x53, 0x8c, 0x36, 0x21,
1157
+	0x1b, 0xa8, 0xb4, 0x56, 0x6c, 0x3e, 0x34, 0x1f, 0x43, 0xe5, 0x01, 0x1e, 0x60, 0x86, 0x57, 0x25,
1158
+	0xfe, 0x26, 0x14, 0xf0, 0x2b, 0xdc, 0x3d, 0xf2, 0x5c, 0x99, 0xf9, 0x5d, 0x18, 0xbf, 0xa9, 0xeb,
1159
+	0xfb, 0xaf, 0x70, 0xb7, 0xf3, 0xc0, 0xd6, 0xf9, 0x54, 0xc7, 0x35, 0x7f, 0xd6, 0x60, 0x63, 0xe2,
1160
+	0x2e, 0x6d, 0x4b, 0x54, 0x87, 0x32, 0x7e, 0xe5, 0xb1, 0x23, 0xca, 0x1c, 0x16, 0x51, 0xe1, 0xad,
1161
+	0x62, 0x03, 0xff, 0xf4, 0x44, 0x7c, 0x41, 0x3b, 0x50, 0xe2, 0x16, 0x76, 0x8f, 0x1c, 0x66, 0x64,
1162
+	0xc5, 0x69, 0xab, 0x0b, 0xa7, 0x7d, 0x3a, 0xa1, 0xee, 0x6e, 0xf1, 0xf5, 0x9b, 0xfa, 0x85, 0x5f,
1163
+	0xff, 0xaa, 0x6b, 0x76, 0x51, 0x2e, 0xdb, 0x61, 0xe6, 0x9f, 0x1a, 0x20, 0x1e, 0xdb, 0x61, 0x48,
1164
+	0xba, 0x98, 0xd2, 0x75, 0x1c, 0x6e, 0x86, 0x31, 0xd9, 0x34, 0xc6, 0xe4, 0x92, 0x19, 0x93, 0x4f,
1165
+	0x61, 0x8c, 0x3e, 0xc3, 0x98, 0x26, 0xe4, 0x68, 0x80, 0xbb, 0x82, 0x47, 0x69, 0x37, 0x2c, 0x10,
1166
+	0xe6, 0x15, 0xf8, 0xdf, 0xcc, 0xf1, 0x64, 0xb2, 0xcd, 0x1f, 0x61, 0xd3, 0xc6, 0xd4, 0xfb, 0x01,
1167
+	0x1f, 0xb2, 0xd1, 0x5a, 0xce, 0xbc, 0x05, 0xf9, 0x97, 0x9e, 0xcb, 0xfa, 0xe2, 0xc0, 0x15, 0x5b,
1168
+	0x1a, 0x3c, 0xfe, 0x3e, 0xf6, 0x7a, 0x7d, 0x26, 0x8e, 0x5b, 0xb1, 0x95, 0x65, 0x3e, 0x82, 0x8b,
1169
+	0xfc, 0x0a, 0xd7, 0xc3, 0xa5, 0x7f, 0x32, 0x50, 0x51, 0xde, 0x14, 0x95, 0xce, 0xab, 0x09, 0x8a,
1170
+	0x7a, 0xd9, 0x29, 0xf5, 0xee, 0xf0, 0xc4, 0x0b, 0xd6, 0xf1, 0xc0, 0x37, 0xda, 0xd7, 0xe3, 0x2a,
1171
+	0x71, 0xfa, 0xa9, 0x12, 0x0a, 0x49, 0x43, 0x5b, 0x41, 0xd7, 0xa4, 0x06, 0x71, 0xf6, 0x14, 0xe7,
1172
+	0xd8, 0x33, 0x57, 0x11, 0xa5, 0xe5, 0x15, 0x01, 0xef, 0x53, 0x11, 0xf1, 0x9c, 0x97, 0x53, 0x73,
1173
+	0xce, 0xa0, 0xfc, 0xc8, 0x1b, 0x0c, 0xd6, 0x42, 0x1d, 0x9e, 0x08, 0xaf, 0x37, 0x29, 0x96, 0x8a,
1174
+	0xad, 0x2c, 0x7e, 0x2b, 0xce, 0x60, 0xa2, 0xb9, 0x7c, 0x68, 0x76, 0x61, 0x63, 0x6f, 0x40, 0x28,
1175
+	0xee, 0x1c, 0xac, 0x8b, 0xb3, 0xf2, 0xbe, 0x64, 0x91, 0x4a, 0xc3, 0xbc, 0x05, 0xe5, 0x43, 0xcf,
1176
+	0x5d, 0xa5, 0x04, 0xe6, 0x37, 0x70, 0x51, 0xc2, 0x14, 0xe7, 0xee, 0x43, 0x29, 0x90, 0x45, 0x86,
1177
+	0xa9, 0xa1, 0x89, 0xd6, 0xd2, 0x48, 0x24, 0x8d, 0x2a, 0xc5, 0x8e, 0xff, 0x82, 0xd8, 0xd3, 0x25,
1178
+	0x26, 0x85, 0x2b, 0x53, 0x15, 0x7f, 0x97, 0x06, 0x87, 0x20, 0x17, 0x38, 0xac, 0xaf, 0xa8, 0x2c,
1179
+	0xc6, 0x71, 0xf1, 0xcf, 0xbe, 0x8b, 0xf8, 0xff, 0xab, 0xc1, 0xe5, 0x6f, 0x03, 0xf7, 0x1d, 0x5b,
1180
+	0x6a, 0x1b, 0x4a, 0x21, 0xa6, 0x24, 0x0a, 0xbb, 0x58, 0xaa, 0x71, 0x9a, 0xff, 0x29, 0x0c, 0x3d,
1181
+	0x87, 0xb2, 0xe3, 0xfb, 0x84, 0x39, 0x93, 0xa8, 0x78, 0x62, 0xee, 0x5a, 0x8b, 0x2f, 0x18, 0x6b,
1182
+	0x21, 0x0e, 0x6b, 0x67, 0xba, 0x70, 0xdf, 0x67, 0xe1, 0xc8, 0x8e, 0xbb, 0xaa, 0xde, 0x87, 0xcd,
1183
+	0x79, 0x00, 0xa7, 0xcc, 0x09, 0x1e, 0xc9, 0xd0, 0x6d, 0x3e, 0xe4, 0x77, 0x7c, 0xea, 0x0c, 0xa2,
1184
+	0x49, 0xc5, 0x4b, 0xe3, 0x5e, 0xe6, 0x73, 0x4d, 0x69, 0x50, 0xc8, 0xd6, 0xa2, 0x41, 0x37, 0x84,
1185
+	0x04, 0x71, 0x67, 0xa9, 0x0d, 0xf4, 0x2b, 0x28, 0x3f, 0x73, 0xbc, 0xf5, 0x6c, 0x17, 0xc2, 0x45,
1186
+	0xe9, 0x4b, 0xed, 0x36, 0xa7, 0x0b, 0xda, 0x72, 0x5d, 0xc8, 0xbc, 0x57, 0xa7, 0xbc, 0x2d, 0x35,
1187
+	0x7b, 0x65, 0x61, 0x6c, 0x4b, 0x35, 0x9e, 0x56, 0xc6, 0xc7, 0xbc, 0xcc, 0x1c, 0x26, 0xc3, 0x4a,
1188
+	0xa3, 0x8c, 0x84, 0x98, 0x4d, 0xd8, 0xd8, 0x23, 0xbe, 0x8f, 0xbb, 0xab, 0xf2, 0x64, 0x3a, 0x70,
1189
+	0xe9, 0x0c, 0xa9, 0x36, 0xba, 0x06, 0x45, 0xfe, 0x4a, 0x3e, 0x9a, 0x26, 0xbe, 0xc0, 0xed, 0x43,
1190
+	0xcf, 0xe5, 0x53, 0x9c, 0x67, 0x62, 0x4a, 0xbe, 0x23, 0x0a, 0xdc, 0xe6, 0x53, 0x06, 0x14, 0x4e,
1191
+	0x71, 0x48, 0x3d, 0x22, 0x75, 0xa0, 0x64, 0x4f, 0x4c, 0x73, 0x1b, 0x2e, 0x3d, 0xe9, 0x47, 0xcc,
1192
+	0x25, 0x2f, 0xfd, 0x55, 0xb7, 0xb6, 0x09, 0x59, 0x9f, 0xbc, 0x14, 0xae, 0x8b, 0x36, 0x1f, 0xf2,
1193
+	0x74, 0x1d, 0x3a, 0x11, 0x5d, 0xd5, 0xe2, 0xcc, 0x0f, 0xa1, 0x62, 0x63, 0x1a, 0x0d, 0x57, 0x01,
1194
+	0xdb, 0xbf, 0x00, 0xe4, 0x78, 0x75, 0xa0, 0xc7, 0x90, 0x17, 0xed, 0x0e, 0x35, 0x92, 0xca, 0x28,
1195
+	0xde, 0x57, 0xab, 0x37, 0x96, 0x20, 0x54, 0xd2, 0x9e, 0x81, 0x2e, 0xdf, 0x7f, 0xe8, 0x56, 0x12,
1196
+	0x78, 0xe1, 0xc1, 0x5d, 0xbd, 0xbd, 0x0a, 0xa6, 0x1c, 0xcb, 0x30, 0x43, 0x96, 0x1a, 0xe6, 0x59,
1197
+	0xe9, 0xa5, 0x86, 0x19, 0xab, 0xa7, 0x03, 0xd0, 0xe5, 0x7b, 0x11, 0x25, 0x82, 0x67, 0x9e, 0xa6,
1198
+	0x55, 0x73, 0x19, 0x44, 0x39, 0xec, 0x40, 0x8e, 0xeb, 0x37, 0xaa, 0x27, 0x61, 0x63, 0x0d, 0xa0,
1199
+	0xda, 0x48, 0x07, 0x28, 0x57, 0x3b, 0x90, 0x17, 0x57, 0x9d, 0x7c, 0xd2, 0x38, 0x0b, 0xaa, 0x57,
1200
+	0x17, 0xc8, 0xbf, 0xcf, 0x7f, 0x8c, 0xa1, 0x3d, 0xd0, 0x25, 0x0b, 0x92, 0x8f, 0x37, 0xc3, 0x90,
1201
+	0x54, 0x27, 0x07, 0x00, 0xb1, 0x1f, 0x02, 0x1f, 0x25, 0xde, 0x53, 0x52, 0x8b, 0x49, 0x75, 0xf8,
1202
+	0x05, 0xe4, 0x78, 0x97, 0x4f, 0xce, 0x51, 0xac, 0xff, 0xa7, 0x3a, 0xf8, 0x12, 0x72, 0x5c, 0xb9,
1203
+	0x50, 0x22, 0x67, 0x16, 0x9f, 0xdd, 0xa9, 0x7e, 0x3a, 0x50, 0x3a, 0x7b, 0xae, 0xa2, 0x0f, 0x52,
1204
+	0x32, 0x34, 0xf3, 0x9a, 0x4d, 0x75, 0xb5, 0x0f, 0x05, 0xf5, 0x86, 0x40, 0x89, 0x34, 0x99, 0x7d,
1205
+	0x60, 0xa4, 0xba, 0x79, 0x08, 0xba, 0x6c, 0x58, 0xc9, 0x65, 0xb3, 0xd0, 0xcc, 0x96, 0x1c, 0x2d,
1206
+	0xc7, 0xa5, 0x3c, 0x39, 0xc7, 0xb1, 0x86, 0x91, 0xcc, 0xc3, 0x99, 0x2e, 0xa0, 0x84, 0x81, 0xa6,
1207
+	0x0b, 0x03, 0x5d, 0x29, 0x0c, 0x53, 0x56, 0xdb, 0x50, 0x50, 0x02, 0x9b, 0x92, 0xa8, 0x19, 0x9d,
1208
+	0xae, 0xde, 0x5c, 0x8a, 0x51, 0x3e, 0x1f, 0x42, 0x71, 0xa2, 0xa8, 0x28, 0x71, 0xc1, 0x9c, 0xde,
1209
+	0xa6, 0x65, 0x6d, 0xf7, 0xe0, 0xf5, 0xdb, 0xda, 0x85, 0x3f, 0xde, 0xd6, 0x2e, 0xfc, 0x34, 0xae,
1210
+	0x69, 0xaf, 0xc7, 0x35, 0xed, 0xb7, 0x71, 0x4d, 0xfb, 0x7b, 0x5c, 0xd3, 0xbe, 0xfb, 0xec, 0xbc,
1211
+	0xff, 0x59, 0xd9, 0xe6, 0x7f, 0x9e, 0x67, 0x8e, 0x75, 0xb1, 0xc5, 0x9d, 0xff, 0x02, 0x00, 0x00,
1212
+	0xff, 0xff, 0xd3, 0xbf, 0xc3, 0xa9, 0x9b, 0x11, 0x00, 0x00,
1213
+}
1214
+
1215
+func (m *CreateTaskRequest) Marshal() (dAtA []byte, err error) {
1216
+	size := m.Size()
1217
+	dAtA = make([]byte, size)
1218
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1219
+	if err != nil {
1220
+		return nil, err
1221
+	}
1222
+	return dAtA[:n], nil
1223
+}
1224
+
1225
+func (m *CreateTaskRequest) MarshalTo(dAtA []byte) (int, error) {
1226
+	size := m.Size()
1227
+	return m.MarshalToSizedBuffer(dAtA[:size])
1228
+}
1229
+
1230
+func (m *CreateTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1231
+	i := len(dAtA)
1232
+	_ = i
1233
+	var l int
1234
+	_ = l
1235
+	if m.XXX_unrecognized != nil {
1236
+		i -= len(m.XXX_unrecognized)
1237
+		copy(dAtA[i:], m.XXX_unrecognized)
1238
+	}
1239
+	if m.Options != nil {
1240
+		{
1241
+			size, err := m.Options.MarshalToSizedBuffer(dAtA[:i])
1242
+			if err != nil {
1243
+				return 0, err
1244
+			}
1245
+			i -= size
1246
+			i = encodeVarintShim(dAtA, i, uint64(size))
1247
+		}
1248
+		i--
1249
+		dAtA[i] = 0x52
1250
+	}
1251
+	if len(m.ParentCheckpoint) > 0 {
1252
+		i -= len(m.ParentCheckpoint)
1253
+		copy(dAtA[i:], m.ParentCheckpoint)
1254
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ParentCheckpoint)))
1255
+		i--
1256
+		dAtA[i] = 0x4a
1257
+	}
1258
+	if len(m.Checkpoint) > 0 {
1259
+		i -= len(m.Checkpoint)
1260
+		copy(dAtA[i:], m.Checkpoint)
1261
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Checkpoint)))
1262
+		i--
1263
+		dAtA[i] = 0x42
1264
+	}
1265
+	if len(m.Stderr) > 0 {
1266
+		i -= len(m.Stderr)
1267
+		copy(dAtA[i:], m.Stderr)
1268
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Stderr)))
1269
+		i--
1270
+		dAtA[i] = 0x3a
1271
+	}
1272
+	if len(m.Stdout) > 0 {
1273
+		i -= len(m.Stdout)
1274
+		copy(dAtA[i:], m.Stdout)
1275
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Stdout)))
1276
+		i--
1277
+		dAtA[i] = 0x32
1278
+	}
1279
+	if len(m.Stdin) > 0 {
1280
+		i -= len(m.Stdin)
1281
+		copy(dAtA[i:], m.Stdin)
1282
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Stdin)))
1283
+		i--
1284
+		dAtA[i] = 0x2a
1285
+	}
1286
+	if m.Terminal {
1287
+		i--
1288
+		if m.Terminal {
1289
+			dAtA[i] = 1
1290
+		} else {
1291
+			dAtA[i] = 0
1292
+		}
1293
+		i--
1294
+		dAtA[i] = 0x20
1295
+	}
1296
+	if len(m.Rootfs) > 0 {
1297
+		for iNdEx := len(m.Rootfs) - 1; iNdEx >= 0; iNdEx-- {
1298
+			{
1299
+				size, err := m.Rootfs[iNdEx].MarshalToSizedBuffer(dAtA[:i])
1300
+				if err != nil {
1301
+					return 0, err
1302
+				}
1303
+				i -= size
1304
+				i = encodeVarintShim(dAtA, i, uint64(size))
1305
+			}
1306
+			i--
1307
+			dAtA[i] = 0x1a
1308
+		}
1309
+	}
1310
+	if len(m.Bundle) > 0 {
1311
+		i -= len(m.Bundle)
1312
+		copy(dAtA[i:], m.Bundle)
1313
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Bundle)))
1314
+		i--
1315
+		dAtA[i] = 0x12
1316
+	}
1317
+	if len(m.ID) > 0 {
1318
+		i -= len(m.ID)
1319
+		copy(dAtA[i:], m.ID)
1320
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
1321
+		i--
1322
+		dAtA[i] = 0xa
1323
+	}
1324
+	return len(dAtA) - i, nil
1325
+}
1326
+
1327
+func (m *CreateTaskResponse) Marshal() (dAtA []byte, err error) {
1328
+	size := m.Size()
1329
+	dAtA = make([]byte, size)
1330
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1331
+	if err != nil {
1332
+		return nil, err
1333
+	}
1334
+	return dAtA[:n], nil
1335
+}
1336
+
1337
+func (m *CreateTaskResponse) MarshalTo(dAtA []byte) (int, error) {
1338
+	size := m.Size()
1339
+	return m.MarshalToSizedBuffer(dAtA[:size])
1340
+}
1341
+
1342
+func (m *CreateTaskResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1343
+	i := len(dAtA)
1344
+	_ = i
1345
+	var l int
1346
+	_ = l
1347
+	if m.XXX_unrecognized != nil {
1348
+		i -= len(m.XXX_unrecognized)
1349
+		copy(dAtA[i:], m.XXX_unrecognized)
1350
+	}
1351
+	if m.Pid != 0 {
1352
+		i = encodeVarintShim(dAtA, i, uint64(m.Pid))
1353
+		i--
1354
+		dAtA[i] = 0x8
1355
+	}
1356
+	return len(dAtA) - i, nil
1357
+}
1358
+
1359
+func (m *DeleteRequest) Marshal() (dAtA []byte, err error) {
1360
+	size := m.Size()
1361
+	dAtA = make([]byte, size)
1362
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1363
+	if err != nil {
1364
+		return nil, err
1365
+	}
1366
+	return dAtA[:n], nil
1367
+}
1368
+
1369
+func (m *DeleteRequest) MarshalTo(dAtA []byte) (int, error) {
1370
+	size := m.Size()
1371
+	return m.MarshalToSizedBuffer(dAtA[:size])
1372
+}
1373
+
1374
+func (m *DeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1375
+	i := len(dAtA)
1376
+	_ = i
1377
+	var l int
1378
+	_ = l
1379
+	if m.XXX_unrecognized != nil {
1380
+		i -= len(m.XXX_unrecognized)
1381
+		copy(dAtA[i:], m.XXX_unrecognized)
1382
+	}
1383
+	if len(m.ExecID) > 0 {
1384
+		i -= len(m.ExecID)
1385
+		copy(dAtA[i:], m.ExecID)
1386
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID)))
1387
+		i--
1388
+		dAtA[i] = 0x12
1389
+	}
1390
+	if len(m.ID) > 0 {
1391
+		i -= len(m.ID)
1392
+		copy(dAtA[i:], m.ID)
1393
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
1394
+		i--
1395
+		dAtA[i] = 0xa
1396
+	}
1397
+	return len(dAtA) - i, nil
1398
+}
1399
+
1400
+func (m *DeleteResponse) Marshal() (dAtA []byte, err error) {
1401
+	size := m.Size()
1402
+	dAtA = make([]byte, size)
1403
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1404
+	if err != nil {
1405
+		return nil, err
1406
+	}
1407
+	return dAtA[:n], nil
1408
+}
1409
+
1410
+func (m *DeleteResponse) MarshalTo(dAtA []byte) (int, error) {
1411
+	size := m.Size()
1412
+	return m.MarshalToSizedBuffer(dAtA[:size])
1413
+}
1414
+
1415
+func (m *DeleteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1416
+	i := len(dAtA)
1417
+	_ = i
1418
+	var l int
1419
+	_ = l
1420
+	if m.XXX_unrecognized != nil {
1421
+		i -= len(m.XXX_unrecognized)
1422
+		copy(dAtA[i:], m.XXX_unrecognized)
1423
+	}
1424
+	n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt):])
1425
+	if err2 != nil {
1426
+		return 0, err2
1427
+	}
1428
+	i -= n2
1429
+	i = encodeVarintShim(dAtA, i, uint64(n2))
1430
+	i--
1431
+	dAtA[i] = 0x1a
1432
+	if m.ExitStatus != 0 {
1433
+		i = encodeVarintShim(dAtA, i, uint64(m.ExitStatus))
1434
+		i--
1435
+		dAtA[i] = 0x10
1436
+	}
1437
+	if m.Pid != 0 {
1438
+		i = encodeVarintShim(dAtA, i, uint64(m.Pid))
1439
+		i--
1440
+		dAtA[i] = 0x8
1441
+	}
1442
+	return len(dAtA) - i, nil
1443
+}
1444
+
1445
+func (m *ExecProcessRequest) Marshal() (dAtA []byte, err error) {
1446
+	size := m.Size()
1447
+	dAtA = make([]byte, size)
1448
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1449
+	if err != nil {
1450
+		return nil, err
1451
+	}
1452
+	return dAtA[:n], nil
1453
+}
1454
+
1455
+func (m *ExecProcessRequest) MarshalTo(dAtA []byte) (int, error) {
1456
+	size := m.Size()
1457
+	return m.MarshalToSizedBuffer(dAtA[:size])
1458
+}
1459
+
1460
+func (m *ExecProcessRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1461
+	i := len(dAtA)
1462
+	_ = i
1463
+	var l int
1464
+	_ = l
1465
+	if m.XXX_unrecognized != nil {
1466
+		i -= len(m.XXX_unrecognized)
1467
+		copy(dAtA[i:], m.XXX_unrecognized)
1468
+	}
1469
+	if m.Spec != nil {
1470
+		{
1471
+			size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
1472
+			if err != nil {
1473
+				return 0, err
1474
+			}
1475
+			i -= size
1476
+			i = encodeVarintShim(dAtA, i, uint64(size))
1477
+		}
1478
+		i--
1479
+		dAtA[i] = 0x3a
1480
+	}
1481
+	if len(m.Stderr) > 0 {
1482
+		i -= len(m.Stderr)
1483
+		copy(dAtA[i:], m.Stderr)
1484
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Stderr)))
1485
+		i--
1486
+		dAtA[i] = 0x32
1487
+	}
1488
+	if len(m.Stdout) > 0 {
1489
+		i -= len(m.Stdout)
1490
+		copy(dAtA[i:], m.Stdout)
1491
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Stdout)))
1492
+		i--
1493
+		dAtA[i] = 0x2a
1494
+	}
1495
+	if len(m.Stdin) > 0 {
1496
+		i -= len(m.Stdin)
1497
+		copy(dAtA[i:], m.Stdin)
1498
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Stdin)))
1499
+		i--
1500
+		dAtA[i] = 0x22
1501
+	}
1502
+	if m.Terminal {
1503
+		i--
1504
+		if m.Terminal {
1505
+			dAtA[i] = 1
1506
+		} else {
1507
+			dAtA[i] = 0
1508
+		}
1509
+		i--
1510
+		dAtA[i] = 0x18
1511
+	}
1512
+	if len(m.ExecID) > 0 {
1513
+		i -= len(m.ExecID)
1514
+		copy(dAtA[i:], m.ExecID)
1515
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID)))
1516
+		i--
1517
+		dAtA[i] = 0x12
1518
+	}
1519
+	if len(m.ID) > 0 {
1520
+		i -= len(m.ID)
1521
+		copy(dAtA[i:], m.ID)
1522
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
1523
+		i--
1524
+		dAtA[i] = 0xa
1525
+	}
1526
+	return len(dAtA) - i, nil
1527
+}
1528
+
1529
+func (m *ExecProcessResponse) Marshal() (dAtA []byte, err error) {
1530
+	size := m.Size()
1531
+	dAtA = make([]byte, size)
1532
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1533
+	if err != nil {
1534
+		return nil, err
1535
+	}
1536
+	return dAtA[:n], nil
1537
+}
1538
+
1539
+func (m *ExecProcessResponse) MarshalTo(dAtA []byte) (int, error) {
1540
+	size := m.Size()
1541
+	return m.MarshalToSizedBuffer(dAtA[:size])
1542
+}
1543
+
1544
+func (m *ExecProcessResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1545
+	i := len(dAtA)
1546
+	_ = i
1547
+	var l int
1548
+	_ = l
1549
+	if m.XXX_unrecognized != nil {
1550
+		i -= len(m.XXX_unrecognized)
1551
+		copy(dAtA[i:], m.XXX_unrecognized)
1552
+	}
1553
+	return len(dAtA) - i, nil
1554
+}
1555
+
1556
+func (m *ResizePtyRequest) Marshal() (dAtA []byte, err error) {
1557
+	size := m.Size()
1558
+	dAtA = make([]byte, size)
1559
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1560
+	if err != nil {
1561
+		return nil, err
1562
+	}
1563
+	return dAtA[:n], nil
1564
+}
1565
+
1566
+func (m *ResizePtyRequest) MarshalTo(dAtA []byte) (int, error) {
1567
+	size := m.Size()
1568
+	return m.MarshalToSizedBuffer(dAtA[:size])
1569
+}
1570
+
1571
+func (m *ResizePtyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1572
+	i := len(dAtA)
1573
+	_ = i
1574
+	var l int
1575
+	_ = l
1576
+	if m.XXX_unrecognized != nil {
1577
+		i -= len(m.XXX_unrecognized)
1578
+		copy(dAtA[i:], m.XXX_unrecognized)
1579
+	}
1580
+	if m.Height != 0 {
1581
+		i = encodeVarintShim(dAtA, i, uint64(m.Height))
1582
+		i--
1583
+		dAtA[i] = 0x20
1584
+	}
1585
+	if m.Width != 0 {
1586
+		i = encodeVarintShim(dAtA, i, uint64(m.Width))
1587
+		i--
1588
+		dAtA[i] = 0x18
1589
+	}
1590
+	if len(m.ExecID) > 0 {
1591
+		i -= len(m.ExecID)
1592
+		copy(dAtA[i:], m.ExecID)
1593
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID)))
1594
+		i--
1595
+		dAtA[i] = 0x12
1596
+	}
1597
+	if len(m.ID) > 0 {
1598
+		i -= len(m.ID)
1599
+		copy(dAtA[i:], m.ID)
1600
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
1601
+		i--
1602
+		dAtA[i] = 0xa
1603
+	}
1604
+	return len(dAtA) - i, nil
1605
+}
1606
+
1607
+func (m *StateRequest) Marshal() (dAtA []byte, err error) {
1608
+	size := m.Size()
1609
+	dAtA = make([]byte, size)
1610
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1611
+	if err != nil {
1612
+		return nil, err
1613
+	}
1614
+	return dAtA[:n], nil
1615
+}
1616
+
1617
+func (m *StateRequest) MarshalTo(dAtA []byte) (int, error) {
1618
+	size := m.Size()
1619
+	return m.MarshalToSizedBuffer(dAtA[:size])
1620
+}
1621
+
1622
+func (m *StateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1623
+	i := len(dAtA)
1624
+	_ = i
1625
+	var l int
1626
+	_ = l
1627
+	if m.XXX_unrecognized != nil {
1628
+		i -= len(m.XXX_unrecognized)
1629
+		copy(dAtA[i:], m.XXX_unrecognized)
1630
+	}
1631
+	if len(m.ExecID) > 0 {
1632
+		i -= len(m.ExecID)
1633
+		copy(dAtA[i:], m.ExecID)
1634
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID)))
1635
+		i--
1636
+		dAtA[i] = 0x12
1637
+	}
1638
+	if len(m.ID) > 0 {
1639
+		i -= len(m.ID)
1640
+		copy(dAtA[i:], m.ID)
1641
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
1642
+		i--
1643
+		dAtA[i] = 0xa
1644
+	}
1645
+	return len(dAtA) - i, nil
1646
+}
1647
+
1648
+func (m *StateResponse) Marshal() (dAtA []byte, err error) {
1649
+	size := m.Size()
1650
+	dAtA = make([]byte, size)
1651
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1652
+	if err != nil {
1653
+		return nil, err
1654
+	}
1655
+	return dAtA[:n], nil
1656
+}
1657
+
1658
+func (m *StateResponse) MarshalTo(dAtA []byte) (int, error) {
1659
+	size := m.Size()
1660
+	return m.MarshalToSizedBuffer(dAtA[:size])
1661
+}
1662
+
1663
+func (m *StateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1664
+	i := len(dAtA)
1665
+	_ = i
1666
+	var l int
1667
+	_ = l
1668
+	if m.XXX_unrecognized != nil {
1669
+		i -= len(m.XXX_unrecognized)
1670
+		copy(dAtA[i:], m.XXX_unrecognized)
1671
+	}
1672
+	if len(m.ExecID) > 0 {
1673
+		i -= len(m.ExecID)
1674
+		copy(dAtA[i:], m.ExecID)
1675
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID)))
1676
+		i--
1677
+		dAtA[i] = 0x5a
1678
+	}
1679
+	n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt):])
1680
+	if err4 != nil {
1681
+		return 0, err4
1682
+	}
1683
+	i -= n4
1684
+	i = encodeVarintShim(dAtA, i, uint64(n4))
1685
+	i--
1686
+	dAtA[i] = 0x52
1687
+	if m.ExitStatus != 0 {
1688
+		i = encodeVarintShim(dAtA, i, uint64(m.ExitStatus))
1689
+		i--
1690
+		dAtA[i] = 0x48
1691
+	}
1692
+	if m.Terminal {
1693
+		i--
1694
+		if m.Terminal {
1695
+			dAtA[i] = 1
1696
+		} else {
1697
+			dAtA[i] = 0
1698
+		}
1699
+		i--
1700
+		dAtA[i] = 0x40
1701
+	}
1702
+	if len(m.Stderr) > 0 {
1703
+		i -= len(m.Stderr)
1704
+		copy(dAtA[i:], m.Stderr)
1705
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Stderr)))
1706
+		i--
1707
+		dAtA[i] = 0x3a
1708
+	}
1709
+	if len(m.Stdout) > 0 {
1710
+		i -= len(m.Stdout)
1711
+		copy(dAtA[i:], m.Stdout)
1712
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Stdout)))
1713
+		i--
1714
+		dAtA[i] = 0x32
1715
+	}
1716
+	if len(m.Stdin) > 0 {
1717
+		i -= len(m.Stdin)
1718
+		copy(dAtA[i:], m.Stdin)
1719
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Stdin)))
1720
+		i--
1721
+		dAtA[i] = 0x2a
1722
+	}
1723
+	if m.Status != 0 {
1724
+		i = encodeVarintShim(dAtA, i, uint64(m.Status))
1725
+		i--
1726
+		dAtA[i] = 0x20
1727
+	}
1728
+	if m.Pid != 0 {
1729
+		i = encodeVarintShim(dAtA, i, uint64(m.Pid))
1730
+		i--
1731
+		dAtA[i] = 0x18
1732
+	}
1733
+	if len(m.Bundle) > 0 {
1734
+		i -= len(m.Bundle)
1735
+		copy(dAtA[i:], m.Bundle)
1736
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Bundle)))
1737
+		i--
1738
+		dAtA[i] = 0x12
1739
+	}
1740
+	if len(m.ID) > 0 {
1741
+		i -= len(m.ID)
1742
+		copy(dAtA[i:], m.ID)
1743
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
1744
+		i--
1745
+		dAtA[i] = 0xa
1746
+	}
1747
+	return len(dAtA) - i, nil
1748
+}
1749
+
1750
+func (m *KillRequest) Marshal() (dAtA []byte, err error) {
1751
+	size := m.Size()
1752
+	dAtA = make([]byte, size)
1753
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1754
+	if err != nil {
1755
+		return nil, err
1756
+	}
1757
+	return dAtA[:n], nil
1758
+}
1759
+
1760
+func (m *KillRequest) MarshalTo(dAtA []byte) (int, error) {
1761
+	size := m.Size()
1762
+	return m.MarshalToSizedBuffer(dAtA[:size])
1763
+}
1764
+
1765
+func (m *KillRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1766
+	i := len(dAtA)
1767
+	_ = i
1768
+	var l int
1769
+	_ = l
1770
+	if m.XXX_unrecognized != nil {
1771
+		i -= len(m.XXX_unrecognized)
1772
+		copy(dAtA[i:], m.XXX_unrecognized)
1773
+	}
1774
+	if m.All {
1775
+		i--
1776
+		if m.All {
1777
+			dAtA[i] = 1
1778
+		} else {
1779
+			dAtA[i] = 0
1780
+		}
1781
+		i--
1782
+		dAtA[i] = 0x20
1783
+	}
1784
+	if m.Signal != 0 {
1785
+		i = encodeVarintShim(dAtA, i, uint64(m.Signal))
1786
+		i--
1787
+		dAtA[i] = 0x18
1788
+	}
1789
+	if len(m.ExecID) > 0 {
1790
+		i -= len(m.ExecID)
1791
+		copy(dAtA[i:], m.ExecID)
1792
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID)))
1793
+		i--
1794
+		dAtA[i] = 0x12
1795
+	}
1796
+	if len(m.ID) > 0 {
1797
+		i -= len(m.ID)
1798
+		copy(dAtA[i:], m.ID)
1799
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
1800
+		i--
1801
+		dAtA[i] = 0xa
1802
+	}
1803
+	return len(dAtA) - i, nil
1804
+}
1805
+
1806
+func (m *CloseIORequest) Marshal() (dAtA []byte, err error) {
1807
+	size := m.Size()
1808
+	dAtA = make([]byte, size)
1809
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1810
+	if err != nil {
1811
+		return nil, err
1812
+	}
1813
+	return dAtA[:n], nil
1814
+}
1815
+
1816
+func (m *CloseIORequest) MarshalTo(dAtA []byte) (int, error) {
1817
+	size := m.Size()
1818
+	return m.MarshalToSizedBuffer(dAtA[:size])
1819
+}
1820
+
1821
+func (m *CloseIORequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1822
+	i := len(dAtA)
1823
+	_ = i
1824
+	var l int
1825
+	_ = l
1826
+	if m.XXX_unrecognized != nil {
1827
+		i -= len(m.XXX_unrecognized)
1828
+		copy(dAtA[i:], m.XXX_unrecognized)
1829
+	}
1830
+	if m.Stdin {
1831
+		i--
1832
+		if m.Stdin {
1833
+			dAtA[i] = 1
1834
+		} else {
1835
+			dAtA[i] = 0
1836
+		}
1837
+		i--
1838
+		dAtA[i] = 0x18
1839
+	}
1840
+	if len(m.ExecID) > 0 {
1841
+		i -= len(m.ExecID)
1842
+		copy(dAtA[i:], m.ExecID)
1843
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID)))
1844
+		i--
1845
+		dAtA[i] = 0x12
1846
+	}
1847
+	if len(m.ID) > 0 {
1848
+		i -= len(m.ID)
1849
+		copy(dAtA[i:], m.ID)
1850
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
1851
+		i--
1852
+		dAtA[i] = 0xa
1853
+	}
1854
+	return len(dAtA) - i, nil
1855
+}
1856
+
1857
+func (m *PidsRequest) Marshal() (dAtA []byte, err error) {
1858
+	size := m.Size()
1859
+	dAtA = make([]byte, size)
1860
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1861
+	if err != nil {
1862
+		return nil, err
1863
+	}
1864
+	return dAtA[:n], nil
1865
+}
1866
+
1867
+func (m *PidsRequest) MarshalTo(dAtA []byte) (int, error) {
1868
+	size := m.Size()
1869
+	return m.MarshalToSizedBuffer(dAtA[:size])
1870
+}
1871
+
1872
+func (m *PidsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1873
+	i := len(dAtA)
1874
+	_ = i
1875
+	var l int
1876
+	_ = l
1877
+	if m.XXX_unrecognized != nil {
1878
+		i -= len(m.XXX_unrecognized)
1879
+		copy(dAtA[i:], m.XXX_unrecognized)
1880
+	}
1881
+	if len(m.ID) > 0 {
1882
+		i -= len(m.ID)
1883
+		copy(dAtA[i:], m.ID)
1884
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
1885
+		i--
1886
+		dAtA[i] = 0xa
1887
+	}
1888
+	return len(dAtA) - i, nil
1889
+}
1890
+
1891
+func (m *PidsResponse) Marshal() (dAtA []byte, err error) {
1892
+	size := m.Size()
1893
+	dAtA = make([]byte, size)
1894
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1895
+	if err != nil {
1896
+		return nil, err
1897
+	}
1898
+	return dAtA[:n], nil
1899
+}
1900
+
1901
+func (m *PidsResponse) MarshalTo(dAtA []byte) (int, error) {
1902
+	size := m.Size()
1903
+	return m.MarshalToSizedBuffer(dAtA[:size])
1904
+}
1905
+
1906
+func (m *PidsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1907
+	i := len(dAtA)
1908
+	_ = i
1909
+	var l int
1910
+	_ = l
1911
+	if m.XXX_unrecognized != nil {
1912
+		i -= len(m.XXX_unrecognized)
1913
+		copy(dAtA[i:], m.XXX_unrecognized)
1914
+	}
1915
+	if len(m.Processes) > 0 {
1916
+		for iNdEx := len(m.Processes) - 1; iNdEx >= 0; iNdEx-- {
1917
+			{
1918
+				size, err := m.Processes[iNdEx].MarshalToSizedBuffer(dAtA[:i])
1919
+				if err != nil {
1920
+					return 0, err
1921
+				}
1922
+				i -= size
1923
+				i = encodeVarintShim(dAtA, i, uint64(size))
1924
+			}
1925
+			i--
1926
+			dAtA[i] = 0xa
1927
+		}
1928
+	}
1929
+	return len(dAtA) - i, nil
1930
+}
1931
+
1932
+func (m *CheckpointTaskRequest) Marshal() (dAtA []byte, err error) {
1933
+	size := m.Size()
1934
+	dAtA = make([]byte, size)
1935
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1936
+	if err != nil {
1937
+		return nil, err
1938
+	}
1939
+	return dAtA[:n], nil
1940
+}
1941
+
1942
+func (m *CheckpointTaskRequest) MarshalTo(dAtA []byte) (int, error) {
1943
+	size := m.Size()
1944
+	return m.MarshalToSizedBuffer(dAtA[:size])
1945
+}
1946
+
1947
+func (m *CheckpointTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1948
+	i := len(dAtA)
1949
+	_ = i
1950
+	var l int
1951
+	_ = l
1952
+	if m.XXX_unrecognized != nil {
1953
+		i -= len(m.XXX_unrecognized)
1954
+		copy(dAtA[i:], m.XXX_unrecognized)
1955
+	}
1956
+	if m.Options != nil {
1957
+		{
1958
+			size, err := m.Options.MarshalToSizedBuffer(dAtA[:i])
1959
+			if err != nil {
1960
+				return 0, err
1961
+			}
1962
+			i -= size
1963
+			i = encodeVarintShim(dAtA, i, uint64(size))
1964
+		}
1965
+		i--
1966
+		dAtA[i] = 0x1a
1967
+	}
1968
+	if len(m.Path) > 0 {
1969
+		i -= len(m.Path)
1970
+		copy(dAtA[i:], m.Path)
1971
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Path)))
1972
+		i--
1973
+		dAtA[i] = 0x12
1974
+	}
1975
+	if len(m.ID) > 0 {
1976
+		i -= len(m.ID)
1977
+		copy(dAtA[i:], m.ID)
1978
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
1979
+		i--
1980
+		dAtA[i] = 0xa
1981
+	}
1982
+	return len(dAtA) - i, nil
1983
+}
1984
+
1985
+func (m *UpdateTaskRequest) Marshal() (dAtA []byte, err error) {
1986
+	size := m.Size()
1987
+	dAtA = make([]byte, size)
1988
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
1989
+	if err != nil {
1990
+		return nil, err
1991
+	}
1992
+	return dAtA[:n], nil
1993
+}
1994
+
1995
+func (m *UpdateTaskRequest) MarshalTo(dAtA []byte) (int, error) {
1996
+	size := m.Size()
1997
+	return m.MarshalToSizedBuffer(dAtA[:size])
1998
+}
1999
+
2000
+func (m *UpdateTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2001
+	i := len(dAtA)
2002
+	_ = i
2003
+	var l int
2004
+	_ = l
2005
+	if m.XXX_unrecognized != nil {
2006
+		i -= len(m.XXX_unrecognized)
2007
+		copy(dAtA[i:], m.XXX_unrecognized)
2008
+	}
2009
+	if len(m.Annotations) > 0 {
2010
+		for k := range m.Annotations {
2011
+			v := m.Annotations[k]
2012
+			baseI := i
2013
+			i -= len(v)
2014
+			copy(dAtA[i:], v)
2015
+			i = encodeVarintShim(dAtA, i, uint64(len(v)))
2016
+			i--
2017
+			dAtA[i] = 0x12
2018
+			i -= len(k)
2019
+			copy(dAtA[i:], k)
2020
+			i = encodeVarintShim(dAtA, i, uint64(len(k)))
2021
+			i--
2022
+			dAtA[i] = 0xa
2023
+			i = encodeVarintShim(dAtA, i, uint64(baseI-i))
2024
+			i--
2025
+			dAtA[i] = 0x1a
2026
+		}
2027
+	}
2028
+	if m.Resources != nil {
2029
+		{
2030
+			size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i])
2031
+			if err != nil {
2032
+				return 0, err
2033
+			}
2034
+			i -= size
2035
+			i = encodeVarintShim(dAtA, i, uint64(size))
2036
+		}
2037
+		i--
2038
+		dAtA[i] = 0x12
2039
+	}
2040
+	if len(m.ID) > 0 {
2041
+		i -= len(m.ID)
2042
+		copy(dAtA[i:], m.ID)
2043
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
2044
+		i--
2045
+		dAtA[i] = 0xa
2046
+	}
2047
+	return len(dAtA) - i, nil
2048
+}
2049
+
2050
+func (m *StartRequest) Marshal() (dAtA []byte, err error) {
2051
+	size := m.Size()
2052
+	dAtA = make([]byte, size)
2053
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
2054
+	if err != nil {
2055
+		return nil, err
2056
+	}
2057
+	return dAtA[:n], nil
2058
+}
2059
+
2060
+func (m *StartRequest) MarshalTo(dAtA []byte) (int, error) {
2061
+	size := m.Size()
2062
+	return m.MarshalToSizedBuffer(dAtA[:size])
2063
+}
2064
+
2065
+func (m *StartRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2066
+	i := len(dAtA)
2067
+	_ = i
2068
+	var l int
2069
+	_ = l
2070
+	if m.XXX_unrecognized != nil {
2071
+		i -= len(m.XXX_unrecognized)
2072
+		copy(dAtA[i:], m.XXX_unrecognized)
2073
+	}
2074
+	if len(m.ExecID) > 0 {
2075
+		i -= len(m.ExecID)
2076
+		copy(dAtA[i:], m.ExecID)
2077
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID)))
2078
+		i--
2079
+		dAtA[i] = 0x12
2080
+	}
2081
+	if len(m.ID) > 0 {
2082
+		i -= len(m.ID)
2083
+		copy(dAtA[i:], m.ID)
2084
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
2085
+		i--
2086
+		dAtA[i] = 0xa
2087
+	}
2088
+	return len(dAtA) - i, nil
2089
+}
2090
+
2091
+func (m *StartResponse) Marshal() (dAtA []byte, err error) {
2092
+	size := m.Size()
2093
+	dAtA = make([]byte, size)
2094
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
2095
+	if err != nil {
2096
+		return nil, err
2097
+	}
2098
+	return dAtA[:n], nil
2099
+}
2100
+
2101
+func (m *StartResponse) MarshalTo(dAtA []byte) (int, error) {
2102
+	size := m.Size()
2103
+	return m.MarshalToSizedBuffer(dAtA[:size])
2104
+}
2105
+
2106
+func (m *StartResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2107
+	i := len(dAtA)
2108
+	_ = i
2109
+	var l int
2110
+	_ = l
2111
+	if m.XXX_unrecognized != nil {
2112
+		i -= len(m.XXX_unrecognized)
2113
+		copy(dAtA[i:], m.XXX_unrecognized)
2114
+	}
2115
+	if m.Pid != 0 {
2116
+		i = encodeVarintShim(dAtA, i, uint64(m.Pid))
2117
+		i--
2118
+		dAtA[i] = 0x8
2119
+	}
2120
+	return len(dAtA) - i, nil
2121
+}
2122
+
2123
+func (m *WaitRequest) Marshal() (dAtA []byte, err error) {
2124
+	size := m.Size()
2125
+	dAtA = make([]byte, size)
2126
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
2127
+	if err != nil {
2128
+		return nil, err
2129
+	}
2130
+	return dAtA[:n], nil
2131
+}
2132
+
2133
+func (m *WaitRequest) MarshalTo(dAtA []byte) (int, error) {
2134
+	size := m.Size()
2135
+	return m.MarshalToSizedBuffer(dAtA[:size])
2136
+}
2137
+
2138
+func (m *WaitRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2139
+	i := len(dAtA)
2140
+	_ = i
2141
+	var l int
2142
+	_ = l
2143
+	if m.XXX_unrecognized != nil {
2144
+		i -= len(m.XXX_unrecognized)
2145
+		copy(dAtA[i:], m.XXX_unrecognized)
2146
+	}
2147
+	if len(m.ExecID) > 0 {
2148
+		i -= len(m.ExecID)
2149
+		copy(dAtA[i:], m.ExecID)
2150
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ExecID)))
2151
+		i--
2152
+		dAtA[i] = 0x12
2153
+	}
2154
+	if len(m.ID) > 0 {
2155
+		i -= len(m.ID)
2156
+		copy(dAtA[i:], m.ID)
2157
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
2158
+		i--
2159
+		dAtA[i] = 0xa
2160
+	}
2161
+	return len(dAtA) - i, nil
2162
+}
2163
+
2164
+func (m *WaitResponse) Marshal() (dAtA []byte, err error) {
2165
+	size := m.Size()
2166
+	dAtA = make([]byte, size)
2167
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
2168
+	if err != nil {
2169
+		return nil, err
2170
+	}
2171
+	return dAtA[:n], nil
2172
+}
2173
+
2174
+func (m *WaitResponse) MarshalTo(dAtA []byte) (int, error) {
2175
+	size := m.Size()
2176
+	return m.MarshalToSizedBuffer(dAtA[:size])
2177
+}
2178
+
2179
+func (m *WaitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2180
+	i := len(dAtA)
2181
+	_ = i
2182
+	var l int
2183
+	_ = l
2184
+	if m.XXX_unrecognized != nil {
2185
+		i -= len(m.XXX_unrecognized)
2186
+		copy(dAtA[i:], m.XXX_unrecognized)
2187
+	}
2188
+	n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt):])
2189
+	if err7 != nil {
2190
+		return 0, err7
2191
+	}
2192
+	i -= n7
2193
+	i = encodeVarintShim(dAtA, i, uint64(n7))
2194
+	i--
2195
+	dAtA[i] = 0x12
2196
+	if m.ExitStatus != 0 {
2197
+		i = encodeVarintShim(dAtA, i, uint64(m.ExitStatus))
2198
+		i--
2199
+		dAtA[i] = 0x8
2200
+	}
2201
+	return len(dAtA) - i, nil
2202
+}
2203
+
2204
+func (m *StatsRequest) Marshal() (dAtA []byte, err error) {
2205
+	size := m.Size()
2206
+	dAtA = make([]byte, size)
2207
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
2208
+	if err != nil {
2209
+		return nil, err
2210
+	}
2211
+	return dAtA[:n], nil
2212
+}
2213
+
2214
+func (m *StatsRequest) MarshalTo(dAtA []byte) (int, error) {
2215
+	size := m.Size()
2216
+	return m.MarshalToSizedBuffer(dAtA[:size])
2217
+}
2218
+
2219
+func (m *StatsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2220
+	i := len(dAtA)
2221
+	_ = i
2222
+	var l int
2223
+	_ = l
2224
+	if m.XXX_unrecognized != nil {
2225
+		i -= len(m.XXX_unrecognized)
2226
+		copy(dAtA[i:], m.XXX_unrecognized)
2227
+	}
2228
+	if len(m.ID) > 0 {
2229
+		i -= len(m.ID)
2230
+		copy(dAtA[i:], m.ID)
2231
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
2232
+		i--
2233
+		dAtA[i] = 0xa
2234
+	}
2235
+	return len(dAtA) - i, nil
2236
+}
2237
+
2238
+func (m *StatsResponse) Marshal() (dAtA []byte, err error) {
2239
+	size := m.Size()
2240
+	dAtA = make([]byte, size)
2241
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
2242
+	if err != nil {
2243
+		return nil, err
2244
+	}
2245
+	return dAtA[:n], nil
2246
+}
2247
+
2248
+func (m *StatsResponse) MarshalTo(dAtA []byte) (int, error) {
2249
+	size := m.Size()
2250
+	return m.MarshalToSizedBuffer(dAtA[:size])
2251
+}
2252
+
2253
+func (m *StatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2254
+	i := len(dAtA)
2255
+	_ = i
2256
+	var l int
2257
+	_ = l
2258
+	if m.XXX_unrecognized != nil {
2259
+		i -= len(m.XXX_unrecognized)
2260
+		copy(dAtA[i:], m.XXX_unrecognized)
2261
+	}
2262
+	if m.Stats != nil {
2263
+		{
2264
+			size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i])
2265
+			if err != nil {
2266
+				return 0, err
2267
+			}
2268
+			i -= size
2269
+			i = encodeVarintShim(dAtA, i, uint64(size))
2270
+		}
2271
+		i--
2272
+		dAtA[i] = 0xa
2273
+	}
2274
+	return len(dAtA) - i, nil
2275
+}
2276
+
2277
+func (m *ConnectRequest) Marshal() (dAtA []byte, err error) {
2278
+	size := m.Size()
2279
+	dAtA = make([]byte, size)
2280
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
2281
+	if err != nil {
2282
+		return nil, err
2283
+	}
2284
+	return dAtA[:n], nil
2285
+}
2286
+
2287
+func (m *ConnectRequest) MarshalTo(dAtA []byte) (int, error) {
2288
+	size := m.Size()
2289
+	return m.MarshalToSizedBuffer(dAtA[:size])
2290
+}
2291
+
2292
+func (m *ConnectRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2293
+	i := len(dAtA)
2294
+	_ = i
2295
+	var l int
2296
+	_ = l
2297
+	if m.XXX_unrecognized != nil {
2298
+		i -= len(m.XXX_unrecognized)
2299
+		copy(dAtA[i:], m.XXX_unrecognized)
2300
+	}
2301
+	if len(m.ID) > 0 {
2302
+		i -= len(m.ID)
2303
+		copy(dAtA[i:], m.ID)
2304
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
2305
+		i--
2306
+		dAtA[i] = 0xa
2307
+	}
2308
+	return len(dAtA) - i, nil
2309
+}
2310
+
2311
+func (m *ConnectResponse) Marshal() (dAtA []byte, err error) {
2312
+	size := m.Size()
2313
+	dAtA = make([]byte, size)
2314
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
2315
+	if err != nil {
2316
+		return nil, err
2317
+	}
2318
+	return dAtA[:n], nil
2319
+}
2320
+
2321
+func (m *ConnectResponse) MarshalTo(dAtA []byte) (int, error) {
2322
+	size := m.Size()
2323
+	return m.MarshalToSizedBuffer(dAtA[:size])
2324
+}
2325
+
2326
+func (m *ConnectResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2327
+	i := len(dAtA)
2328
+	_ = i
2329
+	var l int
2330
+	_ = l
2331
+	if m.XXX_unrecognized != nil {
2332
+		i -= len(m.XXX_unrecognized)
2333
+		copy(dAtA[i:], m.XXX_unrecognized)
2334
+	}
2335
+	if len(m.Version) > 0 {
2336
+		i -= len(m.Version)
2337
+		copy(dAtA[i:], m.Version)
2338
+		i = encodeVarintShim(dAtA, i, uint64(len(m.Version)))
2339
+		i--
2340
+		dAtA[i] = 0x1a
2341
+	}
2342
+	if m.TaskPid != 0 {
2343
+		i = encodeVarintShim(dAtA, i, uint64(m.TaskPid))
2344
+		i--
2345
+		dAtA[i] = 0x10
2346
+	}
2347
+	if m.ShimPid != 0 {
2348
+		i = encodeVarintShim(dAtA, i, uint64(m.ShimPid))
2349
+		i--
2350
+		dAtA[i] = 0x8
2351
+	}
2352
+	return len(dAtA) - i, nil
2353
+}
2354
+
2355
+func (m *ShutdownRequest) Marshal() (dAtA []byte, err error) {
2356
+	size := m.Size()
2357
+	dAtA = make([]byte, size)
2358
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
2359
+	if err != nil {
2360
+		return nil, err
2361
+	}
2362
+	return dAtA[:n], nil
2363
+}
2364
+
2365
+func (m *ShutdownRequest) MarshalTo(dAtA []byte) (int, error) {
2366
+	size := m.Size()
2367
+	return m.MarshalToSizedBuffer(dAtA[:size])
2368
+}
2369
+
2370
+func (m *ShutdownRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2371
+	i := len(dAtA)
2372
+	_ = i
2373
+	var l int
2374
+	_ = l
2375
+	if m.XXX_unrecognized != nil {
2376
+		i -= len(m.XXX_unrecognized)
2377
+		copy(dAtA[i:], m.XXX_unrecognized)
2378
+	}
2379
+	if m.Now {
2380
+		i--
2381
+		if m.Now {
2382
+			dAtA[i] = 1
2383
+		} else {
2384
+			dAtA[i] = 0
2385
+		}
2386
+		i--
2387
+		dAtA[i] = 0x10
2388
+	}
2389
+	if len(m.ID) > 0 {
2390
+		i -= len(m.ID)
2391
+		copy(dAtA[i:], m.ID)
2392
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
2393
+		i--
2394
+		dAtA[i] = 0xa
2395
+	}
2396
+	return len(dAtA) - i, nil
2397
+}
2398
+
2399
+func (m *PauseRequest) Marshal() (dAtA []byte, err error) {
2400
+	size := m.Size()
2401
+	dAtA = make([]byte, size)
2402
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
2403
+	if err != nil {
2404
+		return nil, err
2405
+	}
2406
+	return dAtA[:n], nil
2407
+}
2408
+
2409
+func (m *PauseRequest) MarshalTo(dAtA []byte) (int, error) {
2410
+	size := m.Size()
2411
+	return m.MarshalToSizedBuffer(dAtA[:size])
2412
+}
2413
+
2414
+func (m *PauseRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2415
+	i := len(dAtA)
2416
+	_ = i
2417
+	var l int
2418
+	_ = l
2419
+	if m.XXX_unrecognized != nil {
2420
+		i -= len(m.XXX_unrecognized)
2421
+		copy(dAtA[i:], m.XXX_unrecognized)
2422
+	}
2423
+	if len(m.ID) > 0 {
2424
+		i -= len(m.ID)
2425
+		copy(dAtA[i:], m.ID)
2426
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
2427
+		i--
2428
+		dAtA[i] = 0xa
2429
+	}
2430
+	return len(dAtA) - i, nil
2431
+}
2432
+
2433
+func (m *ResumeRequest) Marshal() (dAtA []byte, err error) {
2434
+	size := m.Size()
2435
+	dAtA = make([]byte, size)
2436
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
2437
+	if err != nil {
2438
+		return nil, err
2439
+	}
2440
+	return dAtA[:n], nil
2441
+}
2442
+
2443
+func (m *ResumeRequest) MarshalTo(dAtA []byte) (int, error) {
2444
+	size := m.Size()
2445
+	return m.MarshalToSizedBuffer(dAtA[:size])
2446
+}
2447
+
2448
+func (m *ResumeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2449
+	i := len(dAtA)
2450
+	_ = i
2451
+	var l int
2452
+	_ = l
2453
+	if m.XXX_unrecognized != nil {
2454
+		i -= len(m.XXX_unrecognized)
2455
+		copy(dAtA[i:], m.XXX_unrecognized)
2456
+	}
2457
+	if len(m.ID) > 0 {
2458
+		i -= len(m.ID)
2459
+		copy(dAtA[i:], m.ID)
2460
+		i = encodeVarintShim(dAtA, i, uint64(len(m.ID)))
2461
+		i--
2462
+		dAtA[i] = 0xa
2463
+	}
2464
+	return len(dAtA) - i, nil
2465
+}
2466
+
2467
+func encodeVarintShim(dAtA []byte, offset int, v uint64) int {
2468
+	offset -= sovShim(v)
2469
+	base := offset
2470
+	for v >= 1<<7 {
2471
+		dAtA[offset] = uint8(v&0x7f | 0x80)
2472
+		v >>= 7
2473
+		offset++
2474
+	}
2475
+	dAtA[offset] = uint8(v)
2476
+	return base
2477
+}
2478
+func (m *CreateTaskRequest) Size() (n int) {
2479
+	if m == nil {
2480
+		return 0
2481
+	}
2482
+	var l int
2483
+	_ = l
2484
+	l = len(m.ID)
2485
+	if l > 0 {
2486
+		n += 1 + l + sovShim(uint64(l))
2487
+	}
2488
+	l = len(m.Bundle)
2489
+	if l > 0 {
2490
+		n += 1 + l + sovShim(uint64(l))
2491
+	}
2492
+	if len(m.Rootfs) > 0 {
2493
+		for _, e := range m.Rootfs {
2494
+			l = e.Size()
2495
+			n += 1 + l + sovShim(uint64(l))
2496
+		}
2497
+	}
2498
+	if m.Terminal {
2499
+		n += 2
2500
+	}
2501
+	l = len(m.Stdin)
2502
+	if l > 0 {
2503
+		n += 1 + l + sovShim(uint64(l))
2504
+	}
2505
+	l = len(m.Stdout)
2506
+	if l > 0 {
2507
+		n += 1 + l + sovShim(uint64(l))
2508
+	}
2509
+	l = len(m.Stderr)
2510
+	if l > 0 {
2511
+		n += 1 + l + sovShim(uint64(l))
2512
+	}
2513
+	l = len(m.Checkpoint)
2514
+	if l > 0 {
2515
+		n += 1 + l + sovShim(uint64(l))
2516
+	}
2517
+	l = len(m.ParentCheckpoint)
2518
+	if l > 0 {
2519
+		n += 1 + l + sovShim(uint64(l))
2520
+	}
2521
+	if m.Options != nil {
2522
+		l = m.Options.Size()
2523
+		n += 1 + l + sovShim(uint64(l))
2524
+	}
2525
+	if m.XXX_unrecognized != nil {
2526
+		n += len(m.XXX_unrecognized)
2527
+	}
2528
+	return n
2529
+}
2530
+
2531
+func (m *CreateTaskResponse) Size() (n int) {
2532
+	if m == nil {
2533
+		return 0
2534
+	}
2535
+	var l int
2536
+	_ = l
2537
+	if m.Pid != 0 {
2538
+		n += 1 + sovShim(uint64(m.Pid))
2539
+	}
2540
+	if m.XXX_unrecognized != nil {
2541
+		n += len(m.XXX_unrecognized)
2542
+	}
2543
+	return n
2544
+}
2545
+
2546
+func (m *DeleteRequest) Size() (n int) {
2547
+	if m == nil {
2548
+		return 0
2549
+	}
2550
+	var l int
2551
+	_ = l
2552
+	l = len(m.ID)
2553
+	if l > 0 {
2554
+		n += 1 + l + sovShim(uint64(l))
2555
+	}
2556
+	l = len(m.ExecID)
2557
+	if l > 0 {
2558
+		n += 1 + l + sovShim(uint64(l))
2559
+	}
2560
+	if m.XXX_unrecognized != nil {
2561
+		n += len(m.XXX_unrecognized)
2562
+	}
2563
+	return n
2564
+}
2565
+
2566
+func (m *DeleteResponse) Size() (n int) {
2567
+	if m == nil {
2568
+		return 0
2569
+	}
2570
+	var l int
2571
+	_ = l
2572
+	if m.Pid != 0 {
2573
+		n += 1 + sovShim(uint64(m.Pid))
2574
+	}
2575
+	if m.ExitStatus != 0 {
2576
+		n += 1 + sovShim(uint64(m.ExitStatus))
2577
+	}
2578
+	l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
2579
+	n += 1 + l + sovShim(uint64(l))
2580
+	if m.XXX_unrecognized != nil {
2581
+		n += len(m.XXX_unrecognized)
2582
+	}
2583
+	return n
2584
+}
2585
+
2586
+func (m *ExecProcessRequest) Size() (n int) {
2587
+	if m == nil {
2588
+		return 0
2589
+	}
2590
+	var l int
2591
+	_ = l
2592
+	l = len(m.ID)
2593
+	if l > 0 {
2594
+		n += 1 + l + sovShim(uint64(l))
2595
+	}
2596
+	l = len(m.ExecID)
2597
+	if l > 0 {
2598
+		n += 1 + l + sovShim(uint64(l))
2599
+	}
2600
+	if m.Terminal {
2601
+		n += 2
2602
+	}
2603
+	l = len(m.Stdin)
2604
+	if l > 0 {
2605
+		n += 1 + l + sovShim(uint64(l))
2606
+	}
2607
+	l = len(m.Stdout)
2608
+	if l > 0 {
2609
+		n += 1 + l + sovShim(uint64(l))
2610
+	}
2611
+	l = len(m.Stderr)
2612
+	if l > 0 {
2613
+		n += 1 + l + sovShim(uint64(l))
2614
+	}
2615
+	if m.Spec != nil {
2616
+		l = m.Spec.Size()
2617
+		n += 1 + l + sovShim(uint64(l))
2618
+	}
2619
+	if m.XXX_unrecognized != nil {
2620
+		n += len(m.XXX_unrecognized)
2621
+	}
2622
+	return n
2623
+}
2624
+
2625
+func (m *ExecProcessResponse) Size() (n int) {
2626
+	if m == nil {
2627
+		return 0
2628
+	}
2629
+	var l int
2630
+	_ = l
2631
+	if m.XXX_unrecognized != nil {
2632
+		n += len(m.XXX_unrecognized)
2633
+	}
2634
+	return n
2635
+}
2636
+
2637
+func (m *ResizePtyRequest) Size() (n int) {
2638
+	if m == nil {
2639
+		return 0
2640
+	}
2641
+	var l int
2642
+	_ = l
2643
+	l = len(m.ID)
2644
+	if l > 0 {
2645
+		n += 1 + l + sovShim(uint64(l))
2646
+	}
2647
+	l = len(m.ExecID)
2648
+	if l > 0 {
2649
+		n += 1 + l + sovShim(uint64(l))
2650
+	}
2651
+	if m.Width != 0 {
2652
+		n += 1 + sovShim(uint64(m.Width))
2653
+	}
2654
+	if m.Height != 0 {
2655
+		n += 1 + sovShim(uint64(m.Height))
2656
+	}
2657
+	if m.XXX_unrecognized != nil {
2658
+		n += len(m.XXX_unrecognized)
2659
+	}
2660
+	return n
2661
+}
2662
+
2663
+func (m *StateRequest) Size() (n int) {
2664
+	if m == nil {
2665
+		return 0
2666
+	}
2667
+	var l int
2668
+	_ = l
2669
+	l = len(m.ID)
2670
+	if l > 0 {
2671
+		n += 1 + l + sovShim(uint64(l))
2672
+	}
2673
+	l = len(m.ExecID)
2674
+	if l > 0 {
2675
+		n += 1 + l + sovShim(uint64(l))
2676
+	}
2677
+	if m.XXX_unrecognized != nil {
2678
+		n += len(m.XXX_unrecognized)
2679
+	}
2680
+	return n
2681
+}
2682
+
2683
+func (m *StateResponse) Size() (n int) {
2684
+	if m == nil {
2685
+		return 0
2686
+	}
2687
+	var l int
2688
+	_ = l
2689
+	l = len(m.ID)
2690
+	if l > 0 {
2691
+		n += 1 + l + sovShim(uint64(l))
2692
+	}
2693
+	l = len(m.Bundle)
2694
+	if l > 0 {
2695
+		n += 1 + l + sovShim(uint64(l))
2696
+	}
2697
+	if m.Pid != 0 {
2698
+		n += 1 + sovShim(uint64(m.Pid))
2699
+	}
2700
+	if m.Status != 0 {
2701
+		n += 1 + sovShim(uint64(m.Status))
2702
+	}
2703
+	l = len(m.Stdin)
2704
+	if l > 0 {
2705
+		n += 1 + l + sovShim(uint64(l))
2706
+	}
2707
+	l = len(m.Stdout)
2708
+	if l > 0 {
2709
+		n += 1 + l + sovShim(uint64(l))
2710
+	}
2711
+	l = len(m.Stderr)
2712
+	if l > 0 {
2713
+		n += 1 + l + sovShim(uint64(l))
2714
+	}
2715
+	if m.Terminal {
2716
+		n += 2
2717
+	}
2718
+	if m.ExitStatus != 0 {
2719
+		n += 1 + sovShim(uint64(m.ExitStatus))
2720
+	}
2721
+	l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
2722
+	n += 1 + l + sovShim(uint64(l))
2723
+	l = len(m.ExecID)
2724
+	if l > 0 {
2725
+		n += 1 + l + sovShim(uint64(l))
2726
+	}
2727
+	if m.XXX_unrecognized != nil {
2728
+		n += len(m.XXX_unrecognized)
2729
+	}
2730
+	return n
2731
+}
2732
+
2733
+func (m *KillRequest) Size() (n int) {
2734
+	if m == nil {
2735
+		return 0
2736
+	}
2737
+	var l int
2738
+	_ = l
2739
+	l = len(m.ID)
2740
+	if l > 0 {
2741
+		n += 1 + l + sovShim(uint64(l))
2742
+	}
2743
+	l = len(m.ExecID)
2744
+	if l > 0 {
2745
+		n += 1 + l + sovShim(uint64(l))
2746
+	}
2747
+	if m.Signal != 0 {
2748
+		n += 1 + sovShim(uint64(m.Signal))
2749
+	}
2750
+	if m.All {
2751
+		n += 2
2752
+	}
2753
+	if m.XXX_unrecognized != nil {
2754
+		n += len(m.XXX_unrecognized)
2755
+	}
2756
+	return n
2757
+}
2758
+
2759
+func (m *CloseIORequest) Size() (n int) {
2760
+	if m == nil {
2761
+		return 0
2762
+	}
2763
+	var l int
2764
+	_ = l
2765
+	l = len(m.ID)
2766
+	if l > 0 {
2767
+		n += 1 + l + sovShim(uint64(l))
2768
+	}
2769
+	l = len(m.ExecID)
2770
+	if l > 0 {
2771
+		n += 1 + l + sovShim(uint64(l))
2772
+	}
2773
+	if m.Stdin {
2774
+		n += 2
2775
+	}
2776
+	if m.XXX_unrecognized != nil {
2777
+		n += len(m.XXX_unrecognized)
2778
+	}
2779
+	return n
2780
+}
2781
+
2782
+func (m *PidsRequest) Size() (n int) {
2783
+	if m == nil {
2784
+		return 0
2785
+	}
2786
+	var l int
2787
+	_ = l
2788
+	l = len(m.ID)
2789
+	if l > 0 {
2790
+		n += 1 + l + sovShim(uint64(l))
2791
+	}
2792
+	if m.XXX_unrecognized != nil {
2793
+		n += len(m.XXX_unrecognized)
2794
+	}
2795
+	return n
2796
+}
2797
+
2798
+func (m *PidsResponse) Size() (n int) {
2799
+	if m == nil {
2800
+		return 0
2801
+	}
2802
+	var l int
2803
+	_ = l
2804
+	if len(m.Processes) > 0 {
2805
+		for _, e := range m.Processes {
2806
+			l = e.Size()
2807
+			n += 1 + l + sovShim(uint64(l))
2808
+		}
2809
+	}
2810
+	if m.XXX_unrecognized != nil {
2811
+		n += len(m.XXX_unrecognized)
2812
+	}
2813
+	return n
2814
+}
2815
+
2816
+func (m *CheckpointTaskRequest) Size() (n int) {
2817
+	if m == nil {
2818
+		return 0
2819
+	}
2820
+	var l int
2821
+	_ = l
2822
+	l = len(m.ID)
2823
+	if l > 0 {
2824
+		n += 1 + l + sovShim(uint64(l))
2825
+	}
2826
+	l = len(m.Path)
2827
+	if l > 0 {
2828
+		n += 1 + l + sovShim(uint64(l))
2829
+	}
2830
+	if m.Options != nil {
2831
+		l = m.Options.Size()
2832
+		n += 1 + l + sovShim(uint64(l))
2833
+	}
2834
+	if m.XXX_unrecognized != nil {
2835
+		n += len(m.XXX_unrecognized)
2836
+	}
2837
+	return n
2838
+}
2839
+
2840
+func (m *UpdateTaskRequest) Size() (n int) {
2841
+	if m == nil {
2842
+		return 0
2843
+	}
2844
+	var l int
2845
+	_ = l
2846
+	l = len(m.ID)
2847
+	if l > 0 {
2848
+		n += 1 + l + sovShim(uint64(l))
2849
+	}
2850
+	if m.Resources != nil {
2851
+		l = m.Resources.Size()
2852
+		n += 1 + l + sovShim(uint64(l))
2853
+	}
2854
+	if len(m.Annotations) > 0 {
2855
+		for k, v := range m.Annotations {
2856
+			_ = k
2857
+			_ = v
2858
+			mapEntrySize := 1 + len(k) + sovShim(uint64(len(k))) + 1 + len(v) + sovShim(uint64(len(v)))
2859
+			n += mapEntrySize + 1 + sovShim(uint64(mapEntrySize))
2860
+		}
2861
+	}
2862
+	if m.XXX_unrecognized != nil {
2863
+		n += len(m.XXX_unrecognized)
2864
+	}
2865
+	return n
2866
+}
2867
+
2868
+func (m *StartRequest) Size() (n int) {
2869
+	if m == nil {
2870
+		return 0
2871
+	}
2872
+	var l int
2873
+	_ = l
2874
+	l = len(m.ID)
2875
+	if l > 0 {
2876
+		n += 1 + l + sovShim(uint64(l))
2877
+	}
2878
+	l = len(m.ExecID)
2879
+	if l > 0 {
2880
+		n += 1 + l + sovShim(uint64(l))
2881
+	}
2882
+	if m.XXX_unrecognized != nil {
2883
+		n += len(m.XXX_unrecognized)
2884
+	}
2885
+	return n
2886
+}
2887
+
2888
+func (m *StartResponse) Size() (n int) {
2889
+	if m == nil {
2890
+		return 0
2891
+	}
2892
+	var l int
2893
+	_ = l
2894
+	if m.Pid != 0 {
2895
+		n += 1 + sovShim(uint64(m.Pid))
2896
+	}
2897
+	if m.XXX_unrecognized != nil {
2898
+		n += len(m.XXX_unrecognized)
2899
+	}
2900
+	return n
2901
+}
2902
+
2903
+func (m *WaitRequest) Size() (n int) {
2904
+	if m == nil {
2905
+		return 0
2906
+	}
2907
+	var l int
2908
+	_ = l
2909
+	l = len(m.ID)
2910
+	if l > 0 {
2911
+		n += 1 + l + sovShim(uint64(l))
2912
+	}
2913
+	l = len(m.ExecID)
2914
+	if l > 0 {
2915
+		n += 1 + l + sovShim(uint64(l))
2916
+	}
2917
+	if m.XXX_unrecognized != nil {
2918
+		n += len(m.XXX_unrecognized)
2919
+	}
2920
+	return n
2921
+}
2922
+
2923
+func (m *WaitResponse) Size() (n int) {
2924
+	if m == nil {
2925
+		return 0
2926
+	}
2927
+	var l int
2928
+	_ = l
2929
+	if m.ExitStatus != 0 {
2930
+		n += 1 + sovShim(uint64(m.ExitStatus))
2931
+	}
2932
+	l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
2933
+	n += 1 + l + sovShim(uint64(l))
2934
+	if m.XXX_unrecognized != nil {
2935
+		n += len(m.XXX_unrecognized)
2936
+	}
2937
+	return n
2938
+}
2939
+
2940
+func (m *StatsRequest) Size() (n int) {
2941
+	if m == nil {
2942
+		return 0
2943
+	}
2944
+	var l int
2945
+	_ = l
2946
+	l = len(m.ID)
2947
+	if l > 0 {
2948
+		n += 1 + l + sovShim(uint64(l))
2949
+	}
2950
+	if m.XXX_unrecognized != nil {
2951
+		n += len(m.XXX_unrecognized)
2952
+	}
2953
+	return n
2954
+}
2955
+
2956
+func (m *StatsResponse) Size() (n int) {
2957
+	if m == nil {
2958
+		return 0
2959
+	}
2960
+	var l int
2961
+	_ = l
2962
+	if m.Stats != nil {
2963
+		l = m.Stats.Size()
2964
+		n += 1 + l + sovShim(uint64(l))
2965
+	}
2966
+	if m.XXX_unrecognized != nil {
2967
+		n += len(m.XXX_unrecognized)
2968
+	}
2969
+	return n
2970
+}
2971
+
2972
+func (m *ConnectRequest) Size() (n int) {
2973
+	if m == nil {
2974
+		return 0
2975
+	}
2976
+	var l int
2977
+	_ = l
2978
+	l = len(m.ID)
2979
+	if l > 0 {
2980
+		n += 1 + l + sovShim(uint64(l))
2981
+	}
2982
+	if m.XXX_unrecognized != nil {
2983
+		n += len(m.XXX_unrecognized)
2984
+	}
2985
+	return n
2986
+}
2987
+
2988
+func (m *ConnectResponse) Size() (n int) {
2989
+	if m == nil {
2990
+		return 0
2991
+	}
2992
+	var l int
2993
+	_ = l
2994
+	if m.ShimPid != 0 {
2995
+		n += 1 + sovShim(uint64(m.ShimPid))
2996
+	}
2997
+	if m.TaskPid != 0 {
2998
+		n += 1 + sovShim(uint64(m.TaskPid))
2999
+	}
3000
+	l = len(m.Version)
3001
+	if l > 0 {
3002
+		n += 1 + l + sovShim(uint64(l))
3003
+	}
3004
+	if m.XXX_unrecognized != nil {
3005
+		n += len(m.XXX_unrecognized)
3006
+	}
3007
+	return n
3008
+}
3009
+
3010
+func (m *ShutdownRequest) Size() (n int) {
3011
+	if m == nil {
3012
+		return 0
3013
+	}
3014
+	var l int
3015
+	_ = l
3016
+	l = len(m.ID)
3017
+	if l > 0 {
3018
+		n += 1 + l + sovShim(uint64(l))
3019
+	}
3020
+	if m.Now {
3021
+		n += 2
3022
+	}
3023
+	if m.XXX_unrecognized != nil {
3024
+		n += len(m.XXX_unrecognized)
3025
+	}
3026
+	return n
3027
+}
3028
+
3029
+func (m *PauseRequest) Size() (n int) {
3030
+	if m == nil {
3031
+		return 0
3032
+	}
3033
+	var l int
3034
+	_ = l
3035
+	l = len(m.ID)
3036
+	if l > 0 {
3037
+		n += 1 + l + sovShim(uint64(l))
3038
+	}
3039
+	if m.XXX_unrecognized != nil {
3040
+		n += len(m.XXX_unrecognized)
3041
+	}
3042
+	return n
3043
+}
3044
+
3045
+func (m *ResumeRequest) Size() (n int) {
3046
+	if m == nil {
3047
+		return 0
3048
+	}
3049
+	var l int
3050
+	_ = l
3051
+	l = len(m.ID)
3052
+	if l > 0 {
3053
+		n += 1 + l + sovShim(uint64(l))
3054
+	}
3055
+	if m.XXX_unrecognized != nil {
3056
+		n += len(m.XXX_unrecognized)
3057
+	}
3058
+	return n
3059
+}
3060
+
3061
+func sovShim(x uint64) (n int) {
3062
+	return (math_bits.Len64(x|1) + 6) / 7
3063
+}
3064
+func sozShim(x uint64) (n int) {
3065
+	return sovShim(uint64((x << 1) ^ uint64((int64(x) >> 63))))
3066
+}
3067
+func (this *CreateTaskRequest) String() string {
3068
+	if this == nil {
3069
+		return "nil"
3070
+	}
3071
+	repeatedStringForRootfs := "[]*Mount{"
3072
+	for _, f := range this.Rootfs {
3073
+		repeatedStringForRootfs += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
3074
+	}
3075
+	repeatedStringForRootfs += "}"
3076
+	s := strings.Join([]string{`&CreateTaskRequest{`,
3077
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3078
+		`Bundle:` + fmt.Sprintf("%v", this.Bundle) + `,`,
3079
+		`Rootfs:` + repeatedStringForRootfs + `,`,
3080
+		`Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`,
3081
+		`Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`,
3082
+		`Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`,
3083
+		`Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
3084
+		`Checkpoint:` + fmt.Sprintf("%v", this.Checkpoint) + `,`,
3085
+		`ParentCheckpoint:` + fmt.Sprintf("%v", this.ParentCheckpoint) + `,`,
3086
+		`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Any", "types1.Any", 1) + `,`,
3087
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3088
+		`}`,
3089
+	}, "")
3090
+	return s
3091
+}
3092
+func (this *CreateTaskResponse) String() string {
3093
+	if this == nil {
3094
+		return "nil"
3095
+	}
3096
+	s := strings.Join([]string{`&CreateTaskResponse{`,
3097
+		`Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
3098
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3099
+		`}`,
3100
+	}, "")
3101
+	return s
3102
+}
3103
+func (this *DeleteRequest) String() string {
3104
+	if this == nil {
3105
+		return "nil"
3106
+	}
3107
+	s := strings.Join([]string{`&DeleteRequest{`,
3108
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3109
+		`ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
3110
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3111
+		`}`,
3112
+	}, "")
3113
+	return s
3114
+}
3115
+func (this *DeleteResponse) String() string {
3116
+	if this == nil {
3117
+		return "nil"
3118
+	}
3119
+	s := strings.Join([]string{`&DeleteResponse{`,
3120
+		`Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
3121
+		`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
3122
+		`ExitedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ExitedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
3123
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3124
+		`}`,
3125
+	}, "")
3126
+	return s
3127
+}
3128
+func (this *ExecProcessRequest) String() string {
3129
+	if this == nil {
3130
+		return "nil"
3131
+	}
3132
+	s := strings.Join([]string{`&ExecProcessRequest{`,
3133
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3134
+		`ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
3135
+		`Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`,
3136
+		`Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`,
3137
+		`Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`,
3138
+		`Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
3139
+		`Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "Any", "types1.Any", 1) + `,`,
3140
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3141
+		`}`,
3142
+	}, "")
3143
+	return s
3144
+}
3145
+func (this *ExecProcessResponse) String() string {
3146
+	if this == nil {
3147
+		return "nil"
3148
+	}
3149
+	s := strings.Join([]string{`&ExecProcessResponse{`,
3150
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3151
+		`}`,
3152
+	}, "")
3153
+	return s
3154
+}
3155
+func (this *ResizePtyRequest) String() string {
3156
+	if this == nil {
3157
+		return "nil"
3158
+	}
3159
+	s := strings.Join([]string{`&ResizePtyRequest{`,
3160
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3161
+		`ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
3162
+		`Width:` + fmt.Sprintf("%v", this.Width) + `,`,
3163
+		`Height:` + fmt.Sprintf("%v", this.Height) + `,`,
3164
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3165
+		`}`,
3166
+	}, "")
3167
+	return s
3168
+}
3169
+func (this *StateRequest) String() string {
3170
+	if this == nil {
3171
+		return "nil"
3172
+	}
3173
+	s := strings.Join([]string{`&StateRequest{`,
3174
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3175
+		`ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
3176
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3177
+		`}`,
3178
+	}, "")
3179
+	return s
3180
+}
3181
+func (this *StateResponse) String() string {
3182
+	if this == nil {
3183
+		return "nil"
3184
+	}
3185
+	s := strings.Join([]string{`&StateResponse{`,
3186
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3187
+		`Bundle:` + fmt.Sprintf("%v", this.Bundle) + `,`,
3188
+		`Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
3189
+		`Status:` + fmt.Sprintf("%v", this.Status) + `,`,
3190
+		`Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`,
3191
+		`Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`,
3192
+		`Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
3193
+		`Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`,
3194
+		`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
3195
+		`ExitedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ExitedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
3196
+		`ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
3197
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3198
+		`}`,
3199
+	}, "")
3200
+	return s
3201
+}
3202
+func (this *KillRequest) String() string {
3203
+	if this == nil {
3204
+		return "nil"
3205
+	}
3206
+	s := strings.Join([]string{`&KillRequest{`,
3207
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3208
+		`ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
3209
+		`Signal:` + fmt.Sprintf("%v", this.Signal) + `,`,
3210
+		`All:` + fmt.Sprintf("%v", this.All) + `,`,
3211
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3212
+		`}`,
3213
+	}, "")
3214
+	return s
3215
+}
3216
+func (this *CloseIORequest) String() string {
3217
+	if this == nil {
3218
+		return "nil"
3219
+	}
3220
+	s := strings.Join([]string{`&CloseIORequest{`,
3221
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3222
+		`ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
3223
+		`Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`,
3224
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3225
+		`}`,
3226
+	}, "")
3227
+	return s
3228
+}
3229
+func (this *PidsRequest) String() string {
3230
+	if this == nil {
3231
+		return "nil"
3232
+	}
3233
+	s := strings.Join([]string{`&PidsRequest{`,
3234
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3235
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3236
+		`}`,
3237
+	}, "")
3238
+	return s
3239
+}
3240
+func (this *PidsResponse) String() string {
3241
+	if this == nil {
3242
+		return "nil"
3243
+	}
3244
+	repeatedStringForProcesses := "[]*ProcessInfo{"
3245
+	for _, f := range this.Processes {
3246
+		repeatedStringForProcesses += strings.Replace(fmt.Sprintf("%v", f), "ProcessInfo", "task.ProcessInfo", 1) + ","
3247
+	}
3248
+	repeatedStringForProcesses += "}"
3249
+	s := strings.Join([]string{`&PidsResponse{`,
3250
+		`Processes:` + repeatedStringForProcesses + `,`,
3251
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3252
+		`}`,
3253
+	}, "")
3254
+	return s
3255
+}
3256
+func (this *CheckpointTaskRequest) String() string {
3257
+	if this == nil {
3258
+		return "nil"
3259
+	}
3260
+	s := strings.Join([]string{`&CheckpointTaskRequest{`,
3261
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3262
+		`Path:` + fmt.Sprintf("%v", this.Path) + `,`,
3263
+		`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Any", "types1.Any", 1) + `,`,
3264
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3265
+		`}`,
3266
+	}, "")
3267
+	return s
3268
+}
3269
+func (this *UpdateTaskRequest) String() string {
3270
+	if this == nil {
3271
+		return "nil"
3272
+	}
3273
+	keysForAnnotations := make([]string, 0, len(this.Annotations))
3274
+	for k, _ := range this.Annotations {
3275
+		keysForAnnotations = append(keysForAnnotations, k)
3276
+	}
3277
+	github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations)
3278
+	mapStringForAnnotations := "map[string]string{"
3279
+	for _, k := range keysForAnnotations {
3280
+		mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k])
3281
+	}
3282
+	mapStringForAnnotations += "}"
3283
+	s := strings.Join([]string{`&UpdateTaskRequest{`,
3284
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3285
+		`Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Any", "types1.Any", 1) + `,`,
3286
+		`Annotations:` + mapStringForAnnotations + `,`,
3287
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3288
+		`}`,
3289
+	}, "")
3290
+	return s
3291
+}
3292
+func (this *StartRequest) String() string {
3293
+	if this == nil {
3294
+		return "nil"
3295
+	}
3296
+	s := strings.Join([]string{`&StartRequest{`,
3297
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3298
+		`ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
3299
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3300
+		`}`,
3301
+	}, "")
3302
+	return s
3303
+}
3304
+func (this *StartResponse) String() string {
3305
+	if this == nil {
3306
+		return "nil"
3307
+	}
3308
+	s := strings.Join([]string{`&StartResponse{`,
3309
+		`Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
3310
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3311
+		`}`,
3312
+	}, "")
3313
+	return s
3314
+}
3315
+func (this *WaitRequest) String() string {
3316
+	if this == nil {
3317
+		return "nil"
3318
+	}
3319
+	s := strings.Join([]string{`&WaitRequest{`,
3320
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3321
+		`ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
3322
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3323
+		`}`,
3324
+	}, "")
3325
+	return s
3326
+}
3327
+func (this *WaitResponse) String() string {
3328
+	if this == nil {
3329
+		return "nil"
3330
+	}
3331
+	s := strings.Join([]string{`&WaitResponse{`,
3332
+		`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
3333
+		`ExitedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ExitedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
3334
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3335
+		`}`,
3336
+	}, "")
3337
+	return s
3338
+}
3339
+func (this *StatsRequest) String() string {
3340
+	if this == nil {
3341
+		return "nil"
3342
+	}
3343
+	s := strings.Join([]string{`&StatsRequest{`,
3344
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3345
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3346
+		`}`,
3347
+	}, "")
3348
+	return s
3349
+}
3350
+func (this *StatsResponse) String() string {
3351
+	if this == nil {
3352
+		return "nil"
3353
+	}
3354
+	s := strings.Join([]string{`&StatsResponse{`,
3355
+		`Stats:` + strings.Replace(fmt.Sprintf("%v", this.Stats), "Any", "types1.Any", 1) + `,`,
3356
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3357
+		`}`,
3358
+	}, "")
3359
+	return s
3360
+}
3361
+func (this *ConnectRequest) String() string {
3362
+	if this == nil {
3363
+		return "nil"
3364
+	}
3365
+	s := strings.Join([]string{`&ConnectRequest{`,
3366
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3367
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3368
+		`}`,
3369
+	}, "")
3370
+	return s
3371
+}
3372
+func (this *ConnectResponse) String() string {
3373
+	if this == nil {
3374
+		return "nil"
3375
+	}
3376
+	s := strings.Join([]string{`&ConnectResponse{`,
3377
+		`ShimPid:` + fmt.Sprintf("%v", this.ShimPid) + `,`,
3378
+		`TaskPid:` + fmt.Sprintf("%v", this.TaskPid) + `,`,
3379
+		`Version:` + fmt.Sprintf("%v", this.Version) + `,`,
3380
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3381
+		`}`,
3382
+	}, "")
3383
+	return s
3384
+}
3385
+func (this *ShutdownRequest) String() string {
3386
+	if this == nil {
3387
+		return "nil"
3388
+	}
3389
+	s := strings.Join([]string{`&ShutdownRequest{`,
3390
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3391
+		`Now:` + fmt.Sprintf("%v", this.Now) + `,`,
3392
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3393
+		`}`,
3394
+	}, "")
3395
+	return s
3396
+}
3397
+func (this *PauseRequest) String() string {
3398
+	if this == nil {
3399
+		return "nil"
3400
+	}
3401
+	s := strings.Join([]string{`&PauseRequest{`,
3402
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3403
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3404
+		`}`,
3405
+	}, "")
3406
+	return s
3407
+}
3408
+func (this *ResumeRequest) String() string {
3409
+	if this == nil {
3410
+		return "nil"
3411
+	}
3412
+	s := strings.Join([]string{`&ResumeRequest{`,
3413
+		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
3414
+		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
3415
+		`}`,
3416
+	}, "")
3417
+	return s
3418
+}
3419
+func valueToStringShim(v interface{}) string {
3420
+	rv := reflect.ValueOf(v)
3421
+	if rv.IsNil() {
3422
+		return "nil"
3423
+	}
3424
+	pv := reflect.Indirect(rv).Interface()
3425
+	return fmt.Sprintf("*%v", pv)
3426
+}
3427
+
3428
+type TaskService interface {
3429
+	State(ctx context.Context, req *StateRequest) (*StateResponse, error)
3430
+	Create(ctx context.Context, req *CreateTaskRequest) (*CreateTaskResponse, error)
3431
+	Start(ctx context.Context, req *StartRequest) (*StartResponse, error)
3432
+	Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error)
3433
+	Pids(ctx context.Context, req *PidsRequest) (*PidsResponse, error)
3434
+	Pause(ctx context.Context, req *PauseRequest) (*types1.Empty, error)
3435
+	Resume(ctx context.Context, req *ResumeRequest) (*types1.Empty, error)
3436
+	Checkpoint(ctx context.Context, req *CheckpointTaskRequest) (*types1.Empty, error)
3437
+	Kill(ctx context.Context, req *KillRequest) (*types1.Empty, error)
3438
+	Exec(ctx context.Context, req *ExecProcessRequest) (*types1.Empty, error)
3439
+	ResizePty(ctx context.Context, req *ResizePtyRequest) (*types1.Empty, error)
3440
+	CloseIO(ctx context.Context, req *CloseIORequest) (*types1.Empty, error)
3441
+	Update(ctx context.Context, req *UpdateTaskRequest) (*types1.Empty, error)
3442
+	Wait(ctx context.Context, req *WaitRequest) (*WaitResponse, error)
3443
+	Stats(ctx context.Context, req *StatsRequest) (*StatsResponse, error)
3444
+	Connect(ctx context.Context, req *ConnectRequest) (*ConnectResponse, error)
3445
+	Shutdown(ctx context.Context, req *ShutdownRequest) (*types1.Empty, error)
3446
+}
3447
+
3448
+func RegisterTaskService(srv *github_com_containerd_ttrpc.Server, svc TaskService) {
3449
+	srv.Register("containerd.task.v2.Task", map[string]github_com_containerd_ttrpc.Method{
3450
+		"State": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3451
+			var req StateRequest
3452
+			if err := unmarshal(&req); err != nil {
3453
+				return nil, err
3454
+			}
3455
+			return svc.State(ctx, &req)
3456
+		},
3457
+		"Create": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3458
+			var req CreateTaskRequest
3459
+			if err := unmarshal(&req); err != nil {
3460
+				return nil, err
3461
+			}
3462
+			return svc.Create(ctx, &req)
3463
+		},
3464
+		"Start": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3465
+			var req StartRequest
3466
+			if err := unmarshal(&req); err != nil {
3467
+				return nil, err
3468
+			}
3469
+			return svc.Start(ctx, &req)
3470
+		},
3471
+		"Delete": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3472
+			var req DeleteRequest
3473
+			if err := unmarshal(&req); err != nil {
3474
+				return nil, err
3475
+			}
3476
+			return svc.Delete(ctx, &req)
3477
+		},
3478
+		"Pids": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3479
+			var req PidsRequest
3480
+			if err := unmarshal(&req); err != nil {
3481
+				return nil, err
3482
+			}
3483
+			return svc.Pids(ctx, &req)
3484
+		},
3485
+		"Pause": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3486
+			var req PauseRequest
3487
+			if err := unmarshal(&req); err != nil {
3488
+				return nil, err
3489
+			}
3490
+			return svc.Pause(ctx, &req)
3491
+		},
3492
+		"Resume": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3493
+			var req ResumeRequest
3494
+			if err := unmarshal(&req); err != nil {
3495
+				return nil, err
3496
+			}
3497
+			return svc.Resume(ctx, &req)
3498
+		},
3499
+		"Checkpoint": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3500
+			var req CheckpointTaskRequest
3501
+			if err := unmarshal(&req); err != nil {
3502
+				return nil, err
3503
+			}
3504
+			return svc.Checkpoint(ctx, &req)
3505
+		},
3506
+		"Kill": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3507
+			var req KillRequest
3508
+			if err := unmarshal(&req); err != nil {
3509
+				return nil, err
3510
+			}
3511
+			return svc.Kill(ctx, &req)
3512
+		},
3513
+		"Exec": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3514
+			var req ExecProcessRequest
3515
+			if err := unmarshal(&req); err != nil {
3516
+				return nil, err
3517
+			}
3518
+			return svc.Exec(ctx, &req)
3519
+		},
3520
+		"ResizePty": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3521
+			var req ResizePtyRequest
3522
+			if err := unmarshal(&req); err != nil {
3523
+				return nil, err
3524
+			}
3525
+			return svc.ResizePty(ctx, &req)
3526
+		},
3527
+		"CloseIO": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3528
+			var req CloseIORequest
3529
+			if err := unmarshal(&req); err != nil {
3530
+				return nil, err
3531
+			}
3532
+			return svc.CloseIO(ctx, &req)
3533
+		},
3534
+		"Update": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3535
+			var req UpdateTaskRequest
3536
+			if err := unmarshal(&req); err != nil {
3537
+				return nil, err
3538
+			}
3539
+			return svc.Update(ctx, &req)
3540
+		},
3541
+		"Wait": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3542
+			var req WaitRequest
3543
+			if err := unmarshal(&req); err != nil {
3544
+				return nil, err
3545
+			}
3546
+			return svc.Wait(ctx, &req)
3547
+		},
3548
+		"Stats": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3549
+			var req StatsRequest
3550
+			if err := unmarshal(&req); err != nil {
3551
+				return nil, err
3552
+			}
3553
+			return svc.Stats(ctx, &req)
3554
+		},
3555
+		"Connect": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3556
+			var req ConnectRequest
3557
+			if err := unmarshal(&req); err != nil {
3558
+				return nil, err
3559
+			}
3560
+			return svc.Connect(ctx, &req)
3561
+		},
3562
+		"Shutdown": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
3563
+			var req ShutdownRequest
3564
+			if err := unmarshal(&req); err != nil {
3565
+				return nil, err
3566
+			}
3567
+			return svc.Shutdown(ctx, &req)
3568
+		},
3569
+	})
3570
+}
3571
+
3572
+type taskClient struct {
3573
+	client *github_com_containerd_ttrpc.Client
3574
+}
3575
+
3576
+func NewTaskClient(client *github_com_containerd_ttrpc.Client) TaskService {
3577
+	return &taskClient{
3578
+		client: client,
3579
+	}
3580
+}
3581
+
3582
+func (c *taskClient) State(ctx context.Context, req *StateRequest) (*StateResponse, error) {
3583
+	var resp StateResponse
3584
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "State", req, &resp); err != nil {
3585
+		return nil, err
3586
+	}
3587
+	return &resp, nil
3588
+}
3589
+
3590
+func (c *taskClient) Create(ctx context.Context, req *CreateTaskRequest) (*CreateTaskResponse, error) {
3591
+	var resp CreateTaskResponse
3592
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Create", req, &resp); err != nil {
3593
+		return nil, err
3594
+	}
3595
+	return &resp, nil
3596
+}
3597
+
3598
+func (c *taskClient) Start(ctx context.Context, req *StartRequest) (*StartResponse, error) {
3599
+	var resp StartResponse
3600
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Start", req, &resp); err != nil {
3601
+		return nil, err
3602
+	}
3603
+	return &resp, nil
3604
+}
3605
+
3606
+func (c *taskClient) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error) {
3607
+	var resp DeleteResponse
3608
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Delete", req, &resp); err != nil {
3609
+		return nil, err
3610
+	}
3611
+	return &resp, nil
3612
+}
3613
+
3614
+func (c *taskClient) Pids(ctx context.Context, req *PidsRequest) (*PidsResponse, error) {
3615
+	var resp PidsResponse
3616
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Pids", req, &resp); err != nil {
3617
+		return nil, err
3618
+	}
3619
+	return &resp, nil
3620
+}
3621
+
3622
+func (c *taskClient) Pause(ctx context.Context, req *PauseRequest) (*types1.Empty, error) {
3623
+	var resp types1.Empty
3624
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Pause", req, &resp); err != nil {
3625
+		return nil, err
3626
+	}
3627
+	return &resp, nil
3628
+}
3629
+
3630
+func (c *taskClient) Resume(ctx context.Context, req *ResumeRequest) (*types1.Empty, error) {
3631
+	var resp types1.Empty
3632
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Resume", req, &resp); err != nil {
3633
+		return nil, err
3634
+	}
3635
+	return &resp, nil
3636
+}
3637
+
3638
+func (c *taskClient) Checkpoint(ctx context.Context, req *CheckpointTaskRequest) (*types1.Empty, error) {
3639
+	var resp types1.Empty
3640
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Checkpoint", req, &resp); err != nil {
3641
+		return nil, err
3642
+	}
3643
+	return &resp, nil
3644
+}
3645
+
3646
+func (c *taskClient) Kill(ctx context.Context, req *KillRequest) (*types1.Empty, error) {
3647
+	var resp types1.Empty
3648
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Kill", req, &resp); err != nil {
3649
+		return nil, err
3650
+	}
3651
+	return &resp, nil
3652
+}
3653
+
3654
+func (c *taskClient) Exec(ctx context.Context, req *ExecProcessRequest) (*types1.Empty, error) {
3655
+	var resp types1.Empty
3656
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Exec", req, &resp); err != nil {
3657
+		return nil, err
3658
+	}
3659
+	return &resp, nil
3660
+}
3661
+
3662
+func (c *taskClient) ResizePty(ctx context.Context, req *ResizePtyRequest) (*types1.Empty, error) {
3663
+	var resp types1.Empty
3664
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "ResizePty", req, &resp); err != nil {
3665
+		return nil, err
3666
+	}
3667
+	return &resp, nil
3668
+}
3669
+
3670
+func (c *taskClient) CloseIO(ctx context.Context, req *CloseIORequest) (*types1.Empty, error) {
3671
+	var resp types1.Empty
3672
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "CloseIO", req, &resp); err != nil {
3673
+		return nil, err
3674
+	}
3675
+	return &resp, nil
3676
+}
3677
+
3678
+func (c *taskClient) Update(ctx context.Context, req *UpdateTaskRequest) (*types1.Empty, error) {
3679
+	var resp types1.Empty
3680
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Update", req, &resp); err != nil {
3681
+		return nil, err
3682
+	}
3683
+	return &resp, nil
3684
+}
3685
+
3686
+func (c *taskClient) Wait(ctx context.Context, req *WaitRequest) (*WaitResponse, error) {
3687
+	var resp WaitResponse
3688
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Wait", req, &resp); err != nil {
3689
+		return nil, err
3690
+	}
3691
+	return &resp, nil
3692
+}
3693
+
3694
+func (c *taskClient) Stats(ctx context.Context, req *StatsRequest) (*StatsResponse, error) {
3695
+	var resp StatsResponse
3696
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Stats", req, &resp); err != nil {
3697
+		return nil, err
3698
+	}
3699
+	return &resp, nil
3700
+}
3701
+
3702
+func (c *taskClient) Connect(ctx context.Context, req *ConnectRequest) (*ConnectResponse, error) {
3703
+	var resp ConnectResponse
3704
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Connect", req, &resp); err != nil {
3705
+		return nil, err
3706
+	}
3707
+	return &resp, nil
3708
+}
3709
+
3710
+func (c *taskClient) Shutdown(ctx context.Context, req *ShutdownRequest) (*types1.Empty, error) {
3711
+	var resp types1.Empty
3712
+	if err := c.client.Call(ctx, "containerd.task.v2.Task", "Shutdown", req, &resp); err != nil {
3713
+		return nil, err
3714
+	}
3715
+	return &resp, nil
3716
+}
3717
+func (m *CreateTaskRequest) Unmarshal(dAtA []byte) error {
3718
+	l := len(dAtA)
3719
+	iNdEx := 0
3720
+	for iNdEx < l {
3721
+		preIndex := iNdEx
3722
+		var wire uint64
3723
+		for shift := uint(0); ; shift += 7 {
3724
+			if shift >= 64 {
3725
+				return ErrIntOverflowShim
3726
+			}
3727
+			if iNdEx >= l {
3728
+				return io.ErrUnexpectedEOF
3729
+			}
3730
+			b := dAtA[iNdEx]
3731
+			iNdEx++
3732
+			wire |= uint64(b&0x7F) << shift
3733
+			if b < 0x80 {
3734
+				break
3735
+			}
3736
+		}
3737
+		fieldNum := int32(wire >> 3)
3738
+		wireType := int(wire & 0x7)
3739
+		if wireType == 4 {
3740
+			return fmt.Errorf("proto: CreateTaskRequest: wiretype end group for non-group")
3741
+		}
3742
+		if fieldNum <= 0 {
3743
+			return fmt.Errorf("proto: CreateTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire)
3744
+		}
3745
+		switch fieldNum {
3746
+		case 1:
3747
+			if wireType != 2 {
3748
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
3749
+			}
3750
+			var stringLen uint64
3751
+			for shift := uint(0); ; shift += 7 {
3752
+				if shift >= 64 {
3753
+					return ErrIntOverflowShim
3754
+				}
3755
+				if iNdEx >= l {
3756
+					return io.ErrUnexpectedEOF
3757
+				}
3758
+				b := dAtA[iNdEx]
3759
+				iNdEx++
3760
+				stringLen |= uint64(b&0x7F) << shift
3761
+				if b < 0x80 {
3762
+					break
3763
+				}
3764
+			}
3765
+			intStringLen := int(stringLen)
3766
+			if intStringLen < 0 {
3767
+				return ErrInvalidLengthShim
3768
+			}
3769
+			postIndex := iNdEx + intStringLen
3770
+			if postIndex < 0 {
3771
+				return ErrInvalidLengthShim
3772
+			}
3773
+			if postIndex > l {
3774
+				return io.ErrUnexpectedEOF
3775
+			}
3776
+			m.ID = string(dAtA[iNdEx:postIndex])
3777
+			iNdEx = postIndex
3778
+		case 2:
3779
+			if wireType != 2 {
3780
+				return fmt.Errorf("proto: wrong wireType = %d for field Bundle", wireType)
3781
+			}
3782
+			var stringLen uint64
3783
+			for shift := uint(0); ; shift += 7 {
3784
+				if shift >= 64 {
3785
+					return ErrIntOverflowShim
3786
+				}
3787
+				if iNdEx >= l {
3788
+					return io.ErrUnexpectedEOF
3789
+				}
3790
+				b := dAtA[iNdEx]
3791
+				iNdEx++
3792
+				stringLen |= uint64(b&0x7F) << shift
3793
+				if b < 0x80 {
3794
+					break
3795
+				}
3796
+			}
3797
+			intStringLen := int(stringLen)
3798
+			if intStringLen < 0 {
3799
+				return ErrInvalidLengthShim
3800
+			}
3801
+			postIndex := iNdEx + intStringLen
3802
+			if postIndex < 0 {
3803
+				return ErrInvalidLengthShim
3804
+			}
3805
+			if postIndex > l {
3806
+				return io.ErrUnexpectedEOF
3807
+			}
3808
+			m.Bundle = string(dAtA[iNdEx:postIndex])
3809
+			iNdEx = postIndex
3810
+		case 3:
3811
+			if wireType != 2 {
3812
+				return fmt.Errorf("proto: wrong wireType = %d for field Rootfs", wireType)
3813
+			}
3814
+			var msglen int
3815
+			for shift := uint(0); ; shift += 7 {
3816
+				if shift >= 64 {
3817
+					return ErrIntOverflowShim
3818
+				}
3819
+				if iNdEx >= l {
3820
+					return io.ErrUnexpectedEOF
3821
+				}
3822
+				b := dAtA[iNdEx]
3823
+				iNdEx++
3824
+				msglen |= int(b&0x7F) << shift
3825
+				if b < 0x80 {
3826
+					break
3827
+				}
3828
+			}
3829
+			if msglen < 0 {
3830
+				return ErrInvalidLengthShim
3831
+			}
3832
+			postIndex := iNdEx + msglen
3833
+			if postIndex < 0 {
3834
+				return ErrInvalidLengthShim
3835
+			}
3836
+			if postIndex > l {
3837
+				return io.ErrUnexpectedEOF
3838
+			}
3839
+			m.Rootfs = append(m.Rootfs, &types.Mount{})
3840
+			if err := m.Rootfs[len(m.Rootfs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
3841
+				return err
3842
+			}
3843
+			iNdEx = postIndex
3844
+		case 4:
3845
+			if wireType != 0 {
3846
+				return fmt.Errorf("proto: wrong wireType = %d for field Terminal", wireType)
3847
+			}
3848
+			var v int
3849
+			for shift := uint(0); ; shift += 7 {
3850
+				if shift >= 64 {
3851
+					return ErrIntOverflowShim
3852
+				}
3853
+				if iNdEx >= l {
3854
+					return io.ErrUnexpectedEOF
3855
+				}
3856
+				b := dAtA[iNdEx]
3857
+				iNdEx++
3858
+				v |= int(b&0x7F) << shift
3859
+				if b < 0x80 {
3860
+					break
3861
+				}
3862
+			}
3863
+			m.Terminal = bool(v != 0)
3864
+		case 5:
3865
+			if wireType != 2 {
3866
+				return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType)
3867
+			}
3868
+			var stringLen uint64
3869
+			for shift := uint(0); ; shift += 7 {
3870
+				if shift >= 64 {
3871
+					return ErrIntOverflowShim
3872
+				}
3873
+				if iNdEx >= l {
3874
+					return io.ErrUnexpectedEOF
3875
+				}
3876
+				b := dAtA[iNdEx]
3877
+				iNdEx++
3878
+				stringLen |= uint64(b&0x7F) << shift
3879
+				if b < 0x80 {
3880
+					break
3881
+				}
3882
+			}
3883
+			intStringLen := int(stringLen)
3884
+			if intStringLen < 0 {
3885
+				return ErrInvalidLengthShim
3886
+			}
3887
+			postIndex := iNdEx + intStringLen
3888
+			if postIndex < 0 {
3889
+				return ErrInvalidLengthShim
3890
+			}
3891
+			if postIndex > l {
3892
+				return io.ErrUnexpectedEOF
3893
+			}
3894
+			m.Stdin = string(dAtA[iNdEx:postIndex])
3895
+			iNdEx = postIndex
3896
+		case 6:
3897
+			if wireType != 2 {
3898
+				return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType)
3899
+			}
3900
+			var stringLen uint64
3901
+			for shift := uint(0); ; shift += 7 {
3902
+				if shift >= 64 {
3903
+					return ErrIntOverflowShim
3904
+				}
3905
+				if iNdEx >= l {
3906
+					return io.ErrUnexpectedEOF
3907
+				}
3908
+				b := dAtA[iNdEx]
3909
+				iNdEx++
3910
+				stringLen |= uint64(b&0x7F) << shift
3911
+				if b < 0x80 {
3912
+					break
3913
+				}
3914
+			}
3915
+			intStringLen := int(stringLen)
3916
+			if intStringLen < 0 {
3917
+				return ErrInvalidLengthShim
3918
+			}
3919
+			postIndex := iNdEx + intStringLen
3920
+			if postIndex < 0 {
3921
+				return ErrInvalidLengthShim
3922
+			}
3923
+			if postIndex > l {
3924
+				return io.ErrUnexpectedEOF
3925
+			}
3926
+			m.Stdout = string(dAtA[iNdEx:postIndex])
3927
+			iNdEx = postIndex
3928
+		case 7:
3929
+			if wireType != 2 {
3930
+				return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType)
3931
+			}
3932
+			var stringLen uint64
3933
+			for shift := uint(0); ; shift += 7 {
3934
+				if shift >= 64 {
3935
+					return ErrIntOverflowShim
3936
+				}
3937
+				if iNdEx >= l {
3938
+					return io.ErrUnexpectedEOF
3939
+				}
3940
+				b := dAtA[iNdEx]
3941
+				iNdEx++
3942
+				stringLen |= uint64(b&0x7F) << shift
3943
+				if b < 0x80 {
3944
+					break
3945
+				}
3946
+			}
3947
+			intStringLen := int(stringLen)
3948
+			if intStringLen < 0 {
3949
+				return ErrInvalidLengthShim
3950
+			}
3951
+			postIndex := iNdEx + intStringLen
3952
+			if postIndex < 0 {
3953
+				return ErrInvalidLengthShim
3954
+			}
3955
+			if postIndex > l {
3956
+				return io.ErrUnexpectedEOF
3957
+			}
3958
+			m.Stderr = string(dAtA[iNdEx:postIndex])
3959
+			iNdEx = postIndex
3960
+		case 8:
3961
+			if wireType != 2 {
3962
+				return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType)
3963
+			}
3964
+			var stringLen uint64
3965
+			for shift := uint(0); ; shift += 7 {
3966
+				if shift >= 64 {
3967
+					return ErrIntOverflowShim
3968
+				}
3969
+				if iNdEx >= l {
3970
+					return io.ErrUnexpectedEOF
3971
+				}
3972
+				b := dAtA[iNdEx]
3973
+				iNdEx++
3974
+				stringLen |= uint64(b&0x7F) << shift
3975
+				if b < 0x80 {
3976
+					break
3977
+				}
3978
+			}
3979
+			intStringLen := int(stringLen)
3980
+			if intStringLen < 0 {
3981
+				return ErrInvalidLengthShim
3982
+			}
3983
+			postIndex := iNdEx + intStringLen
3984
+			if postIndex < 0 {
3985
+				return ErrInvalidLengthShim
3986
+			}
3987
+			if postIndex > l {
3988
+				return io.ErrUnexpectedEOF
3989
+			}
3990
+			m.Checkpoint = string(dAtA[iNdEx:postIndex])
3991
+			iNdEx = postIndex
3992
+		case 9:
3993
+			if wireType != 2 {
3994
+				return fmt.Errorf("proto: wrong wireType = %d for field ParentCheckpoint", wireType)
3995
+			}
3996
+			var stringLen uint64
3997
+			for shift := uint(0); ; shift += 7 {
3998
+				if shift >= 64 {
3999
+					return ErrIntOverflowShim
4000
+				}
4001
+				if iNdEx >= l {
4002
+					return io.ErrUnexpectedEOF
4003
+				}
4004
+				b := dAtA[iNdEx]
4005
+				iNdEx++
4006
+				stringLen |= uint64(b&0x7F) << shift
4007
+				if b < 0x80 {
4008
+					break
4009
+				}
4010
+			}
4011
+			intStringLen := int(stringLen)
4012
+			if intStringLen < 0 {
4013
+				return ErrInvalidLengthShim
4014
+			}
4015
+			postIndex := iNdEx + intStringLen
4016
+			if postIndex < 0 {
4017
+				return ErrInvalidLengthShim
4018
+			}
4019
+			if postIndex > l {
4020
+				return io.ErrUnexpectedEOF
4021
+			}
4022
+			m.ParentCheckpoint = string(dAtA[iNdEx:postIndex])
4023
+			iNdEx = postIndex
4024
+		case 10:
4025
+			if wireType != 2 {
4026
+				return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
4027
+			}
4028
+			var msglen int
4029
+			for shift := uint(0); ; shift += 7 {
4030
+				if shift >= 64 {
4031
+					return ErrIntOverflowShim
4032
+				}
4033
+				if iNdEx >= l {
4034
+					return io.ErrUnexpectedEOF
4035
+				}
4036
+				b := dAtA[iNdEx]
4037
+				iNdEx++
4038
+				msglen |= int(b&0x7F) << shift
4039
+				if b < 0x80 {
4040
+					break
4041
+				}
4042
+			}
4043
+			if msglen < 0 {
4044
+				return ErrInvalidLengthShim
4045
+			}
4046
+			postIndex := iNdEx + msglen
4047
+			if postIndex < 0 {
4048
+				return ErrInvalidLengthShim
4049
+			}
4050
+			if postIndex > l {
4051
+				return io.ErrUnexpectedEOF
4052
+			}
4053
+			if m.Options == nil {
4054
+				m.Options = &types1.Any{}
4055
+			}
4056
+			if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
4057
+				return err
4058
+			}
4059
+			iNdEx = postIndex
4060
+		default:
4061
+			iNdEx = preIndex
4062
+			skippy, err := skipShim(dAtA[iNdEx:])
4063
+			if err != nil {
4064
+				return err
4065
+			}
4066
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
4067
+				return ErrInvalidLengthShim
4068
+			}
4069
+			if (iNdEx + skippy) > l {
4070
+				return io.ErrUnexpectedEOF
4071
+			}
4072
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
4073
+			iNdEx += skippy
4074
+		}
4075
+	}
4076
+
4077
+	if iNdEx > l {
4078
+		return io.ErrUnexpectedEOF
4079
+	}
4080
+	return nil
4081
+}
4082
+func (m *CreateTaskResponse) Unmarshal(dAtA []byte) error {
4083
+	l := len(dAtA)
4084
+	iNdEx := 0
4085
+	for iNdEx < l {
4086
+		preIndex := iNdEx
4087
+		var wire uint64
4088
+		for shift := uint(0); ; shift += 7 {
4089
+			if shift >= 64 {
4090
+				return ErrIntOverflowShim
4091
+			}
4092
+			if iNdEx >= l {
4093
+				return io.ErrUnexpectedEOF
4094
+			}
4095
+			b := dAtA[iNdEx]
4096
+			iNdEx++
4097
+			wire |= uint64(b&0x7F) << shift
4098
+			if b < 0x80 {
4099
+				break
4100
+			}
4101
+		}
4102
+		fieldNum := int32(wire >> 3)
4103
+		wireType := int(wire & 0x7)
4104
+		if wireType == 4 {
4105
+			return fmt.Errorf("proto: CreateTaskResponse: wiretype end group for non-group")
4106
+		}
4107
+		if fieldNum <= 0 {
4108
+			return fmt.Errorf("proto: CreateTaskResponse: illegal tag %d (wire type %d)", fieldNum, wire)
4109
+		}
4110
+		switch fieldNum {
4111
+		case 1:
4112
+			if wireType != 0 {
4113
+				return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType)
4114
+			}
4115
+			m.Pid = 0
4116
+			for shift := uint(0); ; shift += 7 {
4117
+				if shift >= 64 {
4118
+					return ErrIntOverflowShim
4119
+				}
4120
+				if iNdEx >= l {
4121
+					return io.ErrUnexpectedEOF
4122
+				}
4123
+				b := dAtA[iNdEx]
4124
+				iNdEx++
4125
+				m.Pid |= uint32(b&0x7F) << shift
4126
+				if b < 0x80 {
4127
+					break
4128
+				}
4129
+			}
4130
+		default:
4131
+			iNdEx = preIndex
4132
+			skippy, err := skipShim(dAtA[iNdEx:])
4133
+			if err != nil {
4134
+				return err
4135
+			}
4136
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
4137
+				return ErrInvalidLengthShim
4138
+			}
4139
+			if (iNdEx + skippy) > l {
4140
+				return io.ErrUnexpectedEOF
4141
+			}
4142
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
4143
+			iNdEx += skippy
4144
+		}
4145
+	}
4146
+
4147
+	if iNdEx > l {
4148
+		return io.ErrUnexpectedEOF
4149
+	}
4150
+	return nil
4151
+}
4152
+func (m *DeleteRequest) Unmarshal(dAtA []byte) error {
4153
+	l := len(dAtA)
4154
+	iNdEx := 0
4155
+	for iNdEx < l {
4156
+		preIndex := iNdEx
4157
+		var wire uint64
4158
+		for shift := uint(0); ; shift += 7 {
4159
+			if shift >= 64 {
4160
+				return ErrIntOverflowShim
4161
+			}
4162
+			if iNdEx >= l {
4163
+				return io.ErrUnexpectedEOF
4164
+			}
4165
+			b := dAtA[iNdEx]
4166
+			iNdEx++
4167
+			wire |= uint64(b&0x7F) << shift
4168
+			if b < 0x80 {
4169
+				break
4170
+			}
4171
+		}
4172
+		fieldNum := int32(wire >> 3)
4173
+		wireType := int(wire & 0x7)
4174
+		if wireType == 4 {
4175
+			return fmt.Errorf("proto: DeleteRequest: wiretype end group for non-group")
4176
+		}
4177
+		if fieldNum <= 0 {
4178
+			return fmt.Errorf("proto: DeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire)
4179
+		}
4180
+		switch fieldNum {
4181
+		case 1:
4182
+			if wireType != 2 {
4183
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
4184
+			}
4185
+			var stringLen uint64
4186
+			for shift := uint(0); ; shift += 7 {
4187
+				if shift >= 64 {
4188
+					return ErrIntOverflowShim
4189
+				}
4190
+				if iNdEx >= l {
4191
+					return io.ErrUnexpectedEOF
4192
+				}
4193
+				b := dAtA[iNdEx]
4194
+				iNdEx++
4195
+				stringLen |= uint64(b&0x7F) << shift
4196
+				if b < 0x80 {
4197
+					break
4198
+				}
4199
+			}
4200
+			intStringLen := int(stringLen)
4201
+			if intStringLen < 0 {
4202
+				return ErrInvalidLengthShim
4203
+			}
4204
+			postIndex := iNdEx + intStringLen
4205
+			if postIndex < 0 {
4206
+				return ErrInvalidLengthShim
4207
+			}
4208
+			if postIndex > l {
4209
+				return io.ErrUnexpectedEOF
4210
+			}
4211
+			m.ID = string(dAtA[iNdEx:postIndex])
4212
+			iNdEx = postIndex
4213
+		case 2:
4214
+			if wireType != 2 {
4215
+				return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
4216
+			}
4217
+			var stringLen uint64
4218
+			for shift := uint(0); ; shift += 7 {
4219
+				if shift >= 64 {
4220
+					return ErrIntOverflowShim
4221
+				}
4222
+				if iNdEx >= l {
4223
+					return io.ErrUnexpectedEOF
4224
+				}
4225
+				b := dAtA[iNdEx]
4226
+				iNdEx++
4227
+				stringLen |= uint64(b&0x7F) << shift
4228
+				if b < 0x80 {
4229
+					break
4230
+				}
4231
+			}
4232
+			intStringLen := int(stringLen)
4233
+			if intStringLen < 0 {
4234
+				return ErrInvalidLengthShim
4235
+			}
4236
+			postIndex := iNdEx + intStringLen
4237
+			if postIndex < 0 {
4238
+				return ErrInvalidLengthShim
4239
+			}
4240
+			if postIndex > l {
4241
+				return io.ErrUnexpectedEOF
4242
+			}
4243
+			m.ExecID = string(dAtA[iNdEx:postIndex])
4244
+			iNdEx = postIndex
4245
+		default:
4246
+			iNdEx = preIndex
4247
+			skippy, err := skipShim(dAtA[iNdEx:])
4248
+			if err != nil {
4249
+				return err
4250
+			}
4251
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
4252
+				return ErrInvalidLengthShim
4253
+			}
4254
+			if (iNdEx + skippy) > l {
4255
+				return io.ErrUnexpectedEOF
4256
+			}
4257
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
4258
+			iNdEx += skippy
4259
+		}
4260
+	}
4261
+
4262
+	if iNdEx > l {
4263
+		return io.ErrUnexpectedEOF
4264
+	}
4265
+	return nil
4266
+}
4267
+func (m *DeleteResponse) Unmarshal(dAtA []byte) error {
4268
+	l := len(dAtA)
4269
+	iNdEx := 0
4270
+	for iNdEx < l {
4271
+		preIndex := iNdEx
4272
+		var wire uint64
4273
+		for shift := uint(0); ; shift += 7 {
4274
+			if shift >= 64 {
4275
+				return ErrIntOverflowShim
4276
+			}
4277
+			if iNdEx >= l {
4278
+				return io.ErrUnexpectedEOF
4279
+			}
4280
+			b := dAtA[iNdEx]
4281
+			iNdEx++
4282
+			wire |= uint64(b&0x7F) << shift
4283
+			if b < 0x80 {
4284
+				break
4285
+			}
4286
+		}
4287
+		fieldNum := int32(wire >> 3)
4288
+		wireType := int(wire & 0x7)
4289
+		if wireType == 4 {
4290
+			return fmt.Errorf("proto: DeleteResponse: wiretype end group for non-group")
4291
+		}
4292
+		if fieldNum <= 0 {
4293
+			return fmt.Errorf("proto: DeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire)
4294
+		}
4295
+		switch fieldNum {
4296
+		case 1:
4297
+			if wireType != 0 {
4298
+				return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType)
4299
+			}
4300
+			m.Pid = 0
4301
+			for shift := uint(0); ; shift += 7 {
4302
+				if shift >= 64 {
4303
+					return ErrIntOverflowShim
4304
+				}
4305
+				if iNdEx >= l {
4306
+					return io.ErrUnexpectedEOF
4307
+				}
4308
+				b := dAtA[iNdEx]
4309
+				iNdEx++
4310
+				m.Pid |= uint32(b&0x7F) << shift
4311
+				if b < 0x80 {
4312
+					break
4313
+				}
4314
+			}
4315
+		case 2:
4316
+			if wireType != 0 {
4317
+				return fmt.Errorf("proto: wrong wireType = %d for field ExitStatus", wireType)
4318
+			}
4319
+			m.ExitStatus = 0
4320
+			for shift := uint(0); ; shift += 7 {
4321
+				if shift >= 64 {
4322
+					return ErrIntOverflowShim
4323
+				}
4324
+				if iNdEx >= l {
4325
+					return io.ErrUnexpectedEOF
4326
+				}
4327
+				b := dAtA[iNdEx]
4328
+				iNdEx++
4329
+				m.ExitStatus |= uint32(b&0x7F) << shift
4330
+				if b < 0x80 {
4331
+					break
4332
+				}
4333
+			}
4334
+		case 3:
4335
+			if wireType != 2 {
4336
+				return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", wireType)
4337
+			}
4338
+			var msglen int
4339
+			for shift := uint(0); ; shift += 7 {
4340
+				if shift >= 64 {
4341
+					return ErrIntOverflowShim
4342
+				}
4343
+				if iNdEx >= l {
4344
+					return io.ErrUnexpectedEOF
4345
+				}
4346
+				b := dAtA[iNdEx]
4347
+				iNdEx++
4348
+				msglen |= int(b&0x7F) << shift
4349
+				if b < 0x80 {
4350
+					break
4351
+				}
4352
+			}
4353
+			if msglen < 0 {
4354
+				return ErrInvalidLengthShim
4355
+			}
4356
+			postIndex := iNdEx + msglen
4357
+			if postIndex < 0 {
4358
+				return ErrInvalidLengthShim
4359
+			}
4360
+			if postIndex > l {
4361
+				return io.ErrUnexpectedEOF
4362
+			}
4363
+			if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
4364
+				return err
4365
+			}
4366
+			iNdEx = postIndex
4367
+		default:
4368
+			iNdEx = preIndex
4369
+			skippy, err := skipShim(dAtA[iNdEx:])
4370
+			if err != nil {
4371
+				return err
4372
+			}
4373
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
4374
+				return ErrInvalidLengthShim
4375
+			}
4376
+			if (iNdEx + skippy) > l {
4377
+				return io.ErrUnexpectedEOF
4378
+			}
4379
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
4380
+			iNdEx += skippy
4381
+		}
4382
+	}
4383
+
4384
+	if iNdEx > l {
4385
+		return io.ErrUnexpectedEOF
4386
+	}
4387
+	return nil
4388
+}
4389
+func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error {
4390
+	l := len(dAtA)
4391
+	iNdEx := 0
4392
+	for iNdEx < l {
4393
+		preIndex := iNdEx
4394
+		var wire uint64
4395
+		for shift := uint(0); ; shift += 7 {
4396
+			if shift >= 64 {
4397
+				return ErrIntOverflowShim
4398
+			}
4399
+			if iNdEx >= l {
4400
+				return io.ErrUnexpectedEOF
4401
+			}
4402
+			b := dAtA[iNdEx]
4403
+			iNdEx++
4404
+			wire |= uint64(b&0x7F) << shift
4405
+			if b < 0x80 {
4406
+				break
4407
+			}
4408
+		}
4409
+		fieldNum := int32(wire >> 3)
4410
+		wireType := int(wire & 0x7)
4411
+		if wireType == 4 {
4412
+			return fmt.Errorf("proto: ExecProcessRequest: wiretype end group for non-group")
4413
+		}
4414
+		if fieldNum <= 0 {
4415
+			return fmt.Errorf("proto: ExecProcessRequest: illegal tag %d (wire type %d)", fieldNum, wire)
4416
+		}
4417
+		switch fieldNum {
4418
+		case 1:
4419
+			if wireType != 2 {
4420
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
4421
+			}
4422
+			var stringLen uint64
4423
+			for shift := uint(0); ; shift += 7 {
4424
+				if shift >= 64 {
4425
+					return ErrIntOverflowShim
4426
+				}
4427
+				if iNdEx >= l {
4428
+					return io.ErrUnexpectedEOF
4429
+				}
4430
+				b := dAtA[iNdEx]
4431
+				iNdEx++
4432
+				stringLen |= uint64(b&0x7F) << shift
4433
+				if b < 0x80 {
4434
+					break
4435
+				}
4436
+			}
4437
+			intStringLen := int(stringLen)
4438
+			if intStringLen < 0 {
4439
+				return ErrInvalidLengthShim
4440
+			}
4441
+			postIndex := iNdEx + intStringLen
4442
+			if postIndex < 0 {
4443
+				return ErrInvalidLengthShim
4444
+			}
4445
+			if postIndex > l {
4446
+				return io.ErrUnexpectedEOF
4447
+			}
4448
+			m.ID = string(dAtA[iNdEx:postIndex])
4449
+			iNdEx = postIndex
4450
+		case 2:
4451
+			if wireType != 2 {
4452
+				return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
4453
+			}
4454
+			var stringLen uint64
4455
+			for shift := uint(0); ; shift += 7 {
4456
+				if shift >= 64 {
4457
+					return ErrIntOverflowShim
4458
+				}
4459
+				if iNdEx >= l {
4460
+					return io.ErrUnexpectedEOF
4461
+				}
4462
+				b := dAtA[iNdEx]
4463
+				iNdEx++
4464
+				stringLen |= uint64(b&0x7F) << shift
4465
+				if b < 0x80 {
4466
+					break
4467
+				}
4468
+			}
4469
+			intStringLen := int(stringLen)
4470
+			if intStringLen < 0 {
4471
+				return ErrInvalidLengthShim
4472
+			}
4473
+			postIndex := iNdEx + intStringLen
4474
+			if postIndex < 0 {
4475
+				return ErrInvalidLengthShim
4476
+			}
4477
+			if postIndex > l {
4478
+				return io.ErrUnexpectedEOF
4479
+			}
4480
+			m.ExecID = string(dAtA[iNdEx:postIndex])
4481
+			iNdEx = postIndex
4482
+		case 3:
4483
+			if wireType != 0 {
4484
+				return fmt.Errorf("proto: wrong wireType = %d for field Terminal", wireType)
4485
+			}
4486
+			var v int
4487
+			for shift := uint(0); ; shift += 7 {
4488
+				if shift >= 64 {
4489
+					return ErrIntOverflowShim
4490
+				}
4491
+				if iNdEx >= l {
4492
+					return io.ErrUnexpectedEOF
4493
+				}
4494
+				b := dAtA[iNdEx]
4495
+				iNdEx++
4496
+				v |= int(b&0x7F) << shift
4497
+				if b < 0x80 {
4498
+					break
4499
+				}
4500
+			}
4501
+			m.Terminal = bool(v != 0)
4502
+		case 4:
4503
+			if wireType != 2 {
4504
+				return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType)
4505
+			}
4506
+			var stringLen uint64
4507
+			for shift := uint(0); ; shift += 7 {
4508
+				if shift >= 64 {
4509
+					return ErrIntOverflowShim
4510
+				}
4511
+				if iNdEx >= l {
4512
+					return io.ErrUnexpectedEOF
4513
+				}
4514
+				b := dAtA[iNdEx]
4515
+				iNdEx++
4516
+				stringLen |= uint64(b&0x7F) << shift
4517
+				if b < 0x80 {
4518
+					break
4519
+				}
4520
+			}
4521
+			intStringLen := int(stringLen)
4522
+			if intStringLen < 0 {
4523
+				return ErrInvalidLengthShim
4524
+			}
4525
+			postIndex := iNdEx + intStringLen
4526
+			if postIndex < 0 {
4527
+				return ErrInvalidLengthShim
4528
+			}
4529
+			if postIndex > l {
4530
+				return io.ErrUnexpectedEOF
4531
+			}
4532
+			m.Stdin = string(dAtA[iNdEx:postIndex])
4533
+			iNdEx = postIndex
4534
+		case 5:
4535
+			if wireType != 2 {
4536
+				return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType)
4537
+			}
4538
+			var stringLen uint64
4539
+			for shift := uint(0); ; shift += 7 {
4540
+				if shift >= 64 {
4541
+					return ErrIntOverflowShim
4542
+				}
4543
+				if iNdEx >= l {
4544
+					return io.ErrUnexpectedEOF
4545
+				}
4546
+				b := dAtA[iNdEx]
4547
+				iNdEx++
4548
+				stringLen |= uint64(b&0x7F) << shift
4549
+				if b < 0x80 {
4550
+					break
4551
+				}
4552
+			}
4553
+			intStringLen := int(stringLen)
4554
+			if intStringLen < 0 {
4555
+				return ErrInvalidLengthShim
4556
+			}
4557
+			postIndex := iNdEx + intStringLen
4558
+			if postIndex < 0 {
4559
+				return ErrInvalidLengthShim
4560
+			}
4561
+			if postIndex > l {
4562
+				return io.ErrUnexpectedEOF
4563
+			}
4564
+			m.Stdout = string(dAtA[iNdEx:postIndex])
4565
+			iNdEx = postIndex
4566
+		case 6:
4567
+			if wireType != 2 {
4568
+				return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType)
4569
+			}
4570
+			var stringLen uint64
4571
+			for shift := uint(0); ; shift += 7 {
4572
+				if shift >= 64 {
4573
+					return ErrIntOverflowShim
4574
+				}
4575
+				if iNdEx >= l {
4576
+					return io.ErrUnexpectedEOF
4577
+				}
4578
+				b := dAtA[iNdEx]
4579
+				iNdEx++
4580
+				stringLen |= uint64(b&0x7F) << shift
4581
+				if b < 0x80 {
4582
+					break
4583
+				}
4584
+			}
4585
+			intStringLen := int(stringLen)
4586
+			if intStringLen < 0 {
4587
+				return ErrInvalidLengthShim
4588
+			}
4589
+			postIndex := iNdEx + intStringLen
4590
+			if postIndex < 0 {
4591
+				return ErrInvalidLengthShim
4592
+			}
4593
+			if postIndex > l {
4594
+				return io.ErrUnexpectedEOF
4595
+			}
4596
+			m.Stderr = string(dAtA[iNdEx:postIndex])
4597
+			iNdEx = postIndex
4598
+		case 7:
4599
+			if wireType != 2 {
4600
+				return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
4601
+			}
4602
+			var msglen int
4603
+			for shift := uint(0); ; shift += 7 {
4604
+				if shift >= 64 {
4605
+					return ErrIntOverflowShim
4606
+				}
4607
+				if iNdEx >= l {
4608
+					return io.ErrUnexpectedEOF
4609
+				}
4610
+				b := dAtA[iNdEx]
4611
+				iNdEx++
4612
+				msglen |= int(b&0x7F) << shift
4613
+				if b < 0x80 {
4614
+					break
4615
+				}
4616
+			}
4617
+			if msglen < 0 {
4618
+				return ErrInvalidLengthShim
4619
+			}
4620
+			postIndex := iNdEx + msglen
4621
+			if postIndex < 0 {
4622
+				return ErrInvalidLengthShim
4623
+			}
4624
+			if postIndex > l {
4625
+				return io.ErrUnexpectedEOF
4626
+			}
4627
+			if m.Spec == nil {
4628
+				m.Spec = &types1.Any{}
4629
+			}
4630
+			if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
4631
+				return err
4632
+			}
4633
+			iNdEx = postIndex
4634
+		default:
4635
+			iNdEx = preIndex
4636
+			skippy, err := skipShim(dAtA[iNdEx:])
4637
+			if err != nil {
4638
+				return err
4639
+			}
4640
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
4641
+				return ErrInvalidLengthShim
4642
+			}
4643
+			if (iNdEx + skippy) > l {
4644
+				return io.ErrUnexpectedEOF
4645
+			}
4646
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
4647
+			iNdEx += skippy
4648
+		}
4649
+	}
4650
+
4651
+	if iNdEx > l {
4652
+		return io.ErrUnexpectedEOF
4653
+	}
4654
+	return nil
4655
+}
4656
+func (m *ExecProcessResponse) Unmarshal(dAtA []byte) error {
4657
+	l := len(dAtA)
4658
+	iNdEx := 0
4659
+	for iNdEx < l {
4660
+		preIndex := iNdEx
4661
+		var wire uint64
4662
+		for shift := uint(0); ; shift += 7 {
4663
+			if shift >= 64 {
4664
+				return ErrIntOverflowShim
4665
+			}
4666
+			if iNdEx >= l {
4667
+				return io.ErrUnexpectedEOF
4668
+			}
4669
+			b := dAtA[iNdEx]
4670
+			iNdEx++
4671
+			wire |= uint64(b&0x7F) << shift
4672
+			if b < 0x80 {
4673
+				break
4674
+			}
4675
+		}
4676
+		fieldNum := int32(wire >> 3)
4677
+		wireType := int(wire & 0x7)
4678
+		if wireType == 4 {
4679
+			return fmt.Errorf("proto: ExecProcessResponse: wiretype end group for non-group")
4680
+		}
4681
+		if fieldNum <= 0 {
4682
+			return fmt.Errorf("proto: ExecProcessResponse: illegal tag %d (wire type %d)", fieldNum, wire)
4683
+		}
4684
+		switch fieldNum {
4685
+		default:
4686
+			iNdEx = preIndex
4687
+			skippy, err := skipShim(dAtA[iNdEx:])
4688
+			if err != nil {
4689
+				return err
4690
+			}
4691
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
4692
+				return ErrInvalidLengthShim
4693
+			}
4694
+			if (iNdEx + skippy) > l {
4695
+				return io.ErrUnexpectedEOF
4696
+			}
4697
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
4698
+			iNdEx += skippy
4699
+		}
4700
+	}
4701
+
4702
+	if iNdEx > l {
4703
+		return io.ErrUnexpectedEOF
4704
+	}
4705
+	return nil
4706
+}
4707
+func (m *ResizePtyRequest) Unmarshal(dAtA []byte) error {
4708
+	l := len(dAtA)
4709
+	iNdEx := 0
4710
+	for iNdEx < l {
4711
+		preIndex := iNdEx
4712
+		var wire uint64
4713
+		for shift := uint(0); ; shift += 7 {
4714
+			if shift >= 64 {
4715
+				return ErrIntOverflowShim
4716
+			}
4717
+			if iNdEx >= l {
4718
+				return io.ErrUnexpectedEOF
4719
+			}
4720
+			b := dAtA[iNdEx]
4721
+			iNdEx++
4722
+			wire |= uint64(b&0x7F) << shift
4723
+			if b < 0x80 {
4724
+				break
4725
+			}
4726
+		}
4727
+		fieldNum := int32(wire >> 3)
4728
+		wireType := int(wire & 0x7)
4729
+		if wireType == 4 {
4730
+			return fmt.Errorf("proto: ResizePtyRequest: wiretype end group for non-group")
4731
+		}
4732
+		if fieldNum <= 0 {
4733
+			return fmt.Errorf("proto: ResizePtyRequest: illegal tag %d (wire type %d)", fieldNum, wire)
4734
+		}
4735
+		switch fieldNum {
4736
+		case 1:
4737
+			if wireType != 2 {
4738
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
4739
+			}
4740
+			var stringLen uint64
4741
+			for shift := uint(0); ; shift += 7 {
4742
+				if shift >= 64 {
4743
+					return ErrIntOverflowShim
4744
+				}
4745
+				if iNdEx >= l {
4746
+					return io.ErrUnexpectedEOF
4747
+				}
4748
+				b := dAtA[iNdEx]
4749
+				iNdEx++
4750
+				stringLen |= uint64(b&0x7F) << shift
4751
+				if b < 0x80 {
4752
+					break
4753
+				}
4754
+			}
4755
+			intStringLen := int(stringLen)
4756
+			if intStringLen < 0 {
4757
+				return ErrInvalidLengthShim
4758
+			}
4759
+			postIndex := iNdEx + intStringLen
4760
+			if postIndex < 0 {
4761
+				return ErrInvalidLengthShim
4762
+			}
4763
+			if postIndex > l {
4764
+				return io.ErrUnexpectedEOF
4765
+			}
4766
+			m.ID = string(dAtA[iNdEx:postIndex])
4767
+			iNdEx = postIndex
4768
+		case 2:
4769
+			if wireType != 2 {
4770
+				return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
4771
+			}
4772
+			var stringLen uint64
4773
+			for shift := uint(0); ; shift += 7 {
4774
+				if shift >= 64 {
4775
+					return ErrIntOverflowShim
4776
+				}
4777
+				if iNdEx >= l {
4778
+					return io.ErrUnexpectedEOF
4779
+				}
4780
+				b := dAtA[iNdEx]
4781
+				iNdEx++
4782
+				stringLen |= uint64(b&0x7F) << shift
4783
+				if b < 0x80 {
4784
+					break
4785
+				}
4786
+			}
4787
+			intStringLen := int(stringLen)
4788
+			if intStringLen < 0 {
4789
+				return ErrInvalidLengthShim
4790
+			}
4791
+			postIndex := iNdEx + intStringLen
4792
+			if postIndex < 0 {
4793
+				return ErrInvalidLengthShim
4794
+			}
4795
+			if postIndex > l {
4796
+				return io.ErrUnexpectedEOF
4797
+			}
4798
+			m.ExecID = string(dAtA[iNdEx:postIndex])
4799
+			iNdEx = postIndex
4800
+		case 3:
4801
+			if wireType != 0 {
4802
+				return fmt.Errorf("proto: wrong wireType = %d for field Width", wireType)
4803
+			}
4804
+			m.Width = 0
4805
+			for shift := uint(0); ; shift += 7 {
4806
+				if shift >= 64 {
4807
+					return ErrIntOverflowShim
4808
+				}
4809
+				if iNdEx >= l {
4810
+					return io.ErrUnexpectedEOF
4811
+				}
4812
+				b := dAtA[iNdEx]
4813
+				iNdEx++
4814
+				m.Width |= uint32(b&0x7F) << shift
4815
+				if b < 0x80 {
4816
+					break
4817
+				}
4818
+			}
4819
+		case 4:
4820
+			if wireType != 0 {
4821
+				return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
4822
+			}
4823
+			m.Height = 0
4824
+			for shift := uint(0); ; shift += 7 {
4825
+				if shift >= 64 {
4826
+					return ErrIntOverflowShim
4827
+				}
4828
+				if iNdEx >= l {
4829
+					return io.ErrUnexpectedEOF
4830
+				}
4831
+				b := dAtA[iNdEx]
4832
+				iNdEx++
4833
+				m.Height |= uint32(b&0x7F) << shift
4834
+				if b < 0x80 {
4835
+					break
4836
+				}
4837
+			}
4838
+		default:
4839
+			iNdEx = preIndex
4840
+			skippy, err := skipShim(dAtA[iNdEx:])
4841
+			if err != nil {
4842
+				return err
4843
+			}
4844
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
4845
+				return ErrInvalidLengthShim
4846
+			}
4847
+			if (iNdEx + skippy) > l {
4848
+				return io.ErrUnexpectedEOF
4849
+			}
4850
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
4851
+			iNdEx += skippy
4852
+		}
4853
+	}
4854
+
4855
+	if iNdEx > l {
4856
+		return io.ErrUnexpectedEOF
4857
+	}
4858
+	return nil
4859
+}
4860
+func (m *StateRequest) Unmarshal(dAtA []byte) error {
4861
+	l := len(dAtA)
4862
+	iNdEx := 0
4863
+	for iNdEx < l {
4864
+		preIndex := iNdEx
4865
+		var wire uint64
4866
+		for shift := uint(0); ; shift += 7 {
4867
+			if shift >= 64 {
4868
+				return ErrIntOverflowShim
4869
+			}
4870
+			if iNdEx >= l {
4871
+				return io.ErrUnexpectedEOF
4872
+			}
4873
+			b := dAtA[iNdEx]
4874
+			iNdEx++
4875
+			wire |= uint64(b&0x7F) << shift
4876
+			if b < 0x80 {
4877
+				break
4878
+			}
4879
+		}
4880
+		fieldNum := int32(wire >> 3)
4881
+		wireType := int(wire & 0x7)
4882
+		if wireType == 4 {
4883
+			return fmt.Errorf("proto: StateRequest: wiretype end group for non-group")
4884
+		}
4885
+		if fieldNum <= 0 {
4886
+			return fmt.Errorf("proto: StateRequest: illegal tag %d (wire type %d)", fieldNum, wire)
4887
+		}
4888
+		switch fieldNum {
4889
+		case 1:
4890
+			if wireType != 2 {
4891
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
4892
+			}
4893
+			var stringLen uint64
4894
+			for shift := uint(0); ; shift += 7 {
4895
+				if shift >= 64 {
4896
+					return ErrIntOverflowShim
4897
+				}
4898
+				if iNdEx >= l {
4899
+					return io.ErrUnexpectedEOF
4900
+				}
4901
+				b := dAtA[iNdEx]
4902
+				iNdEx++
4903
+				stringLen |= uint64(b&0x7F) << shift
4904
+				if b < 0x80 {
4905
+					break
4906
+				}
4907
+			}
4908
+			intStringLen := int(stringLen)
4909
+			if intStringLen < 0 {
4910
+				return ErrInvalidLengthShim
4911
+			}
4912
+			postIndex := iNdEx + intStringLen
4913
+			if postIndex < 0 {
4914
+				return ErrInvalidLengthShim
4915
+			}
4916
+			if postIndex > l {
4917
+				return io.ErrUnexpectedEOF
4918
+			}
4919
+			m.ID = string(dAtA[iNdEx:postIndex])
4920
+			iNdEx = postIndex
4921
+		case 2:
4922
+			if wireType != 2 {
4923
+				return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
4924
+			}
4925
+			var stringLen uint64
4926
+			for shift := uint(0); ; shift += 7 {
4927
+				if shift >= 64 {
4928
+					return ErrIntOverflowShim
4929
+				}
4930
+				if iNdEx >= l {
4931
+					return io.ErrUnexpectedEOF
4932
+				}
4933
+				b := dAtA[iNdEx]
4934
+				iNdEx++
4935
+				stringLen |= uint64(b&0x7F) << shift
4936
+				if b < 0x80 {
4937
+					break
4938
+				}
4939
+			}
4940
+			intStringLen := int(stringLen)
4941
+			if intStringLen < 0 {
4942
+				return ErrInvalidLengthShim
4943
+			}
4944
+			postIndex := iNdEx + intStringLen
4945
+			if postIndex < 0 {
4946
+				return ErrInvalidLengthShim
4947
+			}
4948
+			if postIndex > l {
4949
+				return io.ErrUnexpectedEOF
4950
+			}
4951
+			m.ExecID = string(dAtA[iNdEx:postIndex])
4952
+			iNdEx = postIndex
4953
+		default:
4954
+			iNdEx = preIndex
4955
+			skippy, err := skipShim(dAtA[iNdEx:])
4956
+			if err != nil {
4957
+				return err
4958
+			}
4959
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
4960
+				return ErrInvalidLengthShim
4961
+			}
4962
+			if (iNdEx + skippy) > l {
4963
+				return io.ErrUnexpectedEOF
4964
+			}
4965
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
4966
+			iNdEx += skippy
4967
+		}
4968
+	}
4969
+
4970
+	if iNdEx > l {
4971
+		return io.ErrUnexpectedEOF
4972
+	}
4973
+	return nil
4974
+}
4975
+func (m *StateResponse) Unmarshal(dAtA []byte) error {
4976
+	l := len(dAtA)
4977
+	iNdEx := 0
4978
+	for iNdEx < l {
4979
+		preIndex := iNdEx
4980
+		var wire uint64
4981
+		for shift := uint(0); ; shift += 7 {
4982
+			if shift >= 64 {
4983
+				return ErrIntOverflowShim
4984
+			}
4985
+			if iNdEx >= l {
4986
+				return io.ErrUnexpectedEOF
4987
+			}
4988
+			b := dAtA[iNdEx]
4989
+			iNdEx++
4990
+			wire |= uint64(b&0x7F) << shift
4991
+			if b < 0x80 {
4992
+				break
4993
+			}
4994
+		}
4995
+		fieldNum := int32(wire >> 3)
4996
+		wireType := int(wire & 0x7)
4997
+		if wireType == 4 {
4998
+			return fmt.Errorf("proto: StateResponse: wiretype end group for non-group")
4999
+		}
5000
+		if fieldNum <= 0 {
5001
+			return fmt.Errorf("proto: StateResponse: illegal tag %d (wire type %d)", fieldNum, wire)
5002
+		}
5003
+		switch fieldNum {
5004
+		case 1:
5005
+			if wireType != 2 {
5006
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
5007
+			}
5008
+			var stringLen uint64
5009
+			for shift := uint(0); ; shift += 7 {
5010
+				if shift >= 64 {
5011
+					return ErrIntOverflowShim
5012
+				}
5013
+				if iNdEx >= l {
5014
+					return io.ErrUnexpectedEOF
5015
+				}
5016
+				b := dAtA[iNdEx]
5017
+				iNdEx++
5018
+				stringLen |= uint64(b&0x7F) << shift
5019
+				if b < 0x80 {
5020
+					break
5021
+				}
5022
+			}
5023
+			intStringLen := int(stringLen)
5024
+			if intStringLen < 0 {
5025
+				return ErrInvalidLengthShim
5026
+			}
5027
+			postIndex := iNdEx + intStringLen
5028
+			if postIndex < 0 {
5029
+				return ErrInvalidLengthShim
5030
+			}
5031
+			if postIndex > l {
5032
+				return io.ErrUnexpectedEOF
5033
+			}
5034
+			m.ID = string(dAtA[iNdEx:postIndex])
5035
+			iNdEx = postIndex
5036
+		case 2:
5037
+			if wireType != 2 {
5038
+				return fmt.Errorf("proto: wrong wireType = %d for field Bundle", wireType)
5039
+			}
5040
+			var stringLen uint64
5041
+			for shift := uint(0); ; shift += 7 {
5042
+				if shift >= 64 {
5043
+					return ErrIntOverflowShim
5044
+				}
5045
+				if iNdEx >= l {
5046
+					return io.ErrUnexpectedEOF
5047
+				}
5048
+				b := dAtA[iNdEx]
5049
+				iNdEx++
5050
+				stringLen |= uint64(b&0x7F) << shift
5051
+				if b < 0x80 {
5052
+					break
5053
+				}
5054
+			}
5055
+			intStringLen := int(stringLen)
5056
+			if intStringLen < 0 {
5057
+				return ErrInvalidLengthShim
5058
+			}
5059
+			postIndex := iNdEx + intStringLen
5060
+			if postIndex < 0 {
5061
+				return ErrInvalidLengthShim
5062
+			}
5063
+			if postIndex > l {
5064
+				return io.ErrUnexpectedEOF
5065
+			}
5066
+			m.Bundle = string(dAtA[iNdEx:postIndex])
5067
+			iNdEx = postIndex
5068
+		case 3:
5069
+			if wireType != 0 {
5070
+				return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType)
5071
+			}
5072
+			m.Pid = 0
5073
+			for shift := uint(0); ; shift += 7 {
5074
+				if shift >= 64 {
5075
+					return ErrIntOverflowShim
5076
+				}
5077
+				if iNdEx >= l {
5078
+					return io.ErrUnexpectedEOF
5079
+				}
5080
+				b := dAtA[iNdEx]
5081
+				iNdEx++
5082
+				m.Pid |= uint32(b&0x7F) << shift
5083
+				if b < 0x80 {
5084
+					break
5085
+				}
5086
+			}
5087
+		case 4:
5088
+			if wireType != 0 {
5089
+				return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
5090
+			}
5091
+			m.Status = 0
5092
+			for shift := uint(0); ; shift += 7 {
5093
+				if shift >= 64 {
5094
+					return ErrIntOverflowShim
5095
+				}
5096
+				if iNdEx >= l {
5097
+					return io.ErrUnexpectedEOF
5098
+				}
5099
+				b := dAtA[iNdEx]
5100
+				iNdEx++
5101
+				m.Status |= task.Status(b&0x7F) << shift
5102
+				if b < 0x80 {
5103
+					break
5104
+				}
5105
+			}
5106
+		case 5:
5107
+			if wireType != 2 {
5108
+				return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType)
5109
+			}
5110
+			var stringLen uint64
5111
+			for shift := uint(0); ; shift += 7 {
5112
+				if shift >= 64 {
5113
+					return ErrIntOverflowShim
5114
+				}
5115
+				if iNdEx >= l {
5116
+					return io.ErrUnexpectedEOF
5117
+				}
5118
+				b := dAtA[iNdEx]
5119
+				iNdEx++
5120
+				stringLen |= uint64(b&0x7F) << shift
5121
+				if b < 0x80 {
5122
+					break
5123
+				}
5124
+			}
5125
+			intStringLen := int(stringLen)
5126
+			if intStringLen < 0 {
5127
+				return ErrInvalidLengthShim
5128
+			}
5129
+			postIndex := iNdEx + intStringLen
5130
+			if postIndex < 0 {
5131
+				return ErrInvalidLengthShim
5132
+			}
5133
+			if postIndex > l {
5134
+				return io.ErrUnexpectedEOF
5135
+			}
5136
+			m.Stdin = string(dAtA[iNdEx:postIndex])
5137
+			iNdEx = postIndex
5138
+		case 6:
5139
+			if wireType != 2 {
5140
+				return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType)
5141
+			}
5142
+			var stringLen uint64
5143
+			for shift := uint(0); ; shift += 7 {
5144
+				if shift >= 64 {
5145
+					return ErrIntOverflowShim
5146
+				}
5147
+				if iNdEx >= l {
5148
+					return io.ErrUnexpectedEOF
5149
+				}
5150
+				b := dAtA[iNdEx]
5151
+				iNdEx++
5152
+				stringLen |= uint64(b&0x7F) << shift
5153
+				if b < 0x80 {
5154
+					break
5155
+				}
5156
+			}
5157
+			intStringLen := int(stringLen)
5158
+			if intStringLen < 0 {
5159
+				return ErrInvalidLengthShim
5160
+			}
5161
+			postIndex := iNdEx + intStringLen
5162
+			if postIndex < 0 {
5163
+				return ErrInvalidLengthShim
5164
+			}
5165
+			if postIndex > l {
5166
+				return io.ErrUnexpectedEOF
5167
+			}
5168
+			m.Stdout = string(dAtA[iNdEx:postIndex])
5169
+			iNdEx = postIndex
5170
+		case 7:
5171
+			if wireType != 2 {
5172
+				return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType)
5173
+			}
5174
+			var stringLen uint64
5175
+			for shift := uint(0); ; shift += 7 {
5176
+				if shift >= 64 {
5177
+					return ErrIntOverflowShim
5178
+				}
5179
+				if iNdEx >= l {
5180
+					return io.ErrUnexpectedEOF
5181
+				}
5182
+				b := dAtA[iNdEx]
5183
+				iNdEx++
5184
+				stringLen |= uint64(b&0x7F) << shift
5185
+				if b < 0x80 {
5186
+					break
5187
+				}
5188
+			}
5189
+			intStringLen := int(stringLen)
5190
+			if intStringLen < 0 {
5191
+				return ErrInvalidLengthShim
5192
+			}
5193
+			postIndex := iNdEx + intStringLen
5194
+			if postIndex < 0 {
5195
+				return ErrInvalidLengthShim
5196
+			}
5197
+			if postIndex > l {
5198
+				return io.ErrUnexpectedEOF
5199
+			}
5200
+			m.Stderr = string(dAtA[iNdEx:postIndex])
5201
+			iNdEx = postIndex
5202
+		case 8:
5203
+			if wireType != 0 {
5204
+				return fmt.Errorf("proto: wrong wireType = %d for field Terminal", wireType)
5205
+			}
5206
+			var v int
5207
+			for shift := uint(0); ; shift += 7 {
5208
+				if shift >= 64 {
5209
+					return ErrIntOverflowShim
5210
+				}
5211
+				if iNdEx >= l {
5212
+					return io.ErrUnexpectedEOF
5213
+				}
5214
+				b := dAtA[iNdEx]
5215
+				iNdEx++
5216
+				v |= int(b&0x7F) << shift
5217
+				if b < 0x80 {
5218
+					break
5219
+				}
5220
+			}
5221
+			m.Terminal = bool(v != 0)
5222
+		case 9:
5223
+			if wireType != 0 {
5224
+				return fmt.Errorf("proto: wrong wireType = %d for field ExitStatus", wireType)
5225
+			}
5226
+			m.ExitStatus = 0
5227
+			for shift := uint(0); ; shift += 7 {
5228
+				if shift >= 64 {
5229
+					return ErrIntOverflowShim
5230
+				}
5231
+				if iNdEx >= l {
5232
+					return io.ErrUnexpectedEOF
5233
+				}
5234
+				b := dAtA[iNdEx]
5235
+				iNdEx++
5236
+				m.ExitStatus |= uint32(b&0x7F) << shift
5237
+				if b < 0x80 {
5238
+					break
5239
+				}
5240
+			}
5241
+		case 10:
5242
+			if wireType != 2 {
5243
+				return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", wireType)
5244
+			}
5245
+			var msglen int
5246
+			for shift := uint(0); ; shift += 7 {
5247
+				if shift >= 64 {
5248
+					return ErrIntOverflowShim
5249
+				}
5250
+				if iNdEx >= l {
5251
+					return io.ErrUnexpectedEOF
5252
+				}
5253
+				b := dAtA[iNdEx]
5254
+				iNdEx++
5255
+				msglen |= int(b&0x7F) << shift
5256
+				if b < 0x80 {
5257
+					break
5258
+				}
5259
+			}
5260
+			if msglen < 0 {
5261
+				return ErrInvalidLengthShim
5262
+			}
5263
+			postIndex := iNdEx + msglen
5264
+			if postIndex < 0 {
5265
+				return ErrInvalidLengthShim
5266
+			}
5267
+			if postIndex > l {
5268
+				return io.ErrUnexpectedEOF
5269
+			}
5270
+			if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
5271
+				return err
5272
+			}
5273
+			iNdEx = postIndex
5274
+		case 11:
5275
+			if wireType != 2 {
5276
+				return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
5277
+			}
5278
+			var stringLen uint64
5279
+			for shift := uint(0); ; shift += 7 {
5280
+				if shift >= 64 {
5281
+					return ErrIntOverflowShim
5282
+				}
5283
+				if iNdEx >= l {
5284
+					return io.ErrUnexpectedEOF
5285
+				}
5286
+				b := dAtA[iNdEx]
5287
+				iNdEx++
5288
+				stringLen |= uint64(b&0x7F) << shift
5289
+				if b < 0x80 {
5290
+					break
5291
+				}
5292
+			}
5293
+			intStringLen := int(stringLen)
5294
+			if intStringLen < 0 {
5295
+				return ErrInvalidLengthShim
5296
+			}
5297
+			postIndex := iNdEx + intStringLen
5298
+			if postIndex < 0 {
5299
+				return ErrInvalidLengthShim
5300
+			}
5301
+			if postIndex > l {
5302
+				return io.ErrUnexpectedEOF
5303
+			}
5304
+			m.ExecID = string(dAtA[iNdEx:postIndex])
5305
+			iNdEx = postIndex
5306
+		default:
5307
+			iNdEx = preIndex
5308
+			skippy, err := skipShim(dAtA[iNdEx:])
5309
+			if err != nil {
5310
+				return err
5311
+			}
5312
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
5313
+				return ErrInvalidLengthShim
5314
+			}
5315
+			if (iNdEx + skippy) > l {
5316
+				return io.ErrUnexpectedEOF
5317
+			}
5318
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
5319
+			iNdEx += skippy
5320
+		}
5321
+	}
5322
+
5323
+	if iNdEx > l {
5324
+		return io.ErrUnexpectedEOF
5325
+	}
5326
+	return nil
5327
+}
5328
+func (m *KillRequest) Unmarshal(dAtA []byte) error {
5329
+	l := len(dAtA)
5330
+	iNdEx := 0
5331
+	for iNdEx < l {
5332
+		preIndex := iNdEx
5333
+		var wire uint64
5334
+		for shift := uint(0); ; shift += 7 {
5335
+			if shift >= 64 {
5336
+				return ErrIntOverflowShim
5337
+			}
5338
+			if iNdEx >= l {
5339
+				return io.ErrUnexpectedEOF
5340
+			}
5341
+			b := dAtA[iNdEx]
5342
+			iNdEx++
5343
+			wire |= uint64(b&0x7F) << shift
5344
+			if b < 0x80 {
5345
+				break
5346
+			}
5347
+		}
5348
+		fieldNum := int32(wire >> 3)
5349
+		wireType := int(wire & 0x7)
5350
+		if wireType == 4 {
5351
+			return fmt.Errorf("proto: KillRequest: wiretype end group for non-group")
5352
+		}
5353
+		if fieldNum <= 0 {
5354
+			return fmt.Errorf("proto: KillRequest: illegal tag %d (wire type %d)", fieldNum, wire)
5355
+		}
5356
+		switch fieldNum {
5357
+		case 1:
5358
+			if wireType != 2 {
5359
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
5360
+			}
5361
+			var stringLen uint64
5362
+			for shift := uint(0); ; shift += 7 {
5363
+				if shift >= 64 {
5364
+					return ErrIntOverflowShim
5365
+				}
5366
+				if iNdEx >= l {
5367
+					return io.ErrUnexpectedEOF
5368
+				}
5369
+				b := dAtA[iNdEx]
5370
+				iNdEx++
5371
+				stringLen |= uint64(b&0x7F) << shift
5372
+				if b < 0x80 {
5373
+					break
5374
+				}
5375
+			}
5376
+			intStringLen := int(stringLen)
5377
+			if intStringLen < 0 {
5378
+				return ErrInvalidLengthShim
5379
+			}
5380
+			postIndex := iNdEx + intStringLen
5381
+			if postIndex < 0 {
5382
+				return ErrInvalidLengthShim
5383
+			}
5384
+			if postIndex > l {
5385
+				return io.ErrUnexpectedEOF
5386
+			}
5387
+			m.ID = string(dAtA[iNdEx:postIndex])
5388
+			iNdEx = postIndex
5389
+		case 2:
5390
+			if wireType != 2 {
5391
+				return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
5392
+			}
5393
+			var stringLen uint64
5394
+			for shift := uint(0); ; shift += 7 {
5395
+				if shift >= 64 {
5396
+					return ErrIntOverflowShim
5397
+				}
5398
+				if iNdEx >= l {
5399
+					return io.ErrUnexpectedEOF
5400
+				}
5401
+				b := dAtA[iNdEx]
5402
+				iNdEx++
5403
+				stringLen |= uint64(b&0x7F) << shift
5404
+				if b < 0x80 {
5405
+					break
5406
+				}
5407
+			}
5408
+			intStringLen := int(stringLen)
5409
+			if intStringLen < 0 {
5410
+				return ErrInvalidLengthShim
5411
+			}
5412
+			postIndex := iNdEx + intStringLen
5413
+			if postIndex < 0 {
5414
+				return ErrInvalidLengthShim
5415
+			}
5416
+			if postIndex > l {
5417
+				return io.ErrUnexpectedEOF
5418
+			}
5419
+			m.ExecID = string(dAtA[iNdEx:postIndex])
5420
+			iNdEx = postIndex
5421
+		case 3:
5422
+			if wireType != 0 {
5423
+				return fmt.Errorf("proto: wrong wireType = %d for field Signal", wireType)
5424
+			}
5425
+			m.Signal = 0
5426
+			for shift := uint(0); ; shift += 7 {
5427
+				if shift >= 64 {
5428
+					return ErrIntOverflowShim
5429
+				}
5430
+				if iNdEx >= l {
5431
+					return io.ErrUnexpectedEOF
5432
+				}
5433
+				b := dAtA[iNdEx]
5434
+				iNdEx++
5435
+				m.Signal |= uint32(b&0x7F) << shift
5436
+				if b < 0x80 {
5437
+					break
5438
+				}
5439
+			}
5440
+		case 4:
5441
+			if wireType != 0 {
5442
+				return fmt.Errorf("proto: wrong wireType = %d for field All", wireType)
5443
+			}
5444
+			var v int
5445
+			for shift := uint(0); ; shift += 7 {
5446
+				if shift >= 64 {
5447
+					return ErrIntOverflowShim
5448
+				}
5449
+				if iNdEx >= l {
5450
+					return io.ErrUnexpectedEOF
5451
+				}
5452
+				b := dAtA[iNdEx]
5453
+				iNdEx++
5454
+				v |= int(b&0x7F) << shift
5455
+				if b < 0x80 {
5456
+					break
5457
+				}
5458
+			}
5459
+			m.All = bool(v != 0)
5460
+		default:
5461
+			iNdEx = preIndex
5462
+			skippy, err := skipShim(dAtA[iNdEx:])
5463
+			if err != nil {
5464
+				return err
5465
+			}
5466
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
5467
+				return ErrInvalidLengthShim
5468
+			}
5469
+			if (iNdEx + skippy) > l {
5470
+				return io.ErrUnexpectedEOF
5471
+			}
5472
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
5473
+			iNdEx += skippy
5474
+		}
5475
+	}
5476
+
5477
+	if iNdEx > l {
5478
+		return io.ErrUnexpectedEOF
5479
+	}
5480
+	return nil
5481
+}
5482
+func (m *CloseIORequest) Unmarshal(dAtA []byte) error {
5483
+	l := len(dAtA)
5484
+	iNdEx := 0
5485
+	for iNdEx < l {
5486
+		preIndex := iNdEx
5487
+		var wire uint64
5488
+		for shift := uint(0); ; shift += 7 {
5489
+			if shift >= 64 {
5490
+				return ErrIntOverflowShim
5491
+			}
5492
+			if iNdEx >= l {
5493
+				return io.ErrUnexpectedEOF
5494
+			}
5495
+			b := dAtA[iNdEx]
5496
+			iNdEx++
5497
+			wire |= uint64(b&0x7F) << shift
5498
+			if b < 0x80 {
5499
+				break
5500
+			}
5501
+		}
5502
+		fieldNum := int32(wire >> 3)
5503
+		wireType := int(wire & 0x7)
5504
+		if wireType == 4 {
5505
+			return fmt.Errorf("proto: CloseIORequest: wiretype end group for non-group")
5506
+		}
5507
+		if fieldNum <= 0 {
5508
+			return fmt.Errorf("proto: CloseIORequest: illegal tag %d (wire type %d)", fieldNum, wire)
5509
+		}
5510
+		switch fieldNum {
5511
+		case 1:
5512
+			if wireType != 2 {
5513
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
5514
+			}
5515
+			var stringLen uint64
5516
+			for shift := uint(0); ; shift += 7 {
5517
+				if shift >= 64 {
5518
+					return ErrIntOverflowShim
5519
+				}
5520
+				if iNdEx >= l {
5521
+					return io.ErrUnexpectedEOF
5522
+				}
5523
+				b := dAtA[iNdEx]
5524
+				iNdEx++
5525
+				stringLen |= uint64(b&0x7F) << shift
5526
+				if b < 0x80 {
5527
+					break
5528
+				}
5529
+			}
5530
+			intStringLen := int(stringLen)
5531
+			if intStringLen < 0 {
5532
+				return ErrInvalidLengthShim
5533
+			}
5534
+			postIndex := iNdEx + intStringLen
5535
+			if postIndex < 0 {
5536
+				return ErrInvalidLengthShim
5537
+			}
5538
+			if postIndex > l {
5539
+				return io.ErrUnexpectedEOF
5540
+			}
5541
+			m.ID = string(dAtA[iNdEx:postIndex])
5542
+			iNdEx = postIndex
5543
+		case 2:
5544
+			if wireType != 2 {
5545
+				return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
5546
+			}
5547
+			var stringLen uint64
5548
+			for shift := uint(0); ; shift += 7 {
5549
+				if shift >= 64 {
5550
+					return ErrIntOverflowShim
5551
+				}
5552
+				if iNdEx >= l {
5553
+					return io.ErrUnexpectedEOF
5554
+				}
5555
+				b := dAtA[iNdEx]
5556
+				iNdEx++
5557
+				stringLen |= uint64(b&0x7F) << shift
5558
+				if b < 0x80 {
5559
+					break
5560
+				}
5561
+			}
5562
+			intStringLen := int(stringLen)
5563
+			if intStringLen < 0 {
5564
+				return ErrInvalidLengthShim
5565
+			}
5566
+			postIndex := iNdEx + intStringLen
5567
+			if postIndex < 0 {
5568
+				return ErrInvalidLengthShim
5569
+			}
5570
+			if postIndex > l {
5571
+				return io.ErrUnexpectedEOF
5572
+			}
5573
+			m.ExecID = string(dAtA[iNdEx:postIndex])
5574
+			iNdEx = postIndex
5575
+		case 3:
5576
+			if wireType != 0 {
5577
+				return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType)
5578
+			}
5579
+			var v int
5580
+			for shift := uint(0); ; shift += 7 {
5581
+				if shift >= 64 {
5582
+					return ErrIntOverflowShim
5583
+				}
5584
+				if iNdEx >= l {
5585
+					return io.ErrUnexpectedEOF
5586
+				}
5587
+				b := dAtA[iNdEx]
5588
+				iNdEx++
5589
+				v |= int(b&0x7F) << shift
5590
+				if b < 0x80 {
5591
+					break
5592
+				}
5593
+			}
5594
+			m.Stdin = bool(v != 0)
5595
+		default:
5596
+			iNdEx = preIndex
5597
+			skippy, err := skipShim(dAtA[iNdEx:])
5598
+			if err != nil {
5599
+				return err
5600
+			}
5601
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
5602
+				return ErrInvalidLengthShim
5603
+			}
5604
+			if (iNdEx + skippy) > l {
5605
+				return io.ErrUnexpectedEOF
5606
+			}
5607
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
5608
+			iNdEx += skippy
5609
+		}
5610
+	}
5611
+
5612
+	if iNdEx > l {
5613
+		return io.ErrUnexpectedEOF
5614
+	}
5615
+	return nil
5616
+}
5617
+func (m *PidsRequest) Unmarshal(dAtA []byte) error {
5618
+	l := len(dAtA)
5619
+	iNdEx := 0
5620
+	for iNdEx < l {
5621
+		preIndex := iNdEx
5622
+		var wire uint64
5623
+		for shift := uint(0); ; shift += 7 {
5624
+			if shift >= 64 {
5625
+				return ErrIntOverflowShim
5626
+			}
5627
+			if iNdEx >= l {
5628
+				return io.ErrUnexpectedEOF
5629
+			}
5630
+			b := dAtA[iNdEx]
5631
+			iNdEx++
5632
+			wire |= uint64(b&0x7F) << shift
5633
+			if b < 0x80 {
5634
+				break
5635
+			}
5636
+		}
5637
+		fieldNum := int32(wire >> 3)
5638
+		wireType := int(wire & 0x7)
5639
+		if wireType == 4 {
5640
+			return fmt.Errorf("proto: PidsRequest: wiretype end group for non-group")
5641
+		}
5642
+		if fieldNum <= 0 {
5643
+			return fmt.Errorf("proto: PidsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
5644
+		}
5645
+		switch fieldNum {
5646
+		case 1:
5647
+			if wireType != 2 {
5648
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
5649
+			}
5650
+			var stringLen uint64
5651
+			for shift := uint(0); ; shift += 7 {
5652
+				if shift >= 64 {
5653
+					return ErrIntOverflowShim
5654
+				}
5655
+				if iNdEx >= l {
5656
+					return io.ErrUnexpectedEOF
5657
+				}
5658
+				b := dAtA[iNdEx]
5659
+				iNdEx++
5660
+				stringLen |= uint64(b&0x7F) << shift
5661
+				if b < 0x80 {
5662
+					break
5663
+				}
5664
+			}
5665
+			intStringLen := int(stringLen)
5666
+			if intStringLen < 0 {
5667
+				return ErrInvalidLengthShim
5668
+			}
5669
+			postIndex := iNdEx + intStringLen
5670
+			if postIndex < 0 {
5671
+				return ErrInvalidLengthShim
5672
+			}
5673
+			if postIndex > l {
5674
+				return io.ErrUnexpectedEOF
5675
+			}
5676
+			m.ID = string(dAtA[iNdEx:postIndex])
5677
+			iNdEx = postIndex
5678
+		default:
5679
+			iNdEx = preIndex
5680
+			skippy, err := skipShim(dAtA[iNdEx:])
5681
+			if err != nil {
5682
+				return err
5683
+			}
5684
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
5685
+				return ErrInvalidLengthShim
5686
+			}
5687
+			if (iNdEx + skippy) > l {
5688
+				return io.ErrUnexpectedEOF
5689
+			}
5690
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
5691
+			iNdEx += skippy
5692
+		}
5693
+	}
5694
+
5695
+	if iNdEx > l {
5696
+		return io.ErrUnexpectedEOF
5697
+	}
5698
+	return nil
5699
+}
5700
+func (m *PidsResponse) Unmarshal(dAtA []byte) error {
5701
+	l := len(dAtA)
5702
+	iNdEx := 0
5703
+	for iNdEx < l {
5704
+		preIndex := iNdEx
5705
+		var wire uint64
5706
+		for shift := uint(0); ; shift += 7 {
5707
+			if shift >= 64 {
5708
+				return ErrIntOverflowShim
5709
+			}
5710
+			if iNdEx >= l {
5711
+				return io.ErrUnexpectedEOF
5712
+			}
5713
+			b := dAtA[iNdEx]
5714
+			iNdEx++
5715
+			wire |= uint64(b&0x7F) << shift
5716
+			if b < 0x80 {
5717
+				break
5718
+			}
5719
+		}
5720
+		fieldNum := int32(wire >> 3)
5721
+		wireType := int(wire & 0x7)
5722
+		if wireType == 4 {
5723
+			return fmt.Errorf("proto: PidsResponse: wiretype end group for non-group")
5724
+		}
5725
+		if fieldNum <= 0 {
5726
+			return fmt.Errorf("proto: PidsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
5727
+		}
5728
+		switch fieldNum {
5729
+		case 1:
5730
+			if wireType != 2 {
5731
+				return fmt.Errorf("proto: wrong wireType = %d for field Processes", wireType)
5732
+			}
5733
+			var msglen int
5734
+			for shift := uint(0); ; shift += 7 {
5735
+				if shift >= 64 {
5736
+					return ErrIntOverflowShim
5737
+				}
5738
+				if iNdEx >= l {
5739
+					return io.ErrUnexpectedEOF
5740
+				}
5741
+				b := dAtA[iNdEx]
5742
+				iNdEx++
5743
+				msglen |= int(b&0x7F) << shift
5744
+				if b < 0x80 {
5745
+					break
5746
+				}
5747
+			}
5748
+			if msglen < 0 {
5749
+				return ErrInvalidLengthShim
5750
+			}
5751
+			postIndex := iNdEx + msglen
5752
+			if postIndex < 0 {
5753
+				return ErrInvalidLengthShim
5754
+			}
5755
+			if postIndex > l {
5756
+				return io.ErrUnexpectedEOF
5757
+			}
5758
+			m.Processes = append(m.Processes, &task.ProcessInfo{})
5759
+			if err := m.Processes[len(m.Processes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
5760
+				return err
5761
+			}
5762
+			iNdEx = postIndex
5763
+		default:
5764
+			iNdEx = preIndex
5765
+			skippy, err := skipShim(dAtA[iNdEx:])
5766
+			if err != nil {
5767
+				return err
5768
+			}
5769
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
5770
+				return ErrInvalidLengthShim
5771
+			}
5772
+			if (iNdEx + skippy) > l {
5773
+				return io.ErrUnexpectedEOF
5774
+			}
5775
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
5776
+			iNdEx += skippy
5777
+		}
5778
+	}
5779
+
5780
+	if iNdEx > l {
5781
+		return io.ErrUnexpectedEOF
5782
+	}
5783
+	return nil
5784
+}
5785
+func (m *CheckpointTaskRequest) Unmarshal(dAtA []byte) error {
5786
+	l := len(dAtA)
5787
+	iNdEx := 0
5788
+	for iNdEx < l {
5789
+		preIndex := iNdEx
5790
+		var wire uint64
5791
+		for shift := uint(0); ; shift += 7 {
5792
+			if shift >= 64 {
5793
+				return ErrIntOverflowShim
5794
+			}
5795
+			if iNdEx >= l {
5796
+				return io.ErrUnexpectedEOF
5797
+			}
5798
+			b := dAtA[iNdEx]
5799
+			iNdEx++
5800
+			wire |= uint64(b&0x7F) << shift
5801
+			if b < 0x80 {
5802
+				break
5803
+			}
5804
+		}
5805
+		fieldNum := int32(wire >> 3)
5806
+		wireType := int(wire & 0x7)
5807
+		if wireType == 4 {
5808
+			return fmt.Errorf("proto: CheckpointTaskRequest: wiretype end group for non-group")
5809
+		}
5810
+		if fieldNum <= 0 {
5811
+			return fmt.Errorf("proto: CheckpointTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire)
5812
+		}
5813
+		switch fieldNum {
5814
+		case 1:
5815
+			if wireType != 2 {
5816
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
5817
+			}
5818
+			var stringLen uint64
5819
+			for shift := uint(0); ; shift += 7 {
5820
+				if shift >= 64 {
5821
+					return ErrIntOverflowShim
5822
+				}
5823
+				if iNdEx >= l {
5824
+					return io.ErrUnexpectedEOF
5825
+				}
5826
+				b := dAtA[iNdEx]
5827
+				iNdEx++
5828
+				stringLen |= uint64(b&0x7F) << shift
5829
+				if b < 0x80 {
5830
+					break
5831
+				}
5832
+			}
5833
+			intStringLen := int(stringLen)
5834
+			if intStringLen < 0 {
5835
+				return ErrInvalidLengthShim
5836
+			}
5837
+			postIndex := iNdEx + intStringLen
5838
+			if postIndex < 0 {
5839
+				return ErrInvalidLengthShim
5840
+			}
5841
+			if postIndex > l {
5842
+				return io.ErrUnexpectedEOF
5843
+			}
5844
+			m.ID = string(dAtA[iNdEx:postIndex])
5845
+			iNdEx = postIndex
5846
+		case 2:
5847
+			if wireType != 2 {
5848
+				return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType)
5849
+			}
5850
+			var stringLen uint64
5851
+			for shift := uint(0); ; shift += 7 {
5852
+				if shift >= 64 {
5853
+					return ErrIntOverflowShim
5854
+				}
5855
+				if iNdEx >= l {
5856
+					return io.ErrUnexpectedEOF
5857
+				}
5858
+				b := dAtA[iNdEx]
5859
+				iNdEx++
5860
+				stringLen |= uint64(b&0x7F) << shift
5861
+				if b < 0x80 {
5862
+					break
5863
+				}
5864
+			}
5865
+			intStringLen := int(stringLen)
5866
+			if intStringLen < 0 {
5867
+				return ErrInvalidLengthShim
5868
+			}
5869
+			postIndex := iNdEx + intStringLen
5870
+			if postIndex < 0 {
5871
+				return ErrInvalidLengthShim
5872
+			}
5873
+			if postIndex > l {
5874
+				return io.ErrUnexpectedEOF
5875
+			}
5876
+			m.Path = string(dAtA[iNdEx:postIndex])
5877
+			iNdEx = postIndex
5878
+		case 3:
5879
+			if wireType != 2 {
5880
+				return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
5881
+			}
5882
+			var msglen int
5883
+			for shift := uint(0); ; shift += 7 {
5884
+				if shift >= 64 {
5885
+					return ErrIntOverflowShim
5886
+				}
5887
+				if iNdEx >= l {
5888
+					return io.ErrUnexpectedEOF
5889
+				}
5890
+				b := dAtA[iNdEx]
5891
+				iNdEx++
5892
+				msglen |= int(b&0x7F) << shift
5893
+				if b < 0x80 {
5894
+					break
5895
+				}
5896
+			}
5897
+			if msglen < 0 {
5898
+				return ErrInvalidLengthShim
5899
+			}
5900
+			postIndex := iNdEx + msglen
5901
+			if postIndex < 0 {
5902
+				return ErrInvalidLengthShim
5903
+			}
5904
+			if postIndex > l {
5905
+				return io.ErrUnexpectedEOF
5906
+			}
5907
+			if m.Options == nil {
5908
+				m.Options = &types1.Any{}
5909
+			}
5910
+			if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
5911
+				return err
5912
+			}
5913
+			iNdEx = postIndex
5914
+		default:
5915
+			iNdEx = preIndex
5916
+			skippy, err := skipShim(dAtA[iNdEx:])
5917
+			if err != nil {
5918
+				return err
5919
+			}
5920
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
5921
+				return ErrInvalidLengthShim
5922
+			}
5923
+			if (iNdEx + skippy) > l {
5924
+				return io.ErrUnexpectedEOF
5925
+			}
5926
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
5927
+			iNdEx += skippy
5928
+		}
5929
+	}
5930
+
5931
+	if iNdEx > l {
5932
+		return io.ErrUnexpectedEOF
5933
+	}
5934
+	return nil
5935
+}
5936
+func (m *UpdateTaskRequest) Unmarshal(dAtA []byte) error {
5937
+	l := len(dAtA)
5938
+	iNdEx := 0
5939
+	for iNdEx < l {
5940
+		preIndex := iNdEx
5941
+		var wire uint64
5942
+		for shift := uint(0); ; shift += 7 {
5943
+			if shift >= 64 {
5944
+				return ErrIntOverflowShim
5945
+			}
5946
+			if iNdEx >= l {
5947
+				return io.ErrUnexpectedEOF
5948
+			}
5949
+			b := dAtA[iNdEx]
5950
+			iNdEx++
5951
+			wire |= uint64(b&0x7F) << shift
5952
+			if b < 0x80 {
5953
+				break
5954
+			}
5955
+		}
5956
+		fieldNum := int32(wire >> 3)
5957
+		wireType := int(wire & 0x7)
5958
+		if wireType == 4 {
5959
+			return fmt.Errorf("proto: UpdateTaskRequest: wiretype end group for non-group")
5960
+		}
5961
+		if fieldNum <= 0 {
5962
+			return fmt.Errorf("proto: UpdateTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire)
5963
+		}
5964
+		switch fieldNum {
5965
+		case 1:
5966
+			if wireType != 2 {
5967
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
5968
+			}
5969
+			var stringLen uint64
5970
+			for shift := uint(0); ; shift += 7 {
5971
+				if shift >= 64 {
5972
+					return ErrIntOverflowShim
5973
+				}
5974
+				if iNdEx >= l {
5975
+					return io.ErrUnexpectedEOF
5976
+				}
5977
+				b := dAtA[iNdEx]
5978
+				iNdEx++
5979
+				stringLen |= uint64(b&0x7F) << shift
5980
+				if b < 0x80 {
5981
+					break
5982
+				}
5983
+			}
5984
+			intStringLen := int(stringLen)
5985
+			if intStringLen < 0 {
5986
+				return ErrInvalidLengthShim
5987
+			}
5988
+			postIndex := iNdEx + intStringLen
5989
+			if postIndex < 0 {
5990
+				return ErrInvalidLengthShim
5991
+			}
5992
+			if postIndex > l {
5993
+				return io.ErrUnexpectedEOF
5994
+			}
5995
+			m.ID = string(dAtA[iNdEx:postIndex])
5996
+			iNdEx = postIndex
5997
+		case 2:
5998
+			if wireType != 2 {
5999
+				return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType)
6000
+			}
6001
+			var msglen int
6002
+			for shift := uint(0); ; shift += 7 {
6003
+				if shift >= 64 {
6004
+					return ErrIntOverflowShim
6005
+				}
6006
+				if iNdEx >= l {
6007
+					return io.ErrUnexpectedEOF
6008
+				}
6009
+				b := dAtA[iNdEx]
6010
+				iNdEx++
6011
+				msglen |= int(b&0x7F) << shift
6012
+				if b < 0x80 {
6013
+					break
6014
+				}
6015
+			}
6016
+			if msglen < 0 {
6017
+				return ErrInvalidLengthShim
6018
+			}
6019
+			postIndex := iNdEx + msglen
6020
+			if postIndex < 0 {
6021
+				return ErrInvalidLengthShim
6022
+			}
6023
+			if postIndex > l {
6024
+				return io.ErrUnexpectedEOF
6025
+			}
6026
+			if m.Resources == nil {
6027
+				m.Resources = &types1.Any{}
6028
+			}
6029
+			if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
6030
+				return err
6031
+			}
6032
+			iNdEx = postIndex
6033
+		case 3:
6034
+			if wireType != 2 {
6035
+				return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType)
6036
+			}
6037
+			var msglen int
6038
+			for shift := uint(0); ; shift += 7 {
6039
+				if shift >= 64 {
6040
+					return ErrIntOverflowShim
6041
+				}
6042
+				if iNdEx >= l {
6043
+					return io.ErrUnexpectedEOF
6044
+				}
6045
+				b := dAtA[iNdEx]
6046
+				iNdEx++
6047
+				msglen |= int(b&0x7F) << shift
6048
+				if b < 0x80 {
6049
+					break
6050
+				}
6051
+			}
6052
+			if msglen < 0 {
6053
+				return ErrInvalidLengthShim
6054
+			}
6055
+			postIndex := iNdEx + msglen
6056
+			if postIndex < 0 {
6057
+				return ErrInvalidLengthShim
6058
+			}
6059
+			if postIndex > l {
6060
+				return io.ErrUnexpectedEOF
6061
+			}
6062
+			if m.Annotations == nil {
6063
+				m.Annotations = make(map[string]string)
6064
+			}
6065
+			var mapkey string
6066
+			var mapvalue string
6067
+			for iNdEx < postIndex {
6068
+				entryPreIndex := iNdEx
6069
+				var wire uint64
6070
+				for shift := uint(0); ; shift += 7 {
6071
+					if shift >= 64 {
6072
+						return ErrIntOverflowShim
6073
+					}
6074
+					if iNdEx >= l {
6075
+						return io.ErrUnexpectedEOF
6076
+					}
6077
+					b := dAtA[iNdEx]
6078
+					iNdEx++
6079
+					wire |= uint64(b&0x7F) << shift
6080
+					if b < 0x80 {
6081
+						break
6082
+					}
6083
+				}
6084
+				fieldNum := int32(wire >> 3)
6085
+				if fieldNum == 1 {
6086
+					var stringLenmapkey uint64
6087
+					for shift := uint(0); ; shift += 7 {
6088
+						if shift >= 64 {
6089
+							return ErrIntOverflowShim
6090
+						}
6091
+						if iNdEx >= l {
6092
+							return io.ErrUnexpectedEOF
6093
+						}
6094
+						b := dAtA[iNdEx]
6095
+						iNdEx++
6096
+						stringLenmapkey |= uint64(b&0x7F) << shift
6097
+						if b < 0x80 {
6098
+							break
6099
+						}
6100
+					}
6101
+					intStringLenmapkey := int(stringLenmapkey)
6102
+					if intStringLenmapkey < 0 {
6103
+						return ErrInvalidLengthShim
6104
+					}
6105
+					postStringIndexmapkey := iNdEx + intStringLenmapkey
6106
+					if postStringIndexmapkey < 0 {
6107
+						return ErrInvalidLengthShim
6108
+					}
6109
+					if postStringIndexmapkey > l {
6110
+						return io.ErrUnexpectedEOF
6111
+					}
6112
+					mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
6113
+					iNdEx = postStringIndexmapkey
6114
+				} else if fieldNum == 2 {
6115
+					var stringLenmapvalue uint64
6116
+					for shift := uint(0); ; shift += 7 {
6117
+						if shift >= 64 {
6118
+							return ErrIntOverflowShim
6119
+						}
6120
+						if iNdEx >= l {
6121
+							return io.ErrUnexpectedEOF
6122
+						}
6123
+						b := dAtA[iNdEx]
6124
+						iNdEx++
6125
+						stringLenmapvalue |= uint64(b&0x7F) << shift
6126
+						if b < 0x80 {
6127
+							break
6128
+						}
6129
+					}
6130
+					intStringLenmapvalue := int(stringLenmapvalue)
6131
+					if intStringLenmapvalue < 0 {
6132
+						return ErrInvalidLengthShim
6133
+					}
6134
+					postStringIndexmapvalue := iNdEx + intStringLenmapvalue
6135
+					if postStringIndexmapvalue < 0 {
6136
+						return ErrInvalidLengthShim
6137
+					}
6138
+					if postStringIndexmapvalue > l {
6139
+						return io.ErrUnexpectedEOF
6140
+					}
6141
+					mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
6142
+					iNdEx = postStringIndexmapvalue
6143
+				} else {
6144
+					iNdEx = entryPreIndex
6145
+					skippy, err := skipShim(dAtA[iNdEx:])
6146
+					if err != nil {
6147
+						return err
6148
+					}
6149
+					if (skippy < 0) || (iNdEx+skippy) < 0 {
6150
+						return ErrInvalidLengthShim
6151
+					}
6152
+					if (iNdEx + skippy) > postIndex {
6153
+						return io.ErrUnexpectedEOF
6154
+					}
6155
+					iNdEx += skippy
6156
+				}
6157
+			}
6158
+			m.Annotations[mapkey] = mapvalue
6159
+			iNdEx = postIndex
6160
+		default:
6161
+			iNdEx = preIndex
6162
+			skippy, err := skipShim(dAtA[iNdEx:])
6163
+			if err != nil {
6164
+				return err
6165
+			}
6166
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
6167
+				return ErrInvalidLengthShim
6168
+			}
6169
+			if (iNdEx + skippy) > l {
6170
+				return io.ErrUnexpectedEOF
6171
+			}
6172
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
6173
+			iNdEx += skippy
6174
+		}
6175
+	}
6176
+
6177
+	if iNdEx > l {
6178
+		return io.ErrUnexpectedEOF
6179
+	}
6180
+	return nil
6181
+}
6182
+func (m *StartRequest) Unmarshal(dAtA []byte) error {
6183
+	l := len(dAtA)
6184
+	iNdEx := 0
6185
+	for iNdEx < l {
6186
+		preIndex := iNdEx
6187
+		var wire uint64
6188
+		for shift := uint(0); ; shift += 7 {
6189
+			if shift >= 64 {
6190
+				return ErrIntOverflowShim
6191
+			}
6192
+			if iNdEx >= l {
6193
+				return io.ErrUnexpectedEOF
6194
+			}
6195
+			b := dAtA[iNdEx]
6196
+			iNdEx++
6197
+			wire |= uint64(b&0x7F) << shift
6198
+			if b < 0x80 {
6199
+				break
6200
+			}
6201
+		}
6202
+		fieldNum := int32(wire >> 3)
6203
+		wireType := int(wire & 0x7)
6204
+		if wireType == 4 {
6205
+			return fmt.Errorf("proto: StartRequest: wiretype end group for non-group")
6206
+		}
6207
+		if fieldNum <= 0 {
6208
+			return fmt.Errorf("proto: StartRequest: illegal tag %d (wire type %d)", fieldNum, wire)
6209
+		}
6210
+		switch fieldNum {
6211
+		case 1:
6212
+			if wireType != 2 {
6213
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
6214
+			}
6215
+			var stringLen uint64
6216
+			for shift := uint(0); ; shift += 7 {
6217
+				if shift >= 64 {
6218
+					return ErrIntOverflowShim
6219
+				}
6220
+				if iNdEx >= l {
6221
+					return io.ErrUnexpectedEOF
6222
+				}
6223
+				b := dAtA[iNdEx]
6224
+				iNdEx++
6225
+				stringLen |= uint64(b&0x7F) << shift
6226
+				if b < 0x80 {
6227
+					break
6228
+				}
6229
+			}
6230
+			intStringLen := int(stringLen)
6231
+			if intStringLen < 0 {
6232
+				return ErrInvalidLengthShim
6233
+			}
6234
+			postIndex := iNdEx + intStringLen
6235
+			if postIndex < 0 {
6236
+				return ErrInvalidLengthShim
6237
+			}
6238
+			if postIndex > l {
6239
+				return io.ErrUnexpectedEOF
6240
+			}
6241
+			m.ID = string(dAtA[iNdEx:postIndex])
6242
+			iNdEx = postIndex
6243
+		case 2:
6244
+			if wireType != 2 {
6245
+				return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
6246
+			}
6247
+			var stringLen uint64
6248
+			for shift := uint(0); ; shift += 7 {
6249
+				if shift >= 64 {
6250
+					return ErrIntOverflowShim
6251
+				}
6252
+				if iNdEx >= l {
6253
+					return io.ErrUnexpectedEOF
6254
+				}
6255
+				b := dAtA[iNdEx]
6256
+				iNdEx++
6257
+				stringLen |= uint64(b&0x7F) << shift
6258
+				if b < 0x80 {
6259
+					break
6260
+				}
6261
+			}
6262
+			intStringLen := int(stringLen)
6263
+			if intStringLen < 0 {
6264
+				return ErrInvalidLengthShim
6265
+			}
6266
+			postIndex := iNdEx + intStringLen
6267
+			if postIndex < 0 {
6268
+				return ErrInvalidLengthShim
6269
+			}
6270
+			if postIndex > l {
6271
+				return io.ErrUnexpectedEOF
6272
+			}
6273
+			m.ExecID = string(dAtA[iNdEx:postIndex])
6274
+			iNdEx = postIndex
6275
+		default:
6276
+			iNdEx = preIndex
6277
+			skippy, err := skipShim(dAtA[iNdEx:])
6278
+			if err != nil {
6279
+				return err
6280
+			}
6281
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
6282
+				return ErrInvalidLengthShim
6283
+			}
6284
+			if (iNdEx + skippy) > l {
6285
+				return io.ErrUnexpectedEOF
6286
+			}
6287
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
6288
+			iNdEx += skippy
6289
+		}
6290
+	}
6291
+
6292
+	if iNdEx > l {
6293
+		return io.ErrUnexpectedEOF
6294
+	}
6295
+	return nil
6296
+}
6297
+func (m *StartResponse) Unmarshal(dAtA []byte) error {
6298
+	l := len(dAtA)
6299
+	iNdEx := 0
6300
+	for iNdEx < l {
6301
+		preIndex := iNdEx
6302
+		var wire uint64
6303
+		for shift := uint(0); ; shift += 7 {
6304
+			if shift >= 64 {
6305
+				return ErrIntOverflowShim
6306
+			}
6307
+			if iNdEx >= l {
6308
+				return io.ErrUnexpectedEOF
6309
+			}
6310
+			b := dAtA[iNdEx]
6311
+			iNdEx++
6312
+			wire |= uint64(b&0x7F) << shift
6313
+			if b < 0x80 {
6314
+				break
6315
+			}
6316
+		}
6317
+		fieldNum := int32(wire >> 3)
6318
+		wireType := int(wire & 0x7)
6319
+		if wireType == 4 {
6320
+			return fmt.Errorf("proto: StartResponse: wiretype end group for non-group")
6321
+		}
6322
+		if fieldNum <= 0 {
6323
+			return fmt.Errorf("proto: StartResponse: illegal tag %d (wire type %d)", fieldNum, wire)
6324
+		}
6325
+		switch fieldNum {
6326
+		case 1:
6327
+			if wireType != 0 {
6328
+				return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType)
6329
+			}
6330
+			m.Pid = 0
6331
+			for shift := uint(0); ; shift += 7 {
6332
+				if shift >= 64 {
6333
+					return ErrIntOverflowShim
6334
+				}
6335
+				if iNdEx >= l {
6336
+					return io.ErrUnexpectedEOF
6337
+				}
6338
+				b := dAtA[iNdEx]
6339
+				iNdEx++
6340
+				m.Pid |= uint32(b&0x7F) << shift
6341
+				if b < 0x80 {
6342
+					break
6343
+				}
6344
+			}
6345
+		default:
6346
+			iNdEx = preIndex
6347
+			skippy, err := skipShim(dAtA[iNdEx:])
6348
+			if err != nil {
6349
+				return err
6350
+			}
6351
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
6352
+				return ErrInvalidLengthShim
6353
+			}
6354
+			if (iNdEx + skippy) > l {
6355
+				return io.ErrUnexpectedEOF
6356
+			}
6357
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
6358
+			iNdEx += skippy
6359
+		}
6360
+	}
6361
+
6362
+	if iNdEx > l {
6363
+		return io.ErrUnexpectedEOF
6364
+	}
6365
+	return nil
6366
+}
6367
+func (m *WaitRequest) Unmarshal(dAtA []byte) error {
6368
+	l := len(dAtA)
6369
+	iNdEx := 0
6370
+	for iNdEx < l {
6371
+		preIndex := iNdEx
6372
+		var wire uint64
6373
+		for shift := uint(0); ; shift += 7 {
6374
+			if shift >= 64 {
6375
+				return ErrIntOverflowShim
6376
+			}
6377
+			if iNdEx >= l {
6378
+				return io.ErrUnexpectedEOF
6379
+			}
6380
+			b := dAtA[iNdEx]
6381
+			iNdEx++
6382
+			wire |= uint64(b&0x7F) << shift
6383
+			if b < 0x80 {
6384
+				break
6385
+			}
6386
+		}
6387
+		fieldNum := int32(wire >> 3)
6388
+		wireType := int(wire & 0x7)
6389
+		if wireType == 4 {
6390
+			return fmt.Errorf("proto: WaitRequest: wiretype end group for non-group")
6391
+		}
6392
+		if fieldNum <= 0 {
6393
+			return fmt.Errorf("proto: WaitRequest: illegal tag %d (wire type %d)", fieldNum, wire)
6394
+		}
6395
+		switch fieldNum {
6396
+		case 1:
6397
+			if wireType != 2 {
6398
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
6399
+			}
6400
+			var stringLen uint64
6401
+			for shift := uint(0); ; shift += 7 {
6402
+				if shift >= 64 {
6403
+					return ErrIntOverflowShim
6404
+				}
6405
+				if iNdEx >= l {
6406
+					return io.ErrUnexpectedEOF
6407
+				}
6408
+				b := dAtA[iNdEx]
6409
+				iNdEx++
6410
+				stringLen |= uint64(b&0x7F) << shift
6411
+				if b < 0x80 {
6412
+					break
6413
+				}
6414
+			}
6415
+			intStringLen := int(stringLen)
6416
+			if intStringLen < 0 {
6417
+				return ErrInvalidLengthShim
6418
+			}
6419
+			postIndex := iNdEx + intStringLen
6420
+			if postIndex < 0 {
6421
+				return ErrInvalidLengthShim
6422
+			}
6423
+			if postIndex > l {
6424
+				return io.ErrUnexpectedEOF
6425
+			}
6426
+			m.ID = string(dAtA[iNdEx:postIndex])
6427
+			iNdEx = postIndex
6428
+		case 2:
6429
+			if wireType != 2 {
6430
+				return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
6431
+			}
6432
+			var stringLen uint64
6433
+			for shift := uint(0); ; shift += 7 {
6434
+				if shift >= 64 {
6435
+					return ErrIntOverflowShim
6436
+				}
6437
+				if iNdEx >= l {
6438
+					return io.ErrUnexpectedEOF
6439
+				}
6440
+				b := dAtA[iNdEx]
6441
+				iNdEx++
6442
+				stringLen |= uint64(b&0x7F) << shift
6443
+				if b < 0x80 {
6444
+					break
6445
+				}
6446
+			}
6447
+			intStringLen := int(stringLen)
6448
+			if intStringLen < 0 {
6449
+				return ErrInvalidLengthShim
6450
+			}
6451
+			postIndex := iNdEx + intStringLen
6452
+			if postIndex < 0 {
6453
+				return ErrInvalidLengthShim
6454
+			}
6455
+			if postIndex > l {
6456
+				return io.ErrUnexpectedEOF
6457
+			}
6458
+			m.ExecID = string(dAtA[iNdEx:postIndex])
6459
+			iNdEx = postIndex
6460
+		default:
6461
+			iNdEx = preIndex
6462
+			skippy, err := skipShim(dAtA[iNdEx:])
6463
+			if err != nil {
6464
+				return err
6465
+			}
6466
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
6467
+				return ErrInvalidLengthShim
6468
+			}
6469
+			if (iNdEx + skippy) > l {
6470
+				return io.ErrUnexpectedEOF
6471
+			}
6472
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
6473
+			iNdEx += skippy
6474
+		}
6475
+	}
6476
+
6477
+	if iNdEx > l {
6478
+		return io.ErrUnexpectedEOF
6479
+	}
6480
+	return nil
6481
+}
6482
+func (m *WaitResponse) Unmarshal(dAtA []byte) error {
6483
+	l := len(dAtA)
6484
+	iNdEx := 0
6485
+	for iNdEx < l {
6486
+		preIndex := iNdEx
6487
+		var wire uint64
6488
+		for shift := uint(0); ; shift += 7 {
6489
+			if shift >= 64 {
6490
+				return ErrIntOverflowShim
6491
+			}
6492
+			if iNdEx >= l {
6493
+				return io.ErrUnexpectedEOF
6494
+			}
6495
+			b := dAtA[iNdEx]
6496
+			iNdEx++
6497
+			wire |= uint64(b&0x7F) << shift
6498
+			if b < 0x80 {
6499
+				break
6500
+			}
6501
+		}
6502
+		fieldNum := int32(wire >> 3)
6503
+		wireType := int(wire & 0x7)
6504
+		if wireType == 4 {
6505
+			return fmt.Errorf("proto: WaitResponse: wiretype end group for non-group")
6506
+		}
6507
+		if fieldNum <= 0 {
6508
+			return fmt.Errorf("proto: WaitResponse: illegal tag %d (wire type %d)", fieldNum, wire)
6509
+		}
6510
+		switch fieldNum {
6511
+		case 1:
6512
+			if wireType != 0 {
6513
+				return fmt.Errorf("proto: wrong wireType = %d for field ExitStatus", wireType)
6514
+			}
6515
+			m.ExitStatus = 0
6516
+			for shift := uint(0); ; shift += 7 {
6517
+				if shift >= 64 {
6518
+					return ErrIntOverflowShim
6519
+				}
6520
+				if iNdEx >= l {
6521
+					return io.ErrUnexpectedEOF
6522
+				}
6523
+				b := dAtA[iNdEx]
6524
+				iNdEx++
6525
+				m.ExitStatus |= uint32(b&0x7F) << shift
6526
+				if b < 0x80 {
6527
+					break
6528
+				}
6529
+			}
6530
+		case 2:
6531
+			if wireType != 2 {
6532
+				return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", wireType)
6533
+			}
6534
+			var msglen int
6535
+			for shift := uint(0); ; shift += 7 {
6536
+				if shift >= 64 {
6537
+					return ErrIntOverflowShim
6538
+				}
6539
+				if iNdEx >= l {
6540
+					return io.ErrUnexpectedEOF
6541
+				}
6542
+				b := dAtA[iNdEx]
6543
+				iNdEx++
6544
+				msglen |= int(b&0x7F) << shift
6545
+				if b < 0x80 {
6546
+					break
6547
+				}
6548
+			}
6549
+			if msglen < 0 {
6550
+				return ErrInvalidLengthShim
6551
+			}
6552
+			postIndex := iNdEx + msglen
6553
+			if postIndex < 0 {
6554
+				return ErrInvalidLengthShim
6555
+			}
6556
+			if postIndex > l {
6557
+				return io.ErrUnexpectedEOF
6558
+			}
6559
+			if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
6560
+				return err
6561
+			}
6562
+			iNdEx = postIndex
6563
+		default:
6564
+			iNdEx = preIndex
6565
+			skippy, err := skipShim(dAtA[iNdEx:])
6566
+			if err != nil {
6567
+				return err
6568
+			}
6569
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
6570
+				return ErrInvalidLengthShim
6571
+			}
6572
+			if (iNdEx + skippy) > l {
6573
+				return io.ErrUnexpectedEOF
6574
+			}
6575
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
6576
+			iNdEx += skippy
6577
+		}
6578
+	}
6579
+
6580
+	if iNdEx > l {
6581
+		return io.ErrUnexpectedEOF
6582
+	}
6583
+	return nil
6584
+}
6585
+func (m *StatsRequest) Unmarshal(dAtA []byte) error {
6586
+	l := len(dAtA)
6587
+	iNdEx := 0
6588
+	for iNdEx < l {
6589
+		preIndex := iNdEx
6590
+		var wire uint64
6591
+		for shift := uint(0); ; shift += 7 {
6592
+			if shift >= 64 {
6593
+				return ErrIntOverflowShim
6594
+			}
6595
+			if iNdEx >= l {
6596
+				return io.ErrUnexpectedEOF
6597
+			}
6598
+			b := dAtA[iNdEx]
6599
+			iNdEx++
6600
+			wire |= uint64(b&0x7F) << shift
6601
+			if b < 0x80 {
6602
+				break
6603
+			}
6604
+		}
6605
+		fieldNum := int32(wire >> 3)
6606
+		wireType := int(wire & 0x7)
6607
+		if wireType == 4 {
6608
+			return fmt.Errorf("proto: StatsRequest: wiretype end group for non-group")
6609
+		}
6610
+		if fieldNum <= 0 {
6611
+			return fmt.Errorf("proto: StatsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
6612
+		}
6613
+		switch fieldNum {
6614
+		case 1:
6615
+			if wireType != 2 {
6616
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
6617
+			}
6618
+			var stringLen uint64
6619
+			for shift := uint(0); ; shift += 7 {
6620
+				if shift >= 64 {
6621
+					return ErrIntOverflowShim
6622
+				}
6623
+				if iNdEx >= l {
6624
+					return io.ErrUnexpectedEOF
6625
+				}
6626
+				b := dAtA[iNdEx]
6627
+				iNdEx++
6628
+				stringLen |= uint64(b&0x7F) << shift
6629
+				if b < 0x80 {
6630
+					break
6631
+				}
6632
+			}
6633
+			intStringLen := int(stringLen)
6634
+			if intStringLen < 0 {
6635
+				return ErrInvalidLengthShim
6636
+			}
6637
+			postIndex := iNdEx + intStringLen
6638
+			if postIndex < 0 {
6639
+				return ErrInvalidLengthShim
6640
+			}
6641
+			if postIndex > l {
6642
+				return io.ErrUnexpectedEOF
6643
+			}
6644
+			m.ID = string(dAtA[iNdEx:postIndex])
6645
+			iNdEx = postIndex
6646
+		default:
6647
+			iNdEx = preIndex
6648
+			skippy, err := skipShim(dAtA[iNdEx:])
6649
+			if err != nil {
6650
+				return err
6651
+			}
6652
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
6653
+				return ErrInvalidLengthShim
6654
+			}
6655
+			if (iNdEx + skippy) > l {
6656
+				return io.ErrUnexpectedEOF
6657
+			}
6658
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
6659
+			iNdEx += skippy
6660
+		}
6661
+	}
6662
+
6663
+	if iNdEx > l {
6664
+		return io.ErrUnexpectedEOF
6665
+	}
6666
+	return nil
6667
+}
6668
+func (m *StatsResponse) Unmarshal(dAtA []byte) error {
6669
+	l := len(dAtA)
6670
+	iNdEx := 0
6671
+	for iNdEx < l {
6672
+		preIndex := iNdEx
6673
+		var wire uint64
6674
+		for shift := uint(0); ; shift += 7 {
6675
+			if shift >= 64 {
6676
+				return ErrIntOverflowShim
6677
+			}
6678
+			if iNdEx >= l {
6679
+				return io.ErrUnexpectedEOF
6680
+			}
6681
+			b := dAtA[iNdEx]
6682
+			iNdEx++
6683
+			wire |= uint64(b&0x7F) << shift
6684
+			if b < 0x80 {
6685
+				break
6686
+			}
6687
+		}
6688
+		fieldNum := int32(wire >> 3)
6689
+		wireType := int(wire & 0x7)
6690
+		if wireType == 4 {
6691
+			return fmt.Errorf("proto: StatsResponse: wiretype end group for non-group")
6692
+		}
6693
+		if fieldNum <= 0 {
6694
+			return fmt.Errorf("proto: StatsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
6695
+		}
6696
+		switch fieldNum {
6697
+		case 1:
6698
+			if wireType != 2 {
6699
+				return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType)
6700
+			}
6701
+			var msglen int
6702
+			for shift := uint(0); ; shift += 7 {
6703
+				if shift >= 64 {
6704
+					return ErrIntOverflowShim
6705
+				}
6706
+				if iNdEx >= l {
6707
+					return io.ErrUnexpectedEOF
6708
+				}
6709
+				b := dAtA[iNdEx]
6710
+				iNdEx++
6711
+				msglen |= int(b&0x7F) << shift
6712
+				if b < 0x80 {
6713
+					break
6714
+				}
6715
+			}
6716
+			if msglen < 0 {
6717
+				return ErrInvalidLengthShim
6718
+			}
6719
+			postIndex := iNdEx + msglen
6720
+			if postIndex < 0 {
6721
+				return ErrInvalidLengthShim
6722
+			}
6723
+			if postIndex > l {
6724
+				return io.ErrUnexpectedEOF
6725
+			}
6726
+			if m.Stats == nil {
6727
+				m.Stats = &types1.Any{}
6728
+			}
6729
+			if err := m.Stats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
6730
+				return err
6731
+			}
6732
+			iNdEx = postIndex
6733
+		default:
6734
+			iNdEx = preIndex
6735
+			skippy, err := skipShim(dAtA[iNdEx:])
6736
+			if err != nil {
6737
+				return err
6738
+			}
6739
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
6740
+				return ErrInvalidLengthShim
6741
+			}
6742
+			if (iNdEx + skippy) > l {
6743
+				return io.ErrUnexpectedEOF
6744
+			}
6745
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
6746
+			iNdEx += skippy
6747
+		}
6748
+	}
6749
+
6750
+	if iNdEx > l {
6751
+		return io.ErrUnexpectedEOF
6752
+	}
6753
+	return nil
6754
+}
6755
+func (m *ConnectRequest) Unmarshal(dAtA []byte) error {
6756
+	l := len(dAtA)
6757
+	iNdEx := 0
6758
+	for iNdEx < l {
6759
+		preIndex := iNdEx
6760
+		var wire uint64
6761
+		for shift := uint(0); ; shift += 7 {
6762
+			if shift >= 64 {
6763
+				return ErrIntOverflowShim
6764
+			}
6765
+			if iNdEx >= l {
6766
+				return io.ErrUnexpectedEOF
6767
+			}
6768
+			b := dAtA[iNdEx]
6769
+			iNdEx++
6770
+			wire |= uint64(b&0x7F) << shift
6771
+			if b < 0x80 {
6772
+				break
6773
+			}
6774
+		}
6775
+		fieldNum := int32(wire >> 3)
6776
+		wireType := int(wire & 0x7)
6777
+		if wireType == 4 {
6778
+			return fmt.Errorf("proto: ConnectRequest: wiretype end group for non-group")
6779
+		}
6780
+		if fieldNum <= 0 {
6781
+			return fmt.Errorf("proto: ConnectRequest: illegal tag %d (wire type %d)", fieldNum, wire)
6782
+		}
6783
+		switch fieldNum {
6784
+		case 1:
6785
+			if wireType != 2 {
6786
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
6787
+			}
6788
+			var stringLen uint64
6789
+			for shift := uint(0); ; shift += 7 {
6790
+				if shift >= 64 {
6791
+					return ErrIntOverflowShim
6792
+				}
6793
+				if iNdEx >= l {
6794
+					return io.ErrUnexpectedEOF
6795
+				}
6796
+				b := dAtA[iNdEx]
6797
+				iNdEx++
6798
+				stringLen |= uint64(b&0x7F) << shift
6799
+				if b < 0x80 {
6800
+					break
6801
+				}
6802
+			}
6803
+			intStringLen := int(stringLen)
6804
+			if intStringLen < 0 {
6805
+				return ErrInvalidLengthShim
6806
+			}
6807
+			postIndex := iNdEx + intStringLen
6808
+			if postIndex < 0 {
6809
+				return ErrInvalidLengthShim
6810
+			}
6811
+			if postIndex > l {
6812
+				return io.ErrUnexpectedEOF
6813
+			}
6814
+			m.ID = string(dAtA[iNdEx:postIndex])
6815
+			iNdEx = postIndex
6816
+		default:
6817
+			iNdEx = preIndex
6818
+			skippy, err := skipShim(dAtA[iNdEx:])
6819
+			if err != nil {
6820
+				return err
6821
+			}
6822
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
6823
+				return ErrInvalidLengthShim
6824
+			}
6825
+			if (iNdEx + skippy) > l {
6826
+				return io.ErrUnexpectedEOF
6827
+			}
6828
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
6829
+			iNdEx += skippy
6830
+		}
6831
+	}
6832
+
6833
+	if iNdEx > l {
6834
+		return io.ErrUnexpectedEOF
6835
+	}
6836
+	return nil
6837
+}
6838
+func (m *ConnectResponse) Unmarshal(dAtA []byte) error {
6839
+	l := len(dAtA)
6840
+	iNdEx := 0
6841
+	for iNdEx < l {
6842
+		preIndex := iNdEx
6843
+		var wire uint64
6844
+		for shift := uint(0); ; shift += 7 {
6845
+			if shift >= 64 {
6846
+				return ErrIntOverflowShim
6847
+			}
6848
+			if iNdEx >= l {
6849
+				return io.ErrUnexpectedEOF
6850
+			}
6851
+			b := dAtA[iNdEx]
6852
+			iNdEx++
6853
+			wire |= uint64(b&0x7F) << shift
6854
+			if b < 0x80 {
6855
+				break
6856
+			}
6857
+		}
6858
+		fieldNum := int32(wire >> 3)
6859
+		wireType := int(wire & 0x7)
6860
+		if wireType == 4 {
6861
+			return fmt.Errorf("proto: ConnectResponse: wiretype end group for non-group")
6862
+		}
6863
+		if fieldNum <= 0 {
6864
+			return fmt.Errorf("proto: ConnectResponse: illegal tag %d (wire type %d)", fieldNum, wire)
6865
+		}
6866
+		switch fieldNum {
6867
+		case 1:
6868
+			if wireType != 0 {
6869
+				return fmt.Errorf("proto: wrong wireType = %d for field ShimPid", wireType)
6870
+			}
6871
+			m.ShimPid = 0
6872
+			for shift := uint(0); ; shift += 7 {
6873
+				if shift >= 64 {
6874
+					return ErrIntOverflowShim
6875
+				}
6876
+				if iNdEx >= l {
6877
+					return io.ErrUnexpectedEOF
6878
+				}
6879
+				b := dAtA[iNdEx]
6880
+				iNdEx++
6881
+				m.ShimPid |= uint32(b&0x7F) << shift
6882
+				if b < 0x80 {
6883
+					break
6884
+				}
6885
+			}
6886
+		case 2:
6887
+			if wireType != 0 {
6888
+				return fmt.Errorf("proto: wrong wireType = %d for field TaskPid", wireType)
6889
+			}
6890
+			m.TaskPid = 0
6891
+			for shift := uint(0); ; shift += 7 {
6892
+				if shift >= 64 {
6893
+					return ErrIntOverflowShim
6894
+				}
6895
+				if iNdEx >= l {
6896
+					return io.ErrUnexpectedEOF
6897
+				}
6898
+				b := dAtA[iNdEx]
6899
+				iNdEx++
6900
+				m.TaskPid |= uint32(b&0x7F) << shift
6901
+				if b < 0x80 {
6902
+					break
6903
+				}
6904
+			}
6905
+		case 3:
6906
+			if wireType != 2 {
6907
+				return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
6908
+			}
6909
+			var stringLen uint64
6910
+			for shift := uint(0); ; shift += 7 {
6911
+				if shift >= 64 {
6912
+					return ErrIntOverflowShim
6913
+				}
6914
+				if iNdEx >= l {
6915
+					return io.ErrUnexpectedEOF
6916
+				}
6917
+				b := dAtA[iNdEx]
6918
+				iNdEx++
6919
+				stringLen |= uint64(b&0x7F) << shift
6920
+				if b < 0x80 {
6921
+					break
6922
+				}
6923
+			}
6924
+			intStringLen := int(stringLen)
6925
+			if intStringLen < 0 {
6926
+				return ErrInvalidLengthShim
6927
+			}
6928
+			postIndex := iNdEx + intStringLen
6929
+			if postIndex < 0 {
6930
+				return ErrInvalidLengthShim
6931
+			}
6932
+			if postIndex > l {
6933
+				return io.ErrUnexpectedEOF
6934
+			}
6935
+			m.Version = string(dAtA[iNdEx:postIndex])
6936
+			iNdEx = postIndex
6937
+		default:
6938
+			iNdEx = preIndex
6939
+			skippy, err := skipShim(dAtA[iNdEx:])
6940
+			if err != nil {
6941
+				return err
6942
+			}
6943
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
6944
+				return ErrInvalidLengthShim
6945
+			}
6946
+			if (iNdEx + skippy) > l {
6947
+				return io.ErrUnexpectedEOF
6948
+			}
6949
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
6950
+			iNdEx += skippy
6951
+		}
6952
+	}
6953
+
6954
+	if iNdEx > l {
6955
+		return io.ErrUnexpectedEOF
6956
+	}
6957
+	return nil
6958
+}
6959
+func (m *ShutdownRequest) Unmarshal(dAtA []byte) error {
6960
+	l := len(dAtA)
6961
+	iNdEx := 0
6962
+	for iNdEx < l {
6963
+		preIndex := iNdEx
6964
+		var wire uint64
6965
+		for shift := uint(0); ; shift += 7 {
6966
+			if shift >= 64 {
6967
+				return ErrIntOverflowShim
6968
+			}
6969
+			if iNdEx >= l {
6970
+				return io.ErrUnexpectedEOF
6971
+			}
6972
+			b := dAtA[iNdEx]
6973
+			iNdEx++
6974
+			wire |= uint64(b&0x7F) << shift
6975
+			if b < 0x80 {
6976
+				break
6977
+			}
6978
+		}
6979
+		fieldNum := int32(wire >> 3)
6980
+		wireType := int(wire & 0x7)
6981
+		if wireType == 4 {
6982
+			return fmt.Errorf("proto: ShutdownRequest: wiretype end group for non-group")
6983
+		}
6984
+		if fieldNum <= 0 {
6985
+			return fmt.Errorf("proto: ShutdownRequest: illegal tag %d (wire type %d)", fieldNum, wire)
6986
+		}
6987
+		switch fieldNum {
6988
+		case 1:
6989
+			if wireType != 2 {
6990
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
6991
+			}
6992
+			var stringLen uint64
6993
+			for shift := uint(0); ; shift += 7 {
6994
+				if shift >= 64 {
6995
+					return ErrIntOverflowShim
6996
+				}
6997
+				if iNdEx >= l {
6998
+					return io.ErrUnexpectedEOF
6999
+				}
7000
+				b := dAtA[iNdEx]
7001
+				iNdEx++
7002
+				stringLen |= uint64(b&0x7F) << shift
7003
+				if b < 0x80 {
7004
+					break
7005
+				}
7006
+			}
7007
+			intStringLen := int(stringLen)
7008
+			if intStringLen < 0 {
7009
+				return ErrInvalidLengthShim
7010
+			}
7011
+			postIndex := iNdEx + intStringLen
7012
+			if postIndex < 0 {
7013
+				return ErrInvalidLengthShim
7014
+			}
7015
+			if postIndex > l {
7016
+				return io.ErrUnexpectedEOF
7017
+			}
7018
+			m.ID = string(dAtA[iNdEx:postIndex])
7019
+			iNdEx = postIndex
7020
+		case 2:
7021
+			if wireType != 0 {
7022
+				return fmt.Errorf("proto: wrong wireType = %d for field Now", wireType)
7023
+			}
7024
+			var v int
7025
+			for shift := uint(0); ; shift += 7 {
7026
+				if shift >= 64 {
7027
+					return ErrIntOverflowShim
7028
+				}
7029
+				if iNdEx >= l {
7030
+					return io.ErrUnexpectedEOF
7031
+				}
7032
+				b := dAtA[iNdEx]
7033
+				iNdEx++
7034
+				v |= int(b&0x7F) << shift
7035
+				if b < 0x80 {
7036
+					break
7037
+				}
7038
+			}
7039
+			m.Now = bool(v != 0)
7040
+		default:
7041
+			iNdEx = preIndex
7042
+			skippy, err := skipShim(dAtA[iNdEx:])
7043
+			if err != nil {
7044
+				return err
7045
+			}
7046
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
7047
+				return ErrInvalidLengthShim
7048
+			}
7049
+			if (iNdEx + skippy) > l {
7050
+				return io.ErrUnexpectedEOF
7051
+			}
7052
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
7053
+			iNdEx += skippy
7054
+		}
7055
+	}
7056
+
7057
+	if iNdEx > l {
7058
+		return io.ErrUnexpectedEOF
7059
+	}
7060
+	return nil
7061
+}
7062
+func (m *PauseRequest) Unmarshal(dAtA []byte) error {
7063
+	l := len(dAtA)
7064
+	iNdEx := 0
7065
+	for iNdEx < l {
7066
+		preIndex := iNdEx
7067
+		var wire uint64
7068
+		for shift := uint(0); ; shift += 7 {
7069
+			if shift >= 64 {
7070
+				return ErrIntOverflowShim
7071
+			}
7072
+			if iNdEx >= l {
7073
+				return io.ErrUnexpectedEOF
7074
+			}
7075
+			b := dAtA[iNdEx]
7076
+			iNdEx++
7077
+			wire |= uint64(b&0x7F) << shift
7078
+			if b < 0x80 {
7079
+				break
7080
+			}
7081
+		}
7082
+		fieldNum := int32(wire >> 3)
7083
+		wireType := int(wire & 0x7)
7084
+		if wireType == 4 {
7085
+			return fmt.Errorf("proto: PauseRequest: wiretype end group for non-group")
7086
+		}
7087
+		if fieldNum <= 0 {
7088
+			return fmt.Errorf("proto: PauseRequest: illegal tag %d (wire type %d)", fieldNum, wire)
7089
+		}
7090
+		switch fieldNum {
7091
+		case 1:
7092
+			if wireType != 2 {
7093
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
7094
+			}
7095
+			var stringLen uint64
7096
+			for shift := uint(0); ; shift += 7 {
7097
+				if shift >= 64 {
7098
+					return ErrIntOverflowShim
7099
+				}
7100
+				if iNdEx >= l {
7101
+					return io.ErrUnexpectedEOF
7102
+				}
7103
+				b := dAtA[iNdEx]
7104
+				iNdEx++
7105
+				stringLen |= uint64(b&0x7F) << shift
7106
+				if b < 0x80 {
7107
+					break
7108
+				}
7109
+			}
7110
+			intStringLen := int(stringLen)
7111
+			if intStringLen < 0 {
7112
+				return ErrInvalidLengthShim
7113
+			}
7114
+			postIndex := iNdEx + intStringLen
7115
+			if postIndex < 0 {
7116
+				return ErrInvalidLengthShim
7117
+			}
7118
+			if postIndex > l {
7119
+				return io.ErrUnexpectedEOF
7120
+			}
7121
+			m.ID = string(dAtA[iNdEx:postIndex])
7122
+			iNdEx = postIndex
7123
+		default:
7124
+			iNdEx = preIndex
7125
+			skippy, err := skipShim(dAtA[iNdEx:])
7126
+			if err != nil {
7127
+				return err
7128
+			}
7129
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
7130
+				return ErrInvalidLengthShim
7131
+			}
7132
+			if (iNdEx + skippy) > l {
7133
+				return io.ErrUnexpectedEOF
7134
+			}
7135
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
7136
+			iNdEx += skippy
7137
+		}
7138
+	}
7139
+
7140
+	if iNdEx > l {
7141
+		return io.ErrUnexpectedEOF
7142
+	}
7143
+	return nil
7144
+}
7145
+func (m *ResumeRequest) Unmarshal(dAtA []byte) error {
7146
+	l := len(dAtA)
7147
+	iNdEx := 0
7148
+	for iNdEx < l {
7149
+		preIndex := iNdEx
7150
+		var wire uint64
7151
+		for shift := uint(0); ; shift += 7 {
7152
+			if shift >= 64 {
7153
+				return ErrIntOverflowShim
7154
+			}
7155
+			if iNdEx >= l {
7156
+				return io.ErrUnexpectedEOF
7157
+			}
7158
+			b := dAtA[iNdEx]
7159
+			iNdEx++
7160
+			wire |= uint64(b&0x7F) << shift
7161
+			if b < 0x80 {
7162
+				break
7163
+			}
7164
+		}
7165
+		fieldNum := int32(wire >> 3)
7166
+		wireType := int(wire & 0x7)
7167
+		if wireType == 4 {
7168
+			return fmt.Errorf("proto: ResumeRequest: wiretype end group for non-group")
7169
+		}
7170
+		if fieldNum <= 0 {
7171
+			return fmt.Errorf("proto: ResumeRequest: illegal tag %d (wire type %d)", fieldNum, wire)
7172
+		}
7173
+		switch fieldNum {
7174
+		case 1:
7175
+			if wireType != 2 {
7176
+				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
7177
+			}
7178
+			var stringLen uint64
7179
+			for shift := uint(0); ; shift += 7 {
7180
+				if shift >= 64 {
7181
+					return ErrIntOverflowShim
7182
+				}
7183
+				if iNdEx >= l {
7184
+					return io.ErrUnexpectedEOF
7185
+				}
7186
+				b := dAtA[iNdEx]
7187
+				iNdEx++
7188
+				stringLen |= uint64(b&0x7F) << shift
7189
+				if b < 0x80 {
7190
+					break
7191
+				}
7192
+			}
7193
+			intStringLen := int(stringLen)
7194
+			if intStringLen < 0 {
7195
+				return ErrInvalidLengthShim
7196
+			}
7197
+			postIndex := iNdEx + intStringLen
7198
+			if postIndex < 0 {
7199
+				return ErrInvalidLengthShim
7200
+			}
7201
+			if postIndex > l {
7202
+				return io.ErrUnexpectedEOF
7203
+			}
7204
+			m.ID = string(dAtA[iNdEx:postIndex])
7205
+			iNdEx = postIndex
7206
+		default:
7207
+			iNdEx = preIndex
7208
+			skippy, err := skipShim(dAtA[iNdEx:])
7209
+			if err != nil {
7210
+				return err
7211
+			}
7212
+			if (skippy < 0) || (iNdEx+skippy) < 0 {
7213
+				return ErrInvalidLengthShim
7214
+			}
7215
+			if (iNdEx + skippy) > l {
7216
+				return io.ErrUnexpectedEOF
7217
+			}
7218
+			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
7219
+			iNdEx += skippy
7220
+		}
7221
+	}
7222
+
7223
+	if iNdEx > l {
7224
+		return io.ErrUnexpectedEOF
7225
+	}
7226
+	return nil
7227
+}
7228
+func skipShim(dAtA []byte) (n int, err error) {
7229
+	l := len(dAtA)
7230
+	iNdEx := 0
7231
+	depth := 0
7232
+	for iNdEx < l {
7233
+		var wire uint64
7234
+		for shift := uint(0); ; shift += 7 {
7235
+			if shift >= 64 {
7236
+				return 0, ErrIntOverflowShim
7237
+			}
7238
+			if iNdEx >= l {
7239
+				return 0, io.ErrUnexpectedEOF
7240
+			}
7241
+			b := dAtA[iNdEx]
7242
+			iNdEx++
7243
+			wire |= (uint64(b) & 0x7F) << shift
7244
+			if b < 0x80 {
7245
+				break
7246
+			}
7247
+		}
7248
+		wireType := int(wire & 0x7)
7249
+		switch wireType {
7250
+		case 0:
7251
+			for shift := uint(0); ; shift += 7 {
7252
+				if shift >= 64 {
7253
+					return 0, ErrIntOverflowShim
7254
+				}
7255
+				if iNdEx >= l {
7256
+					return 0, io.ErrUnexpectedEOF
7257
+				}
7258
+				iNdEx++
7259
+				if dAtA[iNdEx-1] < 0x80 {
7260
+					break
7261
+				}
7262
+			}
7263
+		case 1:
7264
+			iNdEx += 8
7265
+		case 2:
7266
+			var length int
7267
+			for shift := uint(0); ; shift += 7 {
7268
+				if shift >= 64 {
7269
+					return 0, ErrIntOverflowShim
7270
+				}
7271
+				if iNdEx >= l {
7272
+					return 0, io.ErrUnexpectedEOF
7273
+				}
7274
+				b := dAtA[iNdEx]
7275
+				iNdEx++
7276
+				length |= (int(b) & 0x7F) << shift
7277
+				if b < 0x80 {
7278
+					break
7279
+				}
7280
+			}
7281
+			if length < 0 {
7282
+				return 0, ErrInvalidLengthShim
7283
+			}
7284
+			iNdEx += length
7285
+		case 3:
7286
+			depth++
7287
+		case 4:
7288
+			if depth == 0 {
7289
+				return 0, ErrUnexpectedEndOfGroupShim
7290
+			}
7291
+			depth--
7292
+		case 5:
7293
+			iNdEx += 4
7294
+		default:
7295
+			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
7296
+		}
7297
+		if iNdEx < 0 {
7298
+			return 0, ErrInvalidLengthShim
7299
+		}
7300
+		if depth == 0 {
7301
+			return iNdEx, nil
7302
+		}
7303
+	}
7304
+	return 0, io.ErrUnexpectedEOF
7305
+}
7306
+
7307
+var (
7308
+	ErrInvalidLengthShim        = fmt.Errorf("proto: negative length found during unmarshaling")
7309
+	ErrIntOverflowShim          = fmt.Errorf("proto: integer overflow")
7310
+	ErrUnexpectedEndOfGroupShim = fmt.Errorf("proto: unexpected end of group")
7311
+)
0 7312
new file mode 100644
... ...
@@ -0,0 +1,202 @@
0
+/*
1
+	Copyright The containerd Authors.
2
+
3
+	Licensed under the Apache License, Version 2.0 (the "License");
4
+	you may not use this file except in compliance with the License.
5
+	You may obtain a copy of the License at
6
+
7
+		http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+	Unless required by applicable law or agreed to in writing, software
10
+	distributed under the License is distributed on an "AS IS" BASIS,
11
+	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+	See the License for the specific language governing permissions and
13
+	limitations under the License.
14
+*/
15
+
16
+syntax = "proto3";
17
+
18
+package containerd.task.v2;
19
+
20
+import "google/protobuf/any.proto";
21
+import "google/protobuf/empty.proto";
22
+import weak "gogoproto/gogo.proto";
23
+import "google/protobuf/timestamp.proto";
24
+import "github.com/containerd/containerd/api/types/mount.proto";
25
+import "github.com/containerd/containerd/api/types/task/task.proto";
26
+
27
+option go_package = "github.com/containerd/containerd/runtime/v2/task;task";
28
+
29
+// Shim service is launched for each container and is responsible for owning the IO
30
+// for the container and its additional processes.  The shim is also the parent of
31
+// each container and allows reattaching to the IO and receiving the exit status
32
+// for the container processes.
33
+service Task {
34
+	rpc State(StateRequest) returns (StateResponse);
35
+	rpc Create(CreateTaskRequest) returns (CreateTaskResponse);
36
+	rpc Start(StartRequest) returns (StartResponse);
37
+	rpc Delete(DeleteRequest) returns (DeleteResponse);
38
+	rpc Pids(PidsRequest) returns (PidsResponse);
39
+	rpc Pause(PauseRequest) returns (google.protobuf.Empty);
40
+	rpc Resume(ResumeRequest) returns (google.protobuf.Empty);
41
+	rpc Checkpoint(CheckpointTaskRequest) returns (google.protobuf.Empty);
42
+	rpc Kill(KillRequest) returns (google.protobuf.Empty);
43
+	rpc Exec(ExecProcessRequest) returns (google.protobuf.Empty);
44
+	rpc ResizePty(ResizePtyRequest) returns (google.protobuf.Empty);
45
+	rpc CloseIO(CloseIORequest) returns (google.protobuf.Empty);
46
+	rpc Update(UpdateTaskRequest) returns (google.protobuf.Empty);
47
+	rpc Wait(WaitRequest) returns (WaitResponse);
48
+	rpc Stats(StatsRequest) returns (StatsResponse);
49
+	rpc Connect(ConnectRequest) returns (ConnectResponse);
50
+	rpc Shutdown(ShutdownRequest) returns (google.protobuf.Empty);
51
+}
52
+
53
+message CreateTaskRequest {
54
+	string id = 1;
55
+	string bundle = 2;
56
+	repeated containerd.types.Mount rootfs = 3;
57
+	bool terminal = 4;
58
+	string stdin = 5;
59
+	string stdout = 6;
60
+	string stderr = 7;
61
+	string checkpoint = 8;
62
+	string parent_checkpoint = 9;
63
+	google.protobuf.Any options = 10;
64
+}
65
+
66
+message CreateTaskResponse {
67
+	uint32 pid = 1;
68
+}
69
+
70
+message DeleteRequest {
71
+	string id = 1;
72
+	string exec_id = 2;
73
+}
74
+
75
+message DeleteResponse {
76
+	uint32 pid = 1;
77
+	uint32 exit_status = 2;
78
+	google.protobuf.Timestamp exited_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
79
+}
80
+
81
+message ExecProcessRequest {
82
+	string id = 1;
83
+	string exec_id = 2;
84
+	bool terminal = 3;
85
+	string stdin = 4;
86
+	string stdout = 5;
87
+	string stderr = 6;
88
+	google.protobuf.Any spec = 7;
89
+}
90
+
91
+message ExecProcessResponse {
92
+}
93
+
94
+message ResizePtyRequest {
95
+	string id = 1;
96
+	string exec_id = 2;
97
+	uint32 width = 3;
98
+	uint32 height = 4;
99
+}
100
+
101
+message StateRequest {
102
+	string id = 1;
103
+	string exec_id = 2;
104
+}
105
+
106
+message StateResponse {
107
+	string id = 1;
108
+	string bundle = 2;
109
+	uint32 pid = 3;
110
+	containerd.v1.types.Status status = 4;
111
+	string stdin = 5;
112
+	string stdout = 6;
113
+	string stderr = 7;
114
+	bool terminal = 8;
115
+	uint32 exit_status = 9;
116
+	google.protobuf.Timestamp exited_at = 10 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
117
+	string exec_id = 11;
118
+}
119
+
120
+message KillRequest {
121
+	string id = 1;
122
+	string exec_id = 2;
123
+	uint32 signal = 3;
124
+	bool all = 4;
125
+}
126
+
127
+message CloseIORequest {
128
+	string id = 1;
129
+	string exec_id = 2;
130
+	bool stdin = 3;
131
+}
132
+
133
+message PidsRequest {
134
+	string id = 1;
135
+}
136
+
137
+message PidsResponse {
138
+	repeated containerd.v1.types.ProcessInfo processes = 1;
139
+}
140
+
141
+message CheckpointTaskRequest {
142
+	string id = 1;
143
+	string path = 2;
144
+	google.protobuf.Any options = 3;
145
+}
146
+
147
+message UpdateTaskRequest {
148
+	string id = 1;
149
+	google.protobuf.Any resources = 2;
150
+	map<string, string> annotations = 3;
151
+}
152
+
153
+message StartRequest {
154
+	string id = 1;
155
+	string exec_id = 2;
156
+}
157
+
158
+message StartResponse {
159
+	uint32 pid = 1;
160
+}
161
+
162
+message WaitRequest {
163
+	string id = 1;
164
+	string exec_id = 2;
165
+}
166
+
167
+message WaitResponse {
168
+	uint32 exit_status = 1;
169
+	google.protobuf.Timestamp exited_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
170
+}
171
+
172
+message StatsRequest {
173
+	string id = 1;
174
+}
175
+
176
+message StatsResponse {
177
+	google.protobuf.Any stats = 1;
178
+}
179
+
180
+message ConnectRequest {
181
+	string id = 1;
182
+}
183
+
184
+message ConnectResponse {
185
+	uint32 shim_pid = 1;
186
+	uint32 task_pid = 2;
187
+	string version = 3;
188
+}
189
+
190
+message ShutdownRequest {
191
+	string id = 1;
192
+	bool now = 2;
193
+}
194
+
195
+message PauseRequest {
196
+	string id = 1;
197
+}
198
+
199
+message ResumeRequest {
200
+	string id = 1;
201
+}
0 202
new file mode 100644
... ...
@@ -0,0 +1,283 @@
0
+//go:build !windows
1
+// +build !windows
2
+
3
+/*
4
+   Copyright The containerd Authors.
5
+
6
+   Licensed under the Apache License, Version 2.0 (the "License");
7
+   you may not use this file except in compliance with the License.
8
+   You may obtain a copy of the License at
9
+
10
+       http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+   Unless required by applicable law or agreed to in writing, software
13
+   distributed under the License is distributed on an "AS IS" BASIS,
14
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+   See the License for the specific language governing permissions and
16
+   limitations under the License.
17
+*/
18
+
19
+package reaper
20
+
21
+import (
22
+	"errors"
23
+	"fmt"
24
+	"sync"
25
+	"syscall"
26
+	"time"
27
+
28
+	runc "github.com/containerd/go-runc"
29
+	exec "golang.org/x/sys/execabs"
30
+	"golang.org/x/sys/unix"
31
+)
32
+
33
+// ErrNoSuchProcess is returned when the process no longer exists
34
+var ErrNoSuchProcess = errors.New("no such process")
35
+
36
+const bufferSize = 32
37
+
38
+type subscriber struct {
39
+	sync.Mutex
40
+	c      chan runc.Exit
41
+	closed bool
42
+}
43
+
44
+func (s *subscriber) close() {
45
+	s.Lock()
46
+	if s.closed {
47
+		s.Unlock()
48
+		return
49
+	}
50
+	close(s.c)
51
+	s.closed = true
52
+	s.Unlock()
53
+}
54
+
55
+func (s *subscriber) do(fn func()) {
56
+	s.Lock()
57
+	fn()
58
+	s.Unlock()
59
+}
60
+
61
+// Reap should be called when the process receives an SIGCHLD.  Reap will reap
62
+// all exited processes and close their wait channels
63
+func Reap() error {
64
+	now := time.Now()
65
+	exits, err := reap(false)
66
+	for _, e := range exits {
67
+		done := Default.notify(runc.Exit{
68
+			Timestamp: now,
69
+			Pid:       e.Pid,
70
+			Status:    e.Status,
71
+		})
72
+
73
+		select {
74
+		case <-done:
75
+		case <-time.After(1 * time.Second):
76
+		}
77
+	}
78
+	return err
79
+}
80
+
81
+// Default is the default monitor initialized for the package
82
+var Default = &Monitor{
83
+	subscribers: make(map[chan runc.Exit]*subscriber),
84
+}
85
+
86
+// Monitor monitors the underlying system for process status changes
87
+type Monitor struct {
88
+	sync.Mutex
89
+
90
+	subscribers map[chan runc.Exit]*subscriber
91
+}
92
+
93
+// Start starts the command a registers the process with the reaper
94
+func (m *Monitor) Start(c *exec.Cmd) (chan runc.Exit, error) {
95
+	ec := m.Subscribe()
96
+	if err := c.Start(); err != nil {
97
+		m.Unsubscribe(ec)
98
+		return nil, err
99
+	}
100
+	return ec, nil
101
+}
102
+
103
+// Wait blocks until a process is signal as dead.
104
+// User should rely on the value of the exit status to determine if the
105
+// command was successful or not.
106
+func (m *Monitor) Wait(c *exec.Cmd, ec chan runc.Exit) (int, error) {
107
+	for e := range ec {
108
+		if e.Pid == c.Process.Pid {
109
+			// make sure we flush all IO
110
+			c.Wait()
111
+			m.Unsubscribe(ec)
112
+			return e.Status, nil
113
+		}
114
+	}
115
+	// return no such process if the ec channel is closed and no more exit
116
+	// events will be sent
117
+	return -1, ErrNoSuchProcess
118
+}
119
+
120
+// WaitTimeout is used to skip the blocked command and kill the left process.
121
+func (m *Monitor) WaitTimeout(c *exec.Cmd, ec chan runc.Exit, timeout time.Duration) (int, error) {
122
+	type exitStatusWrapper struct {
123
+		status int
124
+		err    error
125
+	}
126
+
127
+	// capacity can make sure that the following goroutine will not be
128
+	// blocked if there is no receiver when timeout.
129
+	waitCh := make(chan *exitStatusWrapper, 1)
130
+	go func() {
131
+		defer close(waitCh)
132
+
133
+		status, err := m.Wait(c, ec)
134
+		waitCh <- &exitStatusWrapper{
135
+			status: status,
136
+			err:    err,
137
+		}
138
+	}()
139
+
140
+	timer := time.NewTimer(timeout)
141
+	defer timer.Stop()
142
+
143
+	select {
144
+	case <-timer.C:
145
+		syscall.Kill(c.Process.Pid, syscall.SIGKILL)
146
+		return 0, fmt.Errorf("timeout %v for cmd(pid=%d): %s, %s", timeout, c.Process.Pid, c.Path, c.Args)
147
+	case res := <-waitCh:
148
+		return res.status, res.err
149
+	}
150
+}
151
+
152
+// Subscribe to process exit changes
153
+func (m *Monitor) Subscribe() chan runc.Exit {
154
+	c := make(chan runc.Exit, bufferSize)
155
+	m.Lock()
156
+	m.subscribers[c] = &subscriber{
157
+		c: c,
158
+	}
159
+	m.Unlock()
160
+	return c
161
+}
162
+
163
+// Unsubscribe to process exit changes
164
+func (m *Monitor) Unsubscribe(c chan runc.Exit) {
165
+	m.Lock()
166
+	s, ok := m.subscribers[c]
167
+	if !ok {
168
+		m.Unlock()
169
+		return
170
+	}
171
+	s.close()
172
+	delete(m.subscribers, c)
173
+	m.Unlock()
174
+}
175
+
176
+func (m *Monitor) getSubscribers() map[chan runc.Exit]*subscriber {
177
+	out := make(map[chan runc.Exit]*subscriber)
178
+	m.Lock()
179
+	for k, v := range m.subscribers {
180
+		out[k] = v
181
+	}
182
+	m.Unlock()
183
+	return out
184
+}
185
+
186
+func (m *Monitor) notify(e runc.Exit) chan struct{} {
187
+	const timeout = 1 * time.Millisecond
188
+	var (
189
+		done    = make(chan struct{}, 1)
190
+		timer   = time.NewTimer(timeout)
191
+		success = make(map[chan runc.Exit]struct{})
192
+	)
193
+	stop(timer, true)
194
+
195
+	go func() {
196
+		defer close(done)
197
+
198
+		for {
199
+			var (
200
+				failed      int
201
+				subscribers = m.getSubscribers()
202
+			)
203
+			for _, s := range subscribers {
204
+				s.do(func() {
205
+					if s.closed {
206
+						return
207
+					}
208
+					if _, ok := success[s.c]; ok {
209
+						return
210
+					}
211
+					timer.Reset(timeout)
212
+					recv := true
213
+					select {
214
+					case s.c <- e:
215
+						success[s.c] = struct{}{}
216
+					case <-timer.C:
217
+						recv = false
218
+						failed++
219
+					}
220
+					stop(timer, recv)
221
+				})
222
+			}
223
+			// all subscribers received the message
224
+			if failed == 0 {
225
+				return
226
+			}
227
+		}
228
+	}()
229
+	return done
230
+}
231
+
232
+func stop(timer *time.Timer, recv bool) {
233
+	if !timer.Stop() && recv {
234
+		<-timer.C
235
+	}
236
+}
237
+
238
+// exit is the wait4 information from an exited process
239
+type exit struct {
240
+	Pid    int
241
+	Status int
242
+}
243
+
244
+// reap reaps all child processes for the calling process and returns their
245
+// exit information
246
+func reap(wait bool) (exits []exit, err error) {
247
+	var (
248
+		ws  unix.WaitStatus
249
+		rus unix.Rusage
250
+	)
251
+	flag := unix.WNOHANG
252
+	if wait {
253
+		flag = 0
254
+	}
255
+	for {
256
+		pid, err := unix.Wait4(-1, &ws, flag, &rus)
257
+		if err != nil {
258
+			if err == unix.ECHILD {
259
+				return exits, nil
260
+			}
261
+			return exits, err
262
+		}
263
+		if pid <= 0 {
264
+			return exits, nil
265
+		}
266
+		exits = append(exits, exit{
267
+			Pid:    pid,
268
+			Status: exitStatus(ws),
269
+		})
270
+	}
271
+}
272
+
273
+const exitSignalOffset = 128
274
+
275
+// exitStatus returns the correct exit status for a process based on if it
276
+// was signaled or exited cleanly
277
+func exitStatus(status unix.WaitStatus) int {
278
+	if status.Signaled() {
279
+		return exitSignalOffset + int(status.Signal())
280
+	}
281
+	return status.ExitStatus()
282
+}
0 283
new file mode 100644
... ...
@@ -0,0 +1,39 @@
0
+/*
1
+   Copyright The containerd Authors.
2
+
3
+   Licensed under the Apache License, Version 2.0 (the "License");
4
+   you may not use this file except in compliance with the License.
5
+   You may obtain a copy of the License at
6
+
7
+       http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+   Unless required by applicable law or agreed to in writing, software
10
+   distributed under the License is distributed on an "AS IS" BASIS,
11
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+   See the License for the specific language governing permissions and
13
+   limitations under the License.
14
+*/
15
+
16
+package reaper
17
+
18
+import (
19
+	"unsafe"
20
+
21
+	"golang.org/x/sys/unix"
22
+)
23
+
24
+// SetSubreaper sets the value i as the subreaper setting for the calling process
25
+func SetSubreaper(i int) error {
26
+	return unix.Prctl(unix.PR_SET_CHILD_SUBREAPER, uintptr(i), 0, 0, 0)
27
+}
28
+
29
+// GetSubreaper returns the subreaper setting for the calling process
30
+func GetSubreaper() (int, error) {
31
+	var i uintptr
32
+
33
+	if err := unix.Prctl(unix.PR_GET_CHILD_SUBREAPER, uintptr(unsafe.Pointer(&i)), 0, 0, 0); err != nil {
34
+		return -1, err
35
+	}
36
+
37
+	return int(i), nil
38
+}
... ...
@@ -167,6 +167,7 @@ github.com/containerd/containerd/api/services/leases/v1
167 167
 github.com/containerd/containerd/api/services/namespaces/v1
168 168
 github.com/containerd/containerd/api/services/snapshots/v1
169 169
 github.com/containerd/containerd/api/services/tasks/v1
170
+github.com/containerd/containerd/api/services/ttrpc/events/v1
170 171
 github.com/containerd/containerd/api/services/version/v1
171 172
 github.com/containerd/containerd/api/types
172 173
 github.com/containerd/containerd/api/types/task
... ...
@@ -204,6 +205,8 @@ github.com/containerd/containerd/pkg/cap
204 204
 github.com/containerd/containerd/pkg/dialer
205 205
 github.com/containerd/containerd/pkg/kmutex
206 206
 github.com/containerd/containerd/pkg/seccomp
207
+github.com/containerd/containerd/pkg/shutdown
208
+github.com/containerd/containerd/pkg/ttrpcutil
207 209
 github.com/containerd/containerd/pkg/userns
208 210
 github.com/containerd/containerd/platforms
209 211
 github.com/containerd/containerd/plugin
... ...
@@ -217,6 +220,8 @@ github.com/containerd/containerd/remotes/errors
217 217
 github.com/containerd/containerd/rootfs
218 218
 github.com/containerd/containerd/runtime/linux/runctypes
219 219
 github.com/containerd/containerd/runtime/v2/runc/options
220
+github.com/containerd/containerd/runtime/v2/shim
221
+github.com/containerd/containerd/runtime/v2/task
220 222
 github.com/containerd/containerd/services
221 223
 github.com/containerd/containerd/services/content/contentserver
222 224
 github.com/containerd/containerd/services/introspection
... ...
@@ -224,6 +229,7 @@ github.com/containerd/containerd/services/server/config
224 224
 github.com/containerd/containerd/snapshots
225 225
 github.com/containerd/containerd/snapshots/proxy
226 226
 github.com/containerd/containerd/sys
227
+github.com/containerd/containerd/sys/reaper
227 228
 github.com/containerd/containerd/version
228 229
 # github.com/containerd/continuity v0.3.0
229 230
 ## explicit; go 1.17