2017-06-06 18:01:18 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package pb;
|
|
|
|
|
2017-06-21 21:48:21 +00:00
|
|
|
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
|
|
|
|
2017-06-06 18:01:18 +00:00
|
|
|
message Op {
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-09 01:16:19 +00:00
|
|
|
message Input {
|
2017-06-21 21:48:21 +00:00
|
|
|
string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
|
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
|
|
|
}
|
|
|
|
|
2017-06-06 18:01:18 +00:00
|
|
|
message ExecOp {
|
|
|
|
Meta meta = 1;
|
|
|
|
repeated Mount mounts = 2;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
message CopyOp {
|
|
|
|
repeated CopySource src = 1;
|
|
|
|
string dest = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SourceOp {
|
2017-07-08 23:25:07 +00:00
|
|
|
// source type?
|
2017-06-06 18:01:18 +00:00
|
|
|
string identifier = 1;
|
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
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
message BuildInput {
|
|
|
|
int64 input = 1 [(gogoproto.customtype) = "InputIndex", (gogoproto.nullable) = false];
|
2017-10-02 04:59:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// OpMetadata is a per-vertex metadata entry, which can be defined for arbitrary Op vertex by both "script" and build client (e.g. buildctl).
|
|
|
|
message OpMetadata {
|
|
|
|
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 {
|
|
|
|
repeated bytes def = 1;
|
|
|
|
// key = LLB op digest string. Currently, empty string is not expected but may change in the future.
|
|
|
|
map<string, OpMetadata> metadata = 2 [(gogoproto.castkey) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
|
|
|
|
}
|