Parallel overlay builds

- Closes #1018

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2024-12-19 04:29:34 -07:00
parent 53e5805fbe
commit a59403ab3b
9 changed files with 83 additions and 50 deletions

View File

@@ -2,6 +2,7 @@ package build
import (
"log"
"runtime"
"github.com/spf13/cobra"
"github.com/warewulf/warewulf/internal/pkg/node"
@@ -31,6 +32,7 @@ var (
}
OverlayNames []string
OverlayDir string
Workers int
)
func init() {
@@ -44,7 +46,7 @@ func init() {
}
baseCmd.PersistentFlags().StringVarP(&OverlayDir, "output", "o", "", `Do not create an overlay image for distribution but write to
the given directory. An overlay must also be ge given to use this option.`)
baseCmd.PersistentFlags().IntVar(&Workers, "workers", runtime.NumCPU(), "The number of parallel workers building overlays")
}
// GetRootCommand returns the root cobra.Command for the application.