Skip to content

Commit 665e7c3

Browse files
committed
protobuf: remove gogoproto
Remove gogoproto in favor of the standard protobuf compiler and use vtproto to supplement the standard protobuf compiler. This removes any nonstandard extensions that were part of gogoproto such as the custom types. vtproto is an extra protobuf compiler that generates special methods suffixed with `VT` that create typed and unrolled marshal and unmarshal functions similar to gogo that can be used for performance sensitive code. These extensions are optional for code to use but buildkit uses them. A codec is also included to utilize vtproto for grpc code. If the package `github.com/moby/buildkit/util/encoding/proto` is imported then vtproto will be used if it exists and otherwise it will use the standard marshaling and unmarshaling methods. Signed-off-by: Jonathan A. Sternberg <[email protected]>
1 parent e15601a commit 665e7c3

File tree

364 files changed

+111656
-74994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

364 files changed

+111656
-74994
lines changed

api/services/control/control.pb.go

+2,289-10,633
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/services/control/control.proto

+23-26
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@ syntax = "proto3";
22

33
package moby.buildkit.v1;
44

5+
option go_package = "github.com/moby/buildkit/api/services/control;moby_buildkit_v1";
6+
57
// import "github.com/containerd/containerd/api/types/descriptor.proto";
6-
import "github.com/gogo/googleapis/google/rpc/status.proto";
7-
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
88
import "github.com/moby/buildkit/api/types/worker.proto";
99
import "github.com/moby/buildkit/solver/pb/ops.proto";
1010
import "github.com/moby/buildkit/sourcepolicy/pb/policy.proto";
1111
import "google/protobuf/timestamp.proto";
12-
13-
option (gogoproto.sizer_all) = true;
14-
option (gogoproto.marshaler_all) = true;
15-
option (gogoproto.unmarshaler_all) = true;
12+
import "google/rpc/status.proto";
1613

1714
service Control {
1815
rpc DiskUsage(DiskUsageRequest) returns (DiskUsageResponse);
@@ -30,8 +27,8 @@ service Control {
3027
message PruneRequest {
3128
repeated string filter = 1;
3229
bool all = 2;
33-
int64 keepDuration = 3 [(gogoproto.nullable) = true];
34-
int64 keepBytes = 4 [(gogoproto.nullable) = true];
30+
int64 keepDuration = 3;
31+
int64 keepBytes = 4;
3532
}
3633

3734
message DiskUsageRequest {
@@ -48,8 +45,8 @@ message UsageRecord {
4845
bool InUse = 3;
4946
int64 Size = 4;
5047
string Parent = 5 [deprecated=true];
51-
google.protobuf.Timestamp CreatedAt = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
52-
google.protobuf.Timestamp LastUsedAt = 7 [(gogoproto.stdtime) = true];
48+
google.protobuf.Timestamp CreatedAt = 6;
49+
google.protobuf.Timestamp LastUsedAt = 7;
5350
int64 UsageCount = 8;
5451
string Description = 9;
5552
string RecordType = 10;
@@ -68,8 +65,8 @@ message SolveRequest {
6865
string Session = 5;
6966
string Frontend = 6;
7067
map<string, string> FrontendAttrs = 7;
71-
CacheOptions Cache = 8 [(gogoproto.nullable) = false];
72-
repeated string Entitlements = 9 [(gogoproto.customtype) = "github.com/moby/buildkit/util/entitlements.Entitlement" ];
68+
CacheOptions Cache = 8;
69+
repeated string Entitlements = 9;
7370
map<string, pb.Definition> FrontendInputs = 10;
7471
bool Internal = 11; // Internal builds are not recorded in build history
7572
moby.buildkit.v1.sourcepolicy.Policy SourcePolicy = 12;
@@ -120,36 +117,36 @@ message StatusResponse {
120117
}
121118

122119
message Vertex {
123-
string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
124-
repeated string inputs = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
120+
string digest = 1;
121+
repeated string inputs = 2;
125122
string name = 3;
126123
bool cached = 4;
127-
google.protobuf.Timestamp started = 5 [(gogoproto.stdtime) = true ];
128-
google.protobuf.Timestamp completed = 6 [(gogoproto.stdtime) = true ];
124+
google.protobuf.Timestamp started = 5;
125+
google.protobuf.Timestamp completed = 6;
129126
string error = 7; // typed errors?
130127
pb.ProgressGroup progressGroup = 8;
131128
}
132129

133130
message VertexStatus {
134131
string ID = 1;
135-
string vertex = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
132+
string vertex = 2;
136133
string name = 3;
137134
int64 current = 4;
138135
int64 total = 5;
139-
google.protobuf.Timestamp timestamp = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
140-
google.protobuf.Timestamp started = 7 [(gogoproto.stdtime) = true ];
141-
google.protobuf.Timestamp completed = 8 [(gogoproto.stdtime) = true ];
136+
google.protobuf.Timestamp timestamp = 6;
137+
google.protobuf.Timestamp started = 7;
138+
google.protobuf.Timestamp completed = 8;
142139
}
143140

144141
message VertexLog {
145-
string vertex = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
146-
google.protobuf.Timestamp timestamp = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
142+
string vertex = 1;
143+
google.protobuf.Timestamp timestamp = 2;
147144
int64 stream = 3;
148145
bytes msg = 4;
149146
}
150147

151148
message VertexWarning {
152-
string vertex = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
149+
string vertex = 1;
153150
int64 level = 2;
154151
bytes short = 3;
155152
repeated bytes detail = 4;
@@ -199,8 +196,8 @@ message BuildHistoryRecord {
199196
map<string, string> FrontendAttrs = 3;
200197
repeated Exporter Exporters = 4;
201198
google.rpc.Status error = 5;
202-
google.protobuf.Timestamp CreatedAt = 6 [(gogoproto.stdtime) = true];
203-
google.protobuf.Timestamp CompletedAt = 7 [(gogoproto.stdtime) = true];
199+
google.protobuf.Timestamp CreatedAt = 6;
200+
google.protobuf.Timestamp CompletedAt = 7;
204201
Descriptor logs = 8;
205202
map<string, string> ExporterResponse = 9;
206203
BuildResultInfo Result = 10;
@@ -228,7 +225,7 @@ message UpdateBuildHistoryResponse {}
228225

229226
message Descriptor {
230227
string media_type = 1;
231-
string digest = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
228+
string digest = 2;
232229
int64 size = 3;
233230
map<string, string> annotations = 5;
234231
}

0 commit comments

Comments
 (0)