Skip to content

Commit

Permalink
feat: support the arg batch-size for small chunks mergence for nydusify
Browse files Browse the repository at this point in the history
Signed-off-by: Desiki-high <[email protected]>
  • Loading branch information
Desiki-high committed Apr 20, 2023
1 parent 34710b5 commit eed55eb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contrib/nydusify/cmd/nydusify.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,12 @@ func main() {
EnvVars: []string{"FS_CHUNK_SIZE"},
Aliases: []string{"chunk-size"},
},
&cli.StringFlag{
Name: "batch-size",
Value: "0",
Usage: "size of batch data chunks, must be power of two, between 0x1000-0x1000000 or zero, [default: 0]",
EnvVars: []string{"BATCH_SIZE"},
},
&cli.StringFlag{
Name: "work-dir",
Value: "./tmp",
Expand Down Expand Up @@ -492,6 +498,7 @@ func main() {
FsAlignChunk: c.Bool("backend-aligned-chunk") || c.Bool("fs-align-chunk"),
Compressor: c.String("compressor"),
ChunkSize: c.String("chunk-size"),
BatchSize: c.String("batch-size"),

OCIRef: c.Bool("oci-ref"),
AllPlatforms: c.Bool("all-platforms"),
Expand Down
1 change: 1 addition & 0 deletions contrib/nydusify/pkg/converter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func getConfig(opt Opt) map[string]string {
cfg["fs_version"] = opt.FsVersion
cfg["fs_align_chunk"] = strconv.FormatBool(opt.FsAlignChunk)
cfg["fs_chunk_size"] = opt.ChunkSize
cfg["batch_size"] = opt.BatchSize

// FIXME: still needs to be supported by acceld converter package.
cfg["cache_ref"] = opt.CacheRef
Expand Down
1 change: 1 addition & 0 deletions contrib/nydusify/pkg/converter/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type Opt struct {
FsAlignChunk bool
Compressor string
ChunkSize string
BatchSize string
PrefetchPatterns string
OCIRef bool

Expand Down

0 comments on commit eed55eb

Please sign in to comment.