hack: generate vtproto files for buildx

Integrates vtproto into buildx. The generated files dockerfile has been
modified to copy the buildkit equivalent file to ensure files are laid
out in the appropriate way for imports.

An import has also been included to change the grpc codec to the version
in buildkit that supports vtproto. This will allow buildx to utilize the
speed and memory improvements from that.

Also updates the gc control options for prune.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
Jonathan A. Sternberg
2024-10-08 13:35:06 -05:00
parent d353f5f6ba
commit 64c5139ab6
109 changed files with 68070 additions and 2941 deletions

View File

@ -67,6 +67,7 @@ const (
CapFileCopyIncludeExcludePatterns apicaps.CapID = "file.copy.includeexcludepatterns"
CapFileRmNoFollowSymlink apicaps.CapID = "file.rm.nofollowsymlink"
CapFileCopyAlwaysReplaceExistingDestPaths apicaps.CapID = "file.copy.alwaysreplaceexistingdestpaths"
CapFileCopyModeStringFormat apicaps.CapID = "file.copy.modestring"
CapConstraints apicaps.CapID = "constraints"
CapPlatform apicaps.CapID = "platform"
@ -91,6 +92,9 @@ const (
CapMultipleExporters apicaps.CapID = "exporter.multiple"
CapSourcePolicy apicaps.CapID = "source.policy"
// GC/Prune controls allow MinFreeSpace and MaxUsedSpace to be set
CapGCFreeSpaceFilter apicaps.CapID = "gc.freespacefilter"
)
func init() {
@ -488,4 +492,10 @@ func init() {
Enabled: true,
Status: apicaps.CapStatusExperimental,
})
Caps.Init(apicaps.Cap{
ID: CapGCFreeSpaceFilter,
Enabled: true,
Status: apicaps.CapStatusExperimental,
})
}

View File

@ -1,3 +0,0 @@
package pb
//go:generate protoc -I=. -I=../../vendor/ --go_out=paths=source_relative:. ops.proto

View File

@ -1,23 +1,21 @@
package pb
import proto "google.golang.org/protobuf/proto"
func (m *Definition) IsNil() bool {
return m == nil || m.Metadata == nil
}
func (m *Definition) Marshal() ([]byte, error) {
return proto.Marshal(m)
return m.MarshalVT()
}
func (m *Definition) Unmarshal(dAtA []byte) error {
return proto.Unmarshal(dAtA, m)
return m.UnmarshalVT(dAtA)
}
func (m *Op) Marshal() ([]byte, error) {
return proto.Marshal(m)
return m.MarshalVT()
}
func (m *Op) Unmarshal(dAtA []byte) error {
return proto.Unmarshal(dAtA, m)
return m.UnmarshalVT(dAtA)
}

File diff suppressed because it is too large Load Diff

View File

@ -341,6 +341,8 @@ message FileActionCopy {
repeated string exclude_patterns = 13;
// alwaysReplaceExistingDestPaths results in an existing dest path that differs in type from the src path being replaced rather than the default of returning an error
bool alwaysReplaceExistingDestPaths = 14;
// mode in non-octal format
string modeStr = 15;
}
message FileActionMkFile {

File diff suppressed because it is too large Load Diff