Add more benchmarks (#487)
This commit is contained in:
parent
29b7c3e879
commit
8ced0930f4
|
|
@ -28,7 +28,7 @@ import (
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
|
|
||||||
"github.com/google/go-containerregistry/pkg/name"
|
"github.com/google/go-containerregistry/pkg/name"
|
||||||
"github.com/google/go-containerregistry/pkg/v1"
|
v1 "github.com/google/go-containerregistry/pkg/v1"
|
||||||
"github.com/google/go-containerregistry/pkg/v1/mutate"
|
"github.com/google/go-containerregistry/pkg/v1/mutate"
|
||||||
"github.com/google/go-containerregistry/pkg/v1/tarball"
|
"github.com/google/go-containerregistry/pkg/v1/tarball"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
@ -412,6 +412,8 @@ func DoBuild(opts *config.KanikoOptions) (v1.Image, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func fetchExtraStages(stages []config.KanikoStage, opts *config.KanikoOptions) error {
|
func fetchExtraStages(stages []config.KanikoStage, opts *config.KanikoOptions) error {
|
||||||
|
t := timing.Start("Fetching Extra Stages")
|
||||||
|
defer timing.DefaultRun.Stop(t)
|
||||||
for _, s := range stages {
|
for _, s := range stages {
|
||||||
for _, cmd := range s.Commands {
|
for _, cmd := range s.Commands {
|
||||||
c, ok := cmd.(*instructions.CopyCommand)
|
c, ok := cmd.(*instructions.CopyCommand)
|
||||||
|
|
@ -442,6 +444,8 @@ func fetchExtraStages(stages []config.KanikoStage, opts *config.KanikoOptions) e
|
||||||
}
|
}
|
||||||
|
|
||||||
func extractImageToDependecyDir(name string, image v1.Image) error {
|
func extractImageToDependecyDir(name string, image v1.Image) error {
|
||||||
|
t := timing.Start("Extracting Image to Dependency Dir")
|
||||||
|
defer timing.DefaultRun.Stop(t)
|
||||||
dependencyDir := filepath.Join(constants.KanikoDir, name)
|
dependencyDir := filepath.Join(constants.KanikoDir, name)
|
||||||
if err := os.MkdirAll(dependencyDir, 0755); err != nil {
|
if err := os.MkdirAll(dependencyDir, 0755); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
@ -452,6 +456,8 @@ func extractImageToDependecyDir(name string, image v1.Image) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func saveStageAsTarball(path string, image v1.Image) error {
|
func saveStageAsTarball(path string, image v1.Image) error {
|
||||||
|
t := timing.Start("Saving stage as tarball")
|
||||||
|
defer timing.DefaultRun.Stop(t)
|
||||||
destRef, err := name.NewTag("temp/tag", name.WeakValidation)
|
destRef, err := name.NewTag("temp/tag", name.WeakValidation)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue