83 lines
2.1 KiB
Protocol Buffer
83 lines
2.1 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package pb;
|
|
|
|
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
|
|
|
message Op {
|
|
repeated Input inputs = 1;
|
|
oneof op {
|
|
ExecOp exec = 2;
|
|
SourceOp source = 3;
|
|
CopyOp copy = 4;
|
|
BuildOp build = 5;
|
|
}
|
|
}
|
|
|
|
message Input {
|
|
string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
|
|
int64 index = 2 [(gogoproto.customtype) = "OutputIndex", (gogoproto.nullable) = false];
|
|
}
|
|
|
|
message ExecOp {
|
|
Meta meta = 1;
|
|
repeated Mount mounts = 2;
|
|
}
|
|
|
|
// Meta is unrelated to LLB metadata.
|
|
// FIXME: rename (ExecContext? ExecArgs?)
|
|
message Meta {
|
|
repeated string args = 1;
|
|
repeated string env = 2;
|
|
string cwd = 3;
|
|
}
|
|
|
|
message Mount {
|
|
int64 input = 1 [(gogoproto.customtype) = "InputIndex", (gogoproto.nullable) = false];
|
|
string selector = 2;
|
|
string dest = 3;
|
|
int64 output = 4 [(gogoproto.customtype) = "OutputIndex", (gogoproto.nullable) = false];
|
|
bool readonly = 5;
|
|
}
|
|
|
|
message CopyOp {
|
|
repeated CopySource src = 1;
|
|
string dest = 2;
|
|
}
|
|
|
|
message CopySource {
|
|
int64 input = 1 [(gogoproto.customtype) = "InputIndex", (gogoproto.nullable) = false];
|
|
string selector = 2;
|
|
}
|
|
|
|
message SourceOp {
|
|
// source type?
|
|
string identifier = 1;
|
|
map<string, string> attrs = 2;
|
|
}
|
|
|
|
message BuildOp {
|
|
int64 builder = 1 [(gogoproto.customtype) = "InputIndex", (gogoproto.nullable) = false];
|
|
map<string, BuildInput> inputs = 2;
|
|
Definition def = 3;
|
|
map<string, string> attrs = 4;
|
|
// outputs
|
|
}
|
|
|
|
message BuildInput {
|
|
int64 input = 1 [(gogoproto.customtype) = "InputIndex", (gogoproto.nullable) = false];
|
|
}
|
|
|
|
// 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;
|
|
// TODO: add worker constraint, etc.
|
|
}
|
|
|
|
// 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];
|
|
}
|