diff --git a/pkg/converter/convert_unix.go b/pkg/converter/convert_unix.go index dd8282086a..18a6b5b4b4 100644 --- a/pkg/converter/convert_unix.go +++ b/pkg/converter/convert_unix.go @@ -479,6 +479,7 @@ func packFromTar(ctx context.Context, dest io.Writer, opt PackOption) (io.WriteC PrefetchPatterns: opt.PrefetchPatterns, AlignedChunk: opt.AlignedChunk, ChunkSize: opt.ChunkSize, + BatchSize: opt.BatchSize, Compressor: opt.Compressor, Timeout: opt.Timeout, diff --git a/pkg/converter/tool/builder.go b/pkg/converter/tool/builder.go index 4edfc28856..5c8284e95a 100644 --- a/pkg/converter/tool/builder.go +++ b/pkg/converter/tool/builder.go @@ -39,6 +39,7 @@ type PackOption struct { OCIRef bool AlignedChunk bool ChunkSize string + BatchSize string Timeout *time.Duration Features Features @@ -132,6 +133,9 @@ func buildPackArgs(option PackOption) []string { if option.ChunkSize != "" { args = append(args, "--chunk-size", option.ChunkSize) } + if option.BatchSize != "" { + args = append(args, "--batch-size", option.BatchSize) + } args = append(args, option.SourcePath) return args diff --git a/pkg/converter/types.go b/pkg/converter/types.go index 57e17705f0..bbdea72ed2 100644 --- a/pkg/converter/types.go +++ b/pkg/converter/types.go @@ -71,6 +71,8 @@ type PackOption struct { AlignedChunk bool // ChunkSize sets the size of data chunks, must be power of two and between 0x1000-0x1000000. ChunkSize string + // BacthSize sets the size of batch data chunks, must be power of two and between 0x1000-0x1000000 or zero. + BatchSize string // Backend uploads blobs generated by nydus-image builder to a backend storage. Backend Backend // Timeout cancels execution once exceed the specified time.