Skip to content

Commit

Permalink
Merge pull request #482 from fussybeaver/ND/protobuf-0.5.0
Browse files Browse the repository at this point in the history
Fix 0.18.0 protobuf issue and release 0.18.1
  • Loading branch information
fussybeaver authored Nov 19, 2024
2 parents a543548 + 4c752df commit 9126afa
Show file tree
Hide file tree
Showing 26 changed files with 482 additions and 327 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bollard"
description = "An asynchronous Docker daemon API"
version = "0.18.0"
version = "0.18.1"
authors = [ "Bollard contributors" ]
license = "Apache-2.0"
homepage = "https://github.com/fussybeaver/bollard"
Expand Down Expand Up @@ -46,8 +46,8 @@ pipe = ["hyperlocal", "hyper-named-pipe"]

[dependencies]
base64 = "0.22"
bollard-stubs = { version = "=1.47.0-rc.27.3.1", default-features = false }
bollard-buildkit-proto = { path = "codegen/proto", version = "=0.4.0", optional = true }
bollard-stubs = { version = "=1.47.1-rc.27.3.1", default-features = false }
bollard-buildkit-proto = { path = "codegen/proto", version = "=0.5.0", optional = true }
bytes = "1"
chrono = { version = "0.4", default-features = false, features = ["std", "clock", "serde"], optional = true }
futures-core = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion codegen/proto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bollard-buildkit-proto"
description = "Protobuf definitions to interact with buildkit using Bollard"
version = "0.4.0"
version = "0.5.0"
authors = [ "Bollard contributors" ]
license = "Apache-2.0"
repository = "https://github.com/fussybeaver/bollard"
Expand Down
6 changes: 4 additions & 2 deletions codegen/proto/resources/fsutil/types/stat.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ syntax = "proto3";

package fsutil.types;

option go_package = "types";
option go_package = "github.com/tonistiigi/fsutil/types";

import "vtproto/vtproto/ext.proto";

message Stat {
string path = 1;
Expand All @@ -16,4 +18,4 @@ message Stat {
int64 devmajor = 8;
int64 devminor = 9;
map<string, bytes> xattrs = 10;
}
}
16 changes: 9 additions & 7 deletions codegen/proto/resources/fsutil/types/wire.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ syntax = "proto3";

package fsutil.types;

option go_package = "types";
option go_package = "github.com/tonistiigi/fsutil/types";

import "vtproto/vtproto/ext.proto";
import "fsutil/types/stat.proto";

message Packet {
option (vtproto.mempool) = true;
enum PacketType {
PACKET_STAT = 0;
PACKET_REQ = 1;
PACKET_DATA = 2;
PACKET_FIN = 3;
PACKET_ERR = 4;
}
PACKET_STAT = 0;
PACKET_REQ = 1;
PACKET_DATA = 2;
PACKET_FIN = 3;
PACKET_ERR = 4;
}
PacketType type = 1;
Stat stat = 2;
uint32 ID = 3;
Expand Down
51 changes: 46 additions & 5 deletions codegen/proto/resources/google/protobuf/descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ option optimize_for = SPEED;
// files it parses.
message FileDescriptorSet {
repeated FileDescriptorProto file = 1;

// Extensions for tooling.
extensions 536000000 [declaration = {
number: 536000000
type: ".buf.descriptor.v1.FileDescriptorSetExtension"
full_name: ".buf.descriptor.v1.buf_file_descriptor_set_extension"
}];
}

