Debian Codegraph @

buildkit/frontend/gateway/pb/gateway.proto

raw
1 syntax = "proto3";
2
3 package moby.buildkit.v1.frontend;
4
5 option go_package = "github.com/moby/buildkit/frontend/gateway/pb;moby_buildkit_v1_frontend";
6
7 import "github.com/moby/buildkit/api/types/worker.proto";
8 import "github.com/moby/buildkit/solver/pb/ops.proto";
9 import "github.com/moby/buildkit/sourcepolicy/pb/policy.proto";
10 import "github.com/moby/buildkit/util/apicaps/pb/caps.proto";
11 import "github.com/tonistiigi/fsutil/types/stat.proto";
12 import "google/rpc/status.proto";
13
14 service LLBBridge {
15 // apicaps:CapResolveImage
16 rpc ResolveImageConfig(ResolveImageConfigRequest) returns (ResolveImageConfigResponse);
17 // apicaps:CapSourceMetaResolver
18 rpc ResolveSourceMeta(ResolveSourceMetaRequest) returns (ResolveSourceMetaResponse);
19 // apicaps:CapSolveBase
20 rpc Solve(SolveRequest) returns (SolveResponse);
21 // apicaps:CapReadFile
22 rpc ReadFile(ReadFileRequest) returns (ReadFileResponse);
23 // apicaps:CapReadDir
24 rpc ReadDir(ReadDirRequest) returns (ReadDirResponse);
25 // apicaps:CapStatFile
26 rpc StatFile(StatFileRequest) returns (StatFileResponse);
27 // apicaps:CapGatewayEvaluate
28 rpc Evaluate(EvaluateRequest) returns (EvaluateResponse);
29 rpc Ping(PingRequest) returns (PongResponse);
30 rpc Return(ReturnRequest) returns (ReturnResponse);
31 // apicaps:CapFrontendInputs
32 rpc Inputs(InputsRequest) returns (InputsResponse);
33
34 rpc NewContainer(NewContainerRequest) returns (NewContainerResponse);
35 rpc ReleaseContainer(ReleaseContainerRequest) returns (ReleaseContainerResponse);
36 rpc ExecProcess(stream ExecMessage) returns (stream ExecMessage);
37
38 // apicaps:CapGatewayWarnings
39 rpc Warn(WarnRequest) returns (WarnResponse);
40 }
41
42 message Result {
43 oneof result {
44 // Deprecated non-array refs.
45 string refDeprecated = 1;
46 RefMapDeprecated refsDeprecated = 2;
47
48 Ref ref = 3;
49 RefMap refs = 4;
50 }
51 map<string, bytes> metadata = 10;
52 // 11 was used during development and is reserved for old attestation format
53 map<string, Attestations> attestations = 12;
54 }
55
56 message RefMapDeprecated {
57 map<string, string> refs = 1;
58 }
59
60 message Ref {
61 string id = 1;
62 pb.Definition def = 2;
63 }
64
65 message RefMap {
66 map<string, Ref> refs = 1;
67 }
68
69 message Attestations {
70 repeated Attestation attestation = 1;
71 }
72
73 message Attestation {
74 AttestationKind kind = 1;
75 map<string, bytes> metadata = 2;
76
77 Ref ref = 3;
78 string path = 4;
79 string inTotoPredicateType = 5;
80 repeated InTotoSubject inTotoSubjects = 6;
81 }
82
83 enum AttestationKind {
84 InToto = 0;
85 Bundle = 1;
86 }
87
88 message InTotoSubject {
89 InTotoSubjectKind kind = 1;
90
91 repeated string digest = 2;
92 string name = 3;
93 }
94
95 enum InTotoSubjectKind {
96 Self = 0;
97 Raw = 1;
98 }
99
100 message ReturnRequest {
101 Result result = 1;
102 google.rpc.Status error = 2;
103 }
104
105 message ReturnResponse {
106 }
107
108 message InputsRequest {
109 }
110
111 message InputsResponse {
112 map<string, pb.Definition> Definitions = 1;
113 }
114
115 message ResolveImageConfigRequest {
116 string Ref = 1;
117 pb.Platform Platform = 2;
118 string ResolveMode = 3;
119 string LogName = 4;
120 int32 ResolverType = 5;
121 string SessionID = 6;
122 string StoreID = 7;
123 repeated moby.buildkit.v1.sourcepolicy.Policy SourcePolicies = 8;
124 }
125
126 message ResolveImageConfigResponse {
127 string Digest = 1;
128 bytes Config = 2;
129 string Ref = 3;
130 }
131
132 message ResolveSourceMetaRequest {
133 pb.SourceOp Source = 1;
134 pb.Platform Platform = 2;
135 string LogName = 3;
136 string ResolveMode = 4;
137 repeated moby.buildkit.v1.sourcepolicy.Policy SourcePolicies = 8;
138 }
139
140 message ResolveSourceMetaResponse {
141 pb.SourceOp Source = 1;
142 ResolveSourceImageResponse Image = 2;
143 }
144
145 message ResolveSourceImageResponse {
146 string Digest = 1;
147 bytes Config = 2;
148 }
149
150 message SolveRequest {
151 pb.Definition Definition = 1;
152 string Frontend = 2;
153 map<string, string> FrontendOpt = 3;
154 // 4 was removed in BuildKit v0.11.0.
155 bool allowResultReturn = 5;
156 bool allowResultArrayRef = 6;
157
158 // apicaps.CapSolveInlineReturn deprecated
159 bool Final = 10;
160 bytes ExporterAttr = 11;
161 // CacheImports was added in BuildKit v0.4.0.
162 // apicaps:CapImportCaches
163 repeated CacheOptionsEntry CacheImports = 12;
164
165 // apicaps:CapFrontendInputs
166 map<string, pb.Definition> FrontendInputs = 13;
167
168 bool Evaluate = 14;
169
170 repeated moby.buildkit.v1.sourcepolicy.Policy SourcePolicies = 15;
171 }
172
173 // CacheOptionsEntry corresponds to the control.CacheOptionsEntry
174 message CacheOptionsEntry {
175 string Type = 1;
176 map<string, string> Attrs = 2;
177 }
178
179 message SolveResponse {
180 // deprecated
181 string ref = 1; // can be used by readfile request
182 // deprecated
183 // bytes ExporterAttr = 2;
184
185 // these fields are returned when allowMapReturn was set
186 Result result = 3;
187 }
188
189 message ReadFileRequest {
190 string Ref = 1;
191 string FilePath = 2;
192 FileRange Range = 3;
193 }
194
195 message FileRange {
196 int64 Offset = 1;
197 int64 Length = 2;
198 }
199
200 message ReadFileResponse {
201 bytes Data = 1;
202 }
203
204 message ReadDirRequest {
205 string Ref = 1;
206 string DirPath = 2;
207 string IncludePattern = 3;
208 }
209
210 message ReadDirResponse {
211 repeated fsutil.types.Stat entries = 1;
212 }
213
214 message StatFileRequest {
215 string Ref = 1;
216 string Path = 2;
217 }
218
219 message StatFileResponse {
220 fsutil.types.Stat stat = 1;
221 }
222
223 message EvaluateRequest {
224 string Ref = 1;
225 }
226
227 message EvaluateResponse {
228 }
229
230 message PingRequest{
231 }
232 message PongResponse{
233 repeated moby.buildkit.v1.apicaps.APICap FrontendAPICaps = 1;
234 repeated moby.buildkit.v1.apicaps.APICap LLBCaps = 2;
235 repeated moby.buildkit.v1.types.WorkerRecord Workers = 3;
236 }
237
238 message WarnRequest {
239 string digest = 1;
240 int64 level = 2;
241 bytes short = 3;
242 repeated bytes detail = 4;
243 string url = 5;
244 pb.SourceInfo info = 6;
245 repeated pb.Range ranges = 7;
246 }
247
248 message WarnResponse{}
249
250 message NewContainerRequest {
251 string ContainerID = 1;
252 // For mount input values we can use random identifiers passed with ref
253 repeated pb.Mount Mounts = 2;
254 pb.NetMode Network = 3;
255 pb.Platform platform = 4;
256 pb.WorkerConstraints constraints = 5;
257 repeated pb.HostIP extraHosts = 6;
258 string hostname = 7;
259 }
260
261 message NewContainerResponse{}
262
263 message ReleaseContainerRequest {
264 string ContainerID = 1;
265 }
266
267 message ReleaseContainerResponse{}
268
269 message ExecMessage {
270 string ProcessID = 1;
271 oneof Input {
272 // InitMessage sent from client to server will start a new process in a
273 // container
274 InitMessage Init = 2;
275 // FdMessage used from client to server for input (stdin) and
276 // from server to client for output (stdout, stderr)
277 FdMessage File = 3;
278 // ResizeMessage used from client to server for terminal resize events
279 ResizeMessage Resize = 4;
280 // StartedMessage sent from server to client after InitMessage to
281 // indicate the process has started.
282 StartedMessage Started = 5;
283 // ExitMessage sent from server to client will contain the exit code
284 // when the process ends.
285 ExitMessage Exit = 6;
286 // DoneMessage from server to client will be the last message for any
287 // process. Note that FdMessage might be sent after ExitMessage.
288 DoneMessage Done = 7;
289 // SignalMessage is used from client to server to send signal events
290 SignalMessage Signal = 8;
291 }
292 }
293
294 message InitMessage{
295 string ContainerID = 1;
296 pb.Meta Meta = 2;
297 repeated uint32 Fds = 3;
298 bool Tty = 4;
299 pb.SecurityMode Security = 5;
300 repeated pb.SecretEnv secretenv = 6;
301 }
302
303 message ExitMessage {
304 uint32 Code = 1;
305 google.rpc.Status Error = 2;
306 }
307
308 message StartedMessage{}
309
310 message DoneMessage{}
311
312 message FdMessage{
313 uint32 Fd = 1; // what fd the data was from
314 bool EOF = 2; // true if eof was reached
315 bytes Data = 3;
316 }
317
318 message ResizeMessage{
319 uint32 Rows = 1;
320 uint32 Cols = 2;
321 }
322
323 message SignalMessage {
324 // we only send name (ie HUP, INT) because the int values
325 // are platform dependent.
326 string Name = 1;
327 }