2017-06-06 18:01:18 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2018-02-27 07:06:01 +00:00
|
|
|
// Package pb provides the protobuf definition of LLB: low-level builder instruction.
|
|
|
|
// LLB is DAG-structured; Op represents a vertex, and Definition represents a graph.
|
2017-06-06 18:01:18 +00:00
|
|
|
package pb;
|
|
|
|
|
2017-06-21 21:48:21 +00:00
|
|
|
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
|
|
|
|
2018-02-27 07:06:01 +00:00
|
|
|
// Op represents a vertex of the LLB DAG.
|
2017-06-06 18:01:18 +00:00
|
|
|
message Op {
|
2018-02-27 07:06:01 +00:00
|
|
|
// inputs is a set of input edges.
|
2017-06-09 01:16:19 +00:00
|
|
|
repeated Input inputs = 1;
|
2017-06-06 18:01:18 +00:00
|
|
|
oneof op {
|
|
|
|
ExecOp exec = 2;
|
|
|
|
SourceOp source = 3;
|
|
|
|
CopyOp copy = 4;
|
2017-07-21 17:58:24 +00:00
|
|
|
BuildOp build = 5;
|
2017-06-06 18:01:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-27 07:06:01 +00:00
|
|
|
// Input represents an input edge for an Op.
|
2017-06-09 01:16:19 +00:00
|
|
|
message Input {
|
2018-02-27 07:06:01 +00:00
|
|
|
// digest of the marshaled input Op
|
2017-06-21 21:48:21 +00:00
|
|
|
string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
|
2018-02-27 07:06:01 +00:00
|
|
|
// output index of the input Op
|
2017-07-21 17:58:24 +00:00
|
|
|
int64 index = 2 [(gogoproto.customtype) = "OutputIndex", (gogoproto.nullable) = false];
|
2017-06-09 01:16:19 +00:00
|
|
|
}
|
|
|
|
|
2018-02-27 07:06:01 +00:00
|
|
|
// ExecOp executes a command in a container.
|
2017-06-06 18:01:18 +00:00
|
|
|
message ExecOp {
|
|
|
|
Meta meta = 1;
|
|
|
|
repeated Mount mounts = 2;
|
|
|
|
}
|
|
|
|
|
2018-02-27 07:06:01 +00:00
|
|
|
// Meta is a set of arguments for ExecOp.
|
2017-10-02 04:59:34 +00:00
|
|
|
// Meta is unrelated to LLB metadata.
|
|
|
|
// FIXME: rename (ExecContext? ExecArgs?)
|
2017-06-06 18:01:18 +00:00
|
|
|
message Meta {
|
|
|
|
repeated string args = 1;
|
|
|
|
repeated string env = 2;
|
|
|
|
string cwd = 3;
|
2017-12-11 21:17:07 +00:00
|
|
|
string user = 4;
|
2017-06-06 18:01:18 +00:00
|
|
|
}
|
|
|
|
|
2018-02-27 07:06:01 +00:00
|
|
|
// Mount specifies how to mount an input Op as a filesystem.
|
2017-06-06 18:01:18 +00:00
|
|
|
message Mount {
|
2017-07-21 17:58:24 +00:00
|
|
|
int64 input = 1 [(gogoproto.customtype) = "InputIndex", (gogoproto.nullable) = false];
|
2017-06-06 18:01:18 +00:00
|
|
|
string selector = 2;
|
|
|
|
string dest = 3;
|
2017-07-21 17:58:24 +00:00
|
|
|
int64 output = 4 [(gogoproto.customtype) = "OutputIndex", (gogoproto.nullable) = false];
|
2017-07-18 06:08:22 +00:00
|
|
|
bool readonly = 5;
|
2017-06-06 18:01:18 +00:00
|
|
|
}
|
|
|
|
|
2018-02-27 07:06:01 +00:00
|
|
|
// CopyOp copies files across Ops.
|
2017-06-06 18:01:18 +00:00
|
|
|
message CopyOp {
|
|
|
|
repeated CopySource src = 1;
|
|
|
|
string dest = 2;
|
|
|
|
}
|
|
|
|
|
2018-02-27 07:06:01 +00:00
|
|
|
// CopySource specifies a source for CopyOp.
|
2017-06-06 18:01:18 +00:00
|
|
|
message CopySource {
|
2017-07-21 17:58:24 +00:00
|
|
|
int64 input = 1 [(gogoproto.customtype) = "InputIndex", (gogoproto.nullable) = false];
|
2017-06-06 18:01:18 +00:00
|
|
|
string selector = 2;
|
|
|
|
}
|
|
|
|
|
2018-02-27 07:06:01 +00:00
|
|
|
// SourceOp specifies a source such as build contexts and images.
|
2017-06-06 18:01:18 +00:00
|
|
|
message SourceOp {
|
2018-02-27 07:06:01 +00:00
|
|
|
// TODO: use source type or any type instead of URL protocol.
|
|
|
|
// identifier e.g. local://, docker-image://, git://, https://...
|
2017-06-06 18:01:18 +00:00
|
|
|
string identifier = 1;
|
2018-02-27 07:06:01 +00:00
|
|
|
// attrs are defined in attr.go
|
2017-07-08 23:25:07 +00:00
|
|
|
map<string, string> attrs = 2;
|
2017-06-06 18:01:18 +00:00
|
|
|
}
|
2017-07-21 17:58:24 +00:00
|
|
|
|
2018-02-27 07:06:01 +00:00
|
|
|
// BuildOp is used for nested build invocation.
|
2017-07-21 17:58:24 +00:00
|
|
|
message BuildOp {
|
|
|
|
int64 builder = 1 [(gogoproto.customtype) = "InputIndex", (gogoproto.nullable) = false];
|
|
|
|
map<string, BuildInput> inputs = 2;
|
2017-10-02 04:59:34 +00:00
|
|
|
Definition def = 3;
|
2017-07-21 17:58:24 +00:00
|
|
|
map<string, string> attrs = 4;
|
|
|
|
// outputs
|
|
|
|
}
|
|
|
|
|
2018-02-27 07:06:01 +00:00
|
|
|
// BuildInput is used for BuildOp.
|
2017-07-21 17:58:24 +00:00
|
|
|
message BuildInput {
|
|
|
|
int64 input = 1 [(gogoproto.customtype) = "InputIndex", (gogoproto.nullable) = false];
|
2017-10-02 04:59:34 +00:00
|
|
|
}
|
|
|
|
|
2018-02-27 07:06:01 +00:00
|
|
|
// OpMetadata is a per-vertex metadata entry, which can be defined for arbitrary Op vertex and overridable on the run time.
|
2017-10-02 04:59:34 +00:00
|
|
|
message OpMetadata {
|
2018-02-27 07:06:01 +00:00
|
|
|
// ignore_cache specifies to ignore the cache for this Op.
|
2017-10-02 04:59:34 +00:00
|
|
|
bool ignore_cache = 1;
|
2017-12-08 00:13:50 +00:00
|
|
|
// Description can be used for keeping any text fields that builder doesn't parse
|
|
|
|
map<string, string> description = 2;
|
2017-11-21 08:08:36 +00:00
|
|
|
WorkerConstraint worker_constraint = 3;
|
|
|
|
}
|
|
|
|
|
2017-12-19 09:34:34 +00:00
|
|
|
// WorkerConstraint is experimental and likely to be changed.
|
2017-11-21 08:08:36 +00:00
|
|
|
message WorkerConstraint {
|
2017-12-19 09:34:34 +00:00
|
|
|
repeated string filter = 1; // containerd-style filter
|
2017-10-02 04:59:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Definition is the LLB definition structure with per-vertex metadata entries
|
|
|
|
message Definition {
|
2018-02-27 07:06:01 +00:00
|
|
|
// def is a list of marshaled Op messages
|
2017-10-02 04:59:34 +00:00
|
|
|
repeated bytes def = 1;
|
2018-02-27 07:06:01 +00:00
|
|
|
// 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.
|
2017-10-02 04:59:34 +00:00
|
|
|
map<string, OpMetadata> metadata = 2 [(gogoproto.castkey) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
|
|
|
|
}
|