File: shim.proto

package info (click to toggle)
containerd 2.1.4~ds2-5
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 21,772 kB
  • sloc: sh: 1,885; makefile: 591
file content (201 lines) | stat: -rw-r--r-- 4,580 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/*
	Copyright The containerd Authors.

	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

		http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
*/

syntax = "proto3";

package containerd.task.v2;

import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "github.com/containerd/containerd/api/types/mount.proto";
import "github.com/containerd/containerd/api/types/task/task.proto";

option go_package = "github.com/containerd/containerd/api/runtime/task/v2;task";

// Shim service is launched for each container and is responsible for owning the IO
// for the container and its additional processes.  The shim is also the parent of
// each container and allows reattaching to the IO and receiving the exit status
// for the container processes.
service Task {
	rpc State(StateRequest) returns (StateResponse);
	rpc Create(CreateTaskRequest) returns (CreateTaskResponse);
	rpc Start(StartRequest) returns (StartResponse);
	rpc Delete(DeleteRequest) returns (DeleteResponse);
	rpc Pids(PidsRequest) returns (PidsResponse);
	rpc Pause(PauseRequest) returns (google.protobuf.Empty);
	rpc Resume(ResumeRequest) returns (google.protobuf.Empty);
	rpc Checkpoint(CheckpointTaskRequest) returns (google.protobuf.Empty);
	rpc Kill(KillRequest) returns (google.protobuf.Empty);
	rpc Exec(ExecProcessRequest) returns (google.protobuf.Empty);
	rpc ResizePty(ResizePtyRequest) returns (google.protobuf.Empty);
	rpc CloseIO(CloseIORequest) returns (google.protobuf.Empty);
	rpc Update(UpdateTaskRequest) returns (google.protobuf.Empty);
	rpc Wait(WaitRequest) returns (WaitResponse);
	rpc Stats(StatsRequest) returns (StatsResponse);
	rpc Connect(ConnectRequest) returns (ConnectResponse);
	rpc Shutdown(ShutdownRequest) returns (google.protobuf.Empty);
}

message CreateTaskRequest {
	string id = 1;
	string bundle = 2;
	repeated containerd.types.Mount rootfs = 3;
	bool terminal = 4;
	string stdin = 5;
	string stdout = 6;
	string stderr = 7;
	string checkpoint = 8;
	string parent_checkpoint = 9;
	google.protobuf.Any options = 10;
}

message CreateTaskResponse {
	uint32 pid = 1;
}

message DeleteRequest {
	string id = 1;
	string exec_id = 2;
}

message DeleteResponse {
	uint32 pid = 1;
	uint32 exit_status = 2;
	google.protobuf.Timestamp exited_at = 3;
}

message ExecProcessRequest {
	string id = 1;
	string exec_id = 2;
	bool terminal = 3;
	string stdin = 4;
	string stdout = 5;
	string stderr = 6;
	google.protobuf.Any spec = 7;
}

message ExecProcessResponse {
}

message ResizePtyRequest {
	string id = 1;
	string exec_id = 2;
	uint32 width = 3;
	uint32 height = 4;
}

message StateRequest {
	string id = 1;
	string exec_id = 2;
}

message StateResponse {
	string id = 1;
	string bundle = 2;
	uint32 pid = 3;
	containerd.v1.types.Status status = 4;
	string stdin = 5;
	string stdout = 6;
	string stderr = 7;
	bool terminal = 8;
	uint32 exit_status = 9;
	google.protobuf.Timestamp exited_at = 10;
	string exec_id = 11;
}

message KillRequest {
	string id = 1;
	string exec_id = 2;
	uint32 signal = 3;
	bool all = 4;
}

message CloseIORequest {
	string id = 1;
	string exec_id = 2;
	bool stdin = 3;
}

message PidsRequest {
	string id = 1;
}

message PidsResponse {
	repeated containerd.v1.types.ProcessInfo processes = 1;
}

message CheckpointTaskRequest {
	string id = 1;
	string path = 2;
	google.protobuf.Any options = 3;
}

message UpdateTaskRequest {
	string id = 1;
	google.protobuf.Any resources = 2;
	map<string, string> annotations = 3;
}

message StartRequest {
	string id = 1;
	string exec_id = 2;
}

message StartResponse {
	uint32 pid = 1;
}

message WaitRequest {
	string id = 1;
	string exec_id = 2;
}

message WaitResponse {
	uint32 exit_status = 1;
	google.protobuf.Timestamp exited_at = 2;
}

message StatsRequest {
	string id = 1;
}

message StatsResponse {
	google.protobuf.Any stats = 1;
}

message ConnectRequest {
	string id = 1;
}

message ConnectResponse {
	uint32 shim_pid = 1;
	uint32 task_pid = 2;
	string version = 3;
}

message ShutdownRequest {
	string id = 1;
	bool now = 2;
}

message PauseRequest {
	string id = 1;
}

message ResumeRequest {
	string id = 1;
}