// The full set of known editions.
Expand All @@ -80,7 +87,7 @@ enum Edition {
EDITION_2024 = 1001;

// Placeholder editions for testing feature resolution. These should not be
// used or relyed on outside of tests.
// used or relied on outside of tests.
EDITION_1_TEST_ONLY = 1;
EDITION_2_TEST_ONLY = 2;
EDITION_99997_TEST_ONLY = 99997;
Expand Down Expand Up @@ -124,9 +131,15 @@ message FileDescriptorProto {
// The supported values are "proto2", "proto3", and "editions".
//
// If `edition` is present, this value must be "editions".
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional string syntax = 12;

// The edition of the proto file.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional Edition edition = 14;
}

Expand Down Expand Up @@ -539,6 +552,9 @@ message FileOptions {
optional string ruby_package = 45;

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 50;

// The parser stores options it doesn't recognize here.
Expand Down Expand Up @@ -625,6 +641,9 @@ message MessageOptions {
optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 12;

// The parser stores options it doesn't recognize here. See above.
Expand Down Expand Up @@ -732,8 +751,6 @@ message FieldOptions {
optional bool debug_redact = 16 [default = false];

// If set to RETENTION_SOURCE, the option will be omitted from the binary.
// Note: as of January 2023, support for this is in progress and does not yet
// have an effect (b/264593489).
enum OptionRetention {
RETENTION_UNKNOWN = 0;
RETENTION_RUNTIME = 1;
Expand All @@ -744,8 +761,7 @@ message FieldOptions {

// This indicates the types of entities that the field may apply to when used
// as an option. If it is unset, then the field may be freely used as an
// option on any kind of entity. Note: as of January 2023, support for this is
// in progress and does not yet have an effect (b/264593489).
// option on any kind of entity.
enum OptionTargetType {
TARGET_TYPE_UNKNOWN = 0;
TARGET_TYPE_FILE = 1;
Expand All @@ -768,6 +784,9 @@ message FieldOptions {
repeated EditionDefault edition_defaults = 20;

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 21;

// Information about the support window of a feature.
Expand Down Expand Up @@ -804,6 +823,9 @@ message FieldOptions {

message OneofOptions {
// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 1;

// The parser stores options it doesn't recognize here. See above.
Expand Down Expand Up @@ -836,6 +858,9 @@ message EnumOptions {
optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 7;

// The parser stores options it doesn't recognize here. See above.
Expand All @@ -853,6 +878,9 @@ message EnumValueOptions {
optional bool deprecated = 1 [default = false];

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 2;

// Indicate that fields annotated with this enum value should not be printed
Expand All @@ -873,6 +901,9 @@ message EnumValueOptions {
message ServiceOptions {

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 34;

// Note: Field numbers 1 through 32 are reserved for Google's internal RPC
Expand Down Expand Up @@ -918,6 +949,9 @@ message MethodOptions {
[default = IDEMPOTENCY_UNKNOWN];

// Any features defined in the specific edition.
// WARNING: This field should only be used by protobuf plugins or special
// cases like the proto compiler. Other uses are discouraged and
// developers should rely on the protoreflect APIs for their client language.
optional FeatureSet features = 35;

// The parser stores options it doesn't recognize here. See above.
Expand Down Expand Up @@ -1255,6 +1289,13 @@ message SourceCodeInfo {
optional string trailing_comments = 4;
repeated string leading_detached_comments = 6;
}

// Extensions for tooling.
extensions 536000000 [declaration = {
number: 536000000
type: ".buf.descriptor.v1.SourceCodeInfoExtension"
full_name: ".buf.descriptor.v1.buf_source_code_info_extension"
}];
}

// Describes the relationship between generated code and its original source
Expand Down
52 changes: 26 additions & 26 deletions codegen/proto/resources/moby/buildkit/v1/control.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ syntax = "proto3";

package moby.buildkit.v1;

option go_package = "github.com/moby/buildkit/api/services/control;moby_buildkit_v1";

// import "github.com/containerd/containerd/api/types/descriptor.proto";
import "google/rpc/status.proto";
import "gogoproto/gogo.proto";
import "moby/buildkit/v1/types/worker.proto";
import "pb/ops.proto";
import "moby/buildkit/v1/sourcepolicy/policy.proto";
import "google/protobuf/timestamp.proto";

option (gogoproto.sizer_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
import "google/rpc/status.proto";

service Control {
rpc DiskUsage(DiskUsageRequest) returns (DiskUsageResponse);
Expand All @@ -30,8 +27,11 @@ service Control {
message PruneRequest {
repeated string filter = 1;
bool all = 2;
int64 keepDuration = 3 [(gogoproto.nullable) = true];
int64 keepBytes = 4 [(gogoproto.nullable) = true];
int64 keepDuration = 3;

int64 reservedSpace = 4;
int64 maxUsedSpace = 5;
int64 minFreeSpace = 6;
}

message DiskUsageRequest {
Expand All @@ -48,8 +48,8 @@ message UsageRecord {
bool InUse = 3;
int64 Size = 4;
string Parent = 5 [deprecated=true];
google.protobuf.Timestamp CreatedAt = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
google.protobuf.Timestamp LastUsedAt = 7 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp CreatedAt = 6;
google.protobuf.Timestamp LastUsedAt = 7;
int64 UsageCount = 8;
string Description = 9;
string RecordType = 10;
Expand All @@ -68,8 +68,8 @@ message SolveRequest {
string Session = 5;
string Frontend = 6;
map<string, string> FrontendAttrs = 7;
CacheOptions Cache = 8 [(gogoproto.nullable) = false];
repeated string Entitlements = 9 [(gogoproto.customtype) = "github.com/moby/buildkit/util/entitlements.Entitlement" ];
CacheOptions Cache = 8;
repeated string Entitlements = 9;
map<string, pb.Definition> FrontendInputs = 10;
bool Internal = 11; // Internal builds are not recorded in build history
moby.buildkit.v1.sourcepolicy.Policy SourcePolicy = 12;
Expand Down Expand Up @@ -120,36 +120,36 @@ message StatusResponse {
}

message Vertex {
string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
repeated string inputs = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
string digest = 1;
repeated string inputs = 2;
string name = 3;
bool cached = 4;
google.protobuf.Timestamp started = 5 [(gogoproto.stdtime) = true ];
google.protobuf.Timestamp completed = 6 [(gogoproto.stdtime) = true ];
google.protobuf.Timestamp started = 5;
google.protobuf.Timestamp completed = 6;
string error = 7; // typed errors?
pb.ProgressGroup progressGroup = 8;
}

message VertexStatus {
string ID = 1;
string vertex = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
string vertex = 2;
string name = 3;
int64 current = 4;
int64 total = 5;
google.protobuf.Timestamp timestamp = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
google.protobuf.Timestamp started = 7 [(gogoproto.stdtime) = true ];
google.protobuf.Timestamp completed = 8 [(gogoproto.stdtime) = true ];
google.protobuf.Timestamp timestamp = 6;
google.protobuf.Timestamp started = 7;
google.protobuf.Timestamp completed = 8;
}

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

message VertexWarning {
string vertex = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
string vertex = 1;
int64 level = 2;
bytes short = 3;
repeated bytes detail = 4;
Expand Down Expand Up @@ -199,8 +199,8 @@ message BuildHistoryRecord {
map<string, string> FrontendAttrs = 3;
repeated Exporter Exporters = 4;
google.rpc.Status error = 5;
google.protobuf.Timestamp CreatedAt = 6 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp CompletedAt = 7 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp CreatedAt = 6;
google.protobuf.Timestamp CompletedAt = 7;
Descriptor logs = 8;
map<string, string> ExporterResponse = 9;
BuildResultInfo Result = 10;
Expand Down Expand Up @@ -228,7 +228,7 @@ message UpdateBuildHistoryResponse {}

message Descriptor {
string media_type = 1;
string digest = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
string digest = 2;
int64 size = 3;
map<string, string> annotations = 5;
}
Expand Down
2 changes: 1 addition & 1 deletion codegen/proto/resources/moby/buildkit/v1/secrets.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package moby.buildkit.secrets.v1;

option go_package = "secrets";
option go_package = "github.com/moby/buildkit/session/secrets";

service Secrets{
rpc GetSecret(GetSecretRequest) returns (GetSecretResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ syntax = "proto3";

package moby.buildkit.v1.sourcepolicy;

option go_package = "github.com/moby/buildkit/sourcepolicy/pb;moby_buildkit_v1_sourcepolicy";

// Rule defines the action(s) to take when a source is matched
message Rule {
PolicyAction action = 1;
Expand Down Expand Up @@ -61,4 +63,4 @@ enum MatchType {
// REGEX treats the source identifier as a regular expression
// With regex matching you can also use match groups to replace values in the destination identifier
REGEX = 2;
}
}
4 changes: 2 additions & 2 deletions codegen/proto/resources/moby/buildkit/v1/ssh.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package moby.sshforward.v1;

option go_package = "sshforward";
option go_package = "github.com/moby/buildkit/session/sshforward";

service SSH {
rpc CheckAgent(CheckAgentRequest) returns (CheckAgentResponse);
Expand All @@ -19,4 +19,4 @@ message CheckAgentRequest {
}

message CheckAgentResponse {
}
}
Loading

0 comments on commit 9126afa

Please sign in to comment.