Skip to content

Commit

Permalink
[mirror] Feature: Push parallelism support
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Vasilenko <[email protected]>
  • Loading branch information
Maxim Vasilenko committed Sep 23, 2024
1 parent e35bc43 commit 908b82d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/mirror/cmd/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ func buildPushContext() *contexts.PushContext {
},

Parallelism: contexts.ParallelismConfig{
Blobs: 4,
Images: 10,
Blobs: 2,
Images: 5,
},
}
return mirrorCtx
Expand Down
6 changes: 2 additions & 4 deletions pkg/libmirror/layouts/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func PushLayoutToRepo(
batchesCount, imagesCount := 1, 1

for _, manifestSet := range batches {
if len(manifestSet) == 1 {
if parallelismConfig.Images == 1 {
tag := manifestSet[0].Annotations["io.deckhouse.image.short_tag"]
imageRef := registryRepo + ":" + tag
logger.InfoF("[%d / %d] Pushing image %s", imagesCount, len(indexManifest.Manifests), imageRef)
Expand All @@ -81,9 +81,7 @@ func PushLayoutToRepo(
err = logger.Process(fmt.Sprintf("Pushing batch %d / %d", batchesCount, len(batches)), func() error {
logger.InfoLn("Images in batch:")
for _, manifest := range manifestSet {
tag := manifest.Annotations["io.deckhouse.image.short_tag"]
imageRef := registryRepo + ":" + tag
logger.InfoF("- %s", imageRef)
logger.InfoF("- %s", registryRepo+":"+manifest.Annotations["io.deckhouse.image.short_tag"])
}

parallel.ForEach(manifestSet, pushImage(logger, registryRepo, index, imagesCount, refOpts, remoteOpts))
Expand Down

0 comments on commit 908b82d

Please sign in to comment.