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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
/// Op represents a vertex of the LLB DAG.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Op {
    /// inputs is a set of input edges.
    #[prost(message, repeated, tag="1")]
    pub inputs: ::std::vec::Vec<Input>,
    #[prost(message, optional, tag="10")]
    pub platform: ::std::option::Option<Platform>,
    #[prost(message, optional, tag="11")]
    pub constraints: ::std::option::Option<WorkerConstraints>,
    #[prost(oneof="op::Op", tags="2, 3, 4, 5")]
    pub op: ::std::option::Option<op::Op>,
}
pub mod op {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Op {
        #[prost(message, tag="2")]
        Exec(super::ExecOp),
        #[prost(message, tag="3")]
        Source(super::SourceOp),
        #[prost(message, tag="4")]
        File(super::FileOp),
        #[prost(message, tag="5")]
        Build(super::BuildOp),
    }
}
/// Platform is github.com/opencontainers/image-spec/specs-go/v1.Platform
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Platform {
    #[prost(string, tag="1")]
    pub architecture: std::string::String,
    #[prost(string, tag="2")]
    pub os: std::string::String,
    #[prost(string, tag="3")]
    pub variant: std::string::String,
    /// unused
    #[prost(string, tag="4")]
    pub os_version: std::string::String,
    /// unused
    #[prost(string, repeated, tag="5")]
    pub os_features: ::std::vec::Vec<std::string::String>,
}
/// Input represents an input edge for an Op.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Input {
    /// digest of the marshaled input Op
    #[prost(string, tag="1")]
    pub digest: std::string::String,
    /// output index of the input Op
    #[prost(int64, tag="2")]
    pub index: i64,
}
/// ExecOp executes a command in a container.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecOp {
    #[prost(message, optional, tag="1")]
    pub meta: ::std::option::Option<Meta>,
    #[prost(message, repeated, tag="2")]
    pub mounts: ::std::vec::Vec<Mount>,
    #[prost(enumeration="NetMode", tag="3")]
    pub network: i32,
    #[prost(enumeration="SecurityMode", tag="4")]
    pub security: i32,
}
/// Meta is a set of arguments for ExecOp.
/// Meta is unrelated to LLB metadata.
/// FIXME: rename (ExecContext? ExecArgs?)
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Meta {
    #[prost(string, repeated, tag="1")]
    pub args: ::std::vec::Vec<std::string::String>,
    #[prost(string, repeated, tag="2")]
    pub env: ::std::vec::Vec<std::string::String>,
    #[prost(string, tag="3")]
    pub cwd: std::string::String,
    #[prost(string, tag="4")]
    pub user: std::string::String,
    #[prost(message, optional, tag="5")]
    pub proxy_env: ::std::option::Option<ProxyEnv>,
    #[prost(message, repeated, tag="6")]
    pub extra_hosts: ::std::vec::Vec<HostIp>,
}
/// Mount specifies how to mount an input Op as a filesystem.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Mount {
    #[prost(int64, tag="1")]
    pub input: i64,
    #[prost(string, tag="2")]
    pub selector: std::string::String,
    #[prost(string, tag="3")]
    pub dest: std::string::String,
    #[prost(int64, tag="4")]
    pub output: i64,
    #[prost(bool, tag="5")]
    pub readonly: bool,
    #[prost(enumeration="MountType", tag="6")]
    pub mount_type: i32,
    #[prost(message, optional, tag="20")]
    pub cache_opt: ::std::option::Option<CacheOpt>,
    #[prost(message, optional, tag="21")]
    pub secret_opt: ::std::option::Option<SecretOpt>,
    #[prost(message, optional, tag="22")]
    pub ssh_opt: ::std::option::Option<SshOpt>,
}
/// CacheOpt defines options specific to cache mounts
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CacheOpt {
    /// ID is an optional namespace for the mount
    #[prost(string, tag="1")]
    pub id: std::string::String,
    /// Sharing is the sharing mode for the mount 
    #[prost(enumeration="CacheSharingOpt", tag="2")]
    pub sharing: i32,
}
/// SecretOpt defines options describing secret mounts
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SecretOpt {
    /// ID of secret. Used for quering the value.
    #[prost(string, tag="1")]
    pub id: std::string::String,
    /// UID of secret file
    #[prost(uint32, tag="2")]
    pub uid: u32,
    /// GID of secret file
    #[prost(uint32, tag="3")]
    pub gid: u32,
    /// Mode is the filesystem mode of secret file
    #[prost(uint32, tag="4")]
    pub mode: u32,
    /// Optional defines if secret value is required. Error is produced
    /// if value is not found and optional is false.
    #[prost(bool, tag="5")]
    pub optional: bool,
}
/// SSHOpt defines options describing secret mounts
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SshOpt {
    /// ID of exposed ssh rule. Used for quering the value.
    #[prost(string, tag="1")]
    pub id: std::string::String,
    /// UID of agent socket
    #[prost(uint32, tag="2")]
    pub uid: u32,
    /// GID of agent socket
    #[prost(uint32, tag="3")]
    pub gid: u32,
    /// Mode is the filesystem mode of agent socket
    #[prost(uint32, tag="4")]
    pub mode: u32,
    /// Optional defines if ssh socket is required. Error is produced
    /// if client does not expose ssh.
    #[prost(bool, tag="5")]
    pub optional: bool,
}
/// SourceOp specifies a source such as build contexts and images.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourceOp {
    /// TODO: use source type or any type instead of URL protocol.
    /// identifier e.g. local://, docker-image://, git://, https://...
    #[prost(string, tag="1")]
    pub identifier: std::string::String,
    /// attrs are defined in attr.go
    #[prost(map="string, string", tag="2")]
    pub attrs: ::std::collections::HashMap<std::string::String, std::string::String>,
}
/// BuildOp is used for nested build invocation.
/// BuildOp is experimental and can break without backwards compatibility
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BuildOp {
    #[prost(int64, tag="1")]
    pub builder: i64,
    #[prost(map="string, message", tag="2")]
    pub inputs: ::std::collections::HashMap<std::string::String, BuildInput>,
    #[prost(message, optional, tag="3")]
    pub def: ::std::option::Option<Definition>,
    /// outputs
    #[prost(map="string, string", tag="4")]
    pub attrs: ::std::collections::HashMap<std::string::String, std::string::String>,
}
/// BuildInput is used for BuildOp.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BuildInput {
    #[prost(int64, tag="1")]
    pub input: i64,
}
/// OpMetadata is a per-vertex metadata entry, which can be defined for arbitrary Op vertex and overridable on the run time.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpMetadata {
    /// ignore_cache specifies to ignore the cache for this Op.
    #[prost(bool, tag="1")]
    pub ignore_cache: bool,
    /// Description can be used for keeping any text fields that builder doesn't parse
    #[prost(map="string, string", tag="2")]
    pub description: ::std::collections::HashMap<std::string::String, std::string::String>,
    /// index 3 reserved for WorkerConstraint in previous versions
    /// WorkerConstraint worker_constraint = 3;
    #[prost(message, optional, tag="4")]
    pub export_cache: ::std::option::Option<ExportCache>,
    #[prost(map="string, bool", tag="5")]
    pub caps: ::std::collections::HashMap<std::string::String, bool>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportCache {
    #[prost(bool, tag="1")]
    pub value: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProxyEnv {
    #[prost(string, tag="1")]
    pub http_proxy: std::string::String,
    #[prost(string, tag="2")]
    pub https_proxy: std::string::String,
    #[prost(string, tag="3")]
    pub ftp_proxy: std::string::String,
    #[prost(string, tag="4")]
    pub no_proxy: std::string::String,
}
/// WorkerConstraints defines conditions for the worker
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerConstraints {
    /// containerd-style filter
    #[prost(string, repeated, tag="1")]
    pub filter: ::std::vec::Vec<std::string::String>,
}
/// Definition is the LLB definition structure with per-vertex metadata entries
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Definition {
    /// def is a list of marshaled Op messages
    #[prost(bytes, repeated, tag="1")]
    pub def: ::std::vec::Vec<std::vec::Vec<u8>>,
    /// metadata contains metadata for the each of the Op messages.
    /// A key must be an LLB op digest string. Currently, empty string is not expected as a key, but it may change in the future.
    #[prost(map="string, message", tag="2")]
    pub metadata: ::std::collections::HashMap<std::string::String, OpMetadata>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HostIp {
    #[prost(string, tag="1")]
    pub host: std::string::String,
    #[prost(string, tag="2")]
    pub ip: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileOp {
    #[prost(message, repeated, tag="2")]
    pub actions: ::std::vec::Vec<FileAction>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileAction {
    /// could be real input or target (target index + max input index)
    #[prost(int64, tag="1")]
    pub input: i64,
    /// --//--
    #[prost(int64, tag="2")]
    pub secondary_input: i64,
    #[prost(int64, tag="3")]
    pub output: i64,
    #[prost(oneof="file_action::Action", tags="4, 5, 6, 7")]
    pub action: ::std::option::Option<file_action::Action>,
}
pub mod file_action {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Action {
        /// FileActionCopy copies files from secondaryInput on top of input
        #[prost(message, tag="4")]
        Copy(super::FileActionCopy),
        /// FileActionMkFile creates a new file
        #[prost(message, tag="5")]
        Mkfile(super::FileActionMkFile),
        /// FileActionMkDir creates a new directory
        #[prost(message, tag="6")]
        Mkdir(super::FileActionMkDir),
        /// FileActionRm removes a file
        #[prost(message, tag="7")]
        Rm(super::FileActionRm),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileActionCopy {
    /// src is the source path
    #[prost(string, tag="1")]
    pub src: std::string::String,
    /// dest path
    #[prost(string, tag="2")]
    pub dest: std::string::String,
    /// optional owner override
    #[prost(message, optional, tag="3")]
    pub owner: ::std::option::Option<ChownOpt>,
    /// optional permission bits override
    #[prost(int32, tag="4")]
    pub mode: i32,
    /// followSymlink resolves symlinks in src
    #[prost(bool, tag="5")]
    pub follow_symlink: bool,
    /// dirCopyContents only copies contents if src is a directory
    #[prost(bool, tag="6")]
    pub dir_copy_contents: bool,
    /// attemptUnpackDockerCompatibility detects if src is an archive to unpack it instead
    #[prost(bool, tag="7")]
    pub attempt_unpack_docker_compatibility: bool,
    /// createDestPath creates dest path directories if needed
    #[prost(bool, tag="8")]
    pub create_dest_path: bool,
    /// allowWildcard allows filepath.Match wildcards in src path
    #[prost(bool, tag="9")]
    pub allow_wildcard: bool,
    /// allowEmptyWildcard doesn't fail the whole copy if wildcard doesn't resolve to files
    #[prost(bool, tag="10")]
    pub allow_empty_wildcard: bool,
    /// optional created time override
    #[prost(int64, tag="11")]
    pub timestamp: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileActionMkFile {
    /// path for the new file
    #[prost(string, tag="1")]
    pub path: std::string::String,
    /// permission bits
    #[prost(int32, tag="2")]
    pub mode: i32,
    /// data is the new file contents
    #[prost(bytes, tag="3")]
    pub data: std::vec::Vec<u8>,
    /// optional owner for the new file
    #[prost(message, optional, tag="4")]
    pub owner: ::std::option::Option<ChownOpt>,
    /// optional created time override
    #[prost(int64, tag="5")]
    pub timestamp: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileActionMkDir {
    /// path for the new directory
    #[prost(string, tag="1")]
    pub path: std::string::String,
    /// permission bits
    #[prost(int32, tag="2")]
    pub mode: i32,
    /// makeParents creates parent directories as well if needed
    #[prost(bool, tag="3")]
    pub make_parents: bool,
    /// optional owner for the new directory
    #[prost(message, optional, tag="4")]
    pub owner: ::std::option::Option<ChownOpt>,
    /// optional created time override
    #[prost(int64, tag="5")]
    pub timestamp: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileActionRm {
    /// path to remove
    #[prost(string, tag="1")]
    pub path: std::string::String,
    /// allowNotFound doesn't fail the rm if file is not found
    #[prost(bool, tag="2")]
    pub allow_not_found: bool,
    /// allowWildcard allows filepath.Match wildcards in path
    #[prost(bool, tag="3")]
    pub allow_wildcard: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChownOpt {
    #[prost(message, optional, tag="1")]
    pub user: ::std::option::Option<UserOpt>,
    #[prost(message, optional, tag="2")]
    pub group: ::std::option::Option<UserOpt>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserOpt {
    #[prost(oneof="user_opt::User", tags="1, 2")]
    pub user: ::std::option::Option<user_opt::User>,
}
pub mod user_opt {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum User {
        #[prost(message, tag="1")]
        ByName(super::NamedUserOpt),
        #[prost(uint32, tag="2")]
        ById(u32),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NamedUserOpt {
    #[prost(string, tag="1")]
    pub name: std::string::String,
    #[prost(int64, tag="2")]
    pub input: i64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NetMode {
    /// sandbox
    Unset = 0,
    Host = 1,
    None = 2,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SecurityMode {
    Sandbox = 0,
    /// privileged mode
    Insecure = 1,
}
/// MountType defines a type of a mount from a supported set
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MountType {
    Bind = 0,
    Secret = 1,
    Ssh = 2,
    Cache = 3,
    Tmpfs = 4,
}
/// CacheSharingOpt defines different sharing modes for cache mount
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CacheSharingOpt {
    /// SHARED cache mount can be used concurrently by multiple writers
    Shared = 0,
    /// PRIVATE creates a new mount if there are multiple writers
    Private = 1,
    /// LOCKED pauses second writer until first one releases the mount
    Locked = 2,
}