Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Kaniko builder #1168

Merged
merged 10 commits into from Oct 17, 2018
Merged

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented Oct 16, 2018

@codecov-io
Copy link

codecov-io commented Oct 16, 2018

Codecov Report

Merging #1168 into master will decrease coverage by 1.1%.
The diff coverage is 18.3%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1168      +/-   ##
==========================================
- Coverage   42.18%   41.08%   -1.11%     
==========================================
  Files          89       94       +5     
  Lines        3999     4126     +127     
==========================================
+ Hits         1687     1695       +8     
- Misses       2143     2262     +119     
  Partials      169      169
Impacted Files Coverage Δ
pkg/skaffold/build/kaniko/types.go 0% <0%> (ø)
pkg/skaffold/build/kaniko/run.go 0% <0%> (ø)
pkg/skaffold/build/kaniko/kaniko.go 0% <0%> (ø)
pkg/skaffold/build/kaniko/secret.go 0% <0%> (ø)
pkg/skaffold/runner/runner.go 49.59% <0%> (ø) ⬆️
pkg/skaffold/build/kaniko/logs.go 20% <20%> (ø)
pkg/skaffold/kubernetes/wait.go 25.25% <34.78%> (+0.8%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f78ea2...5e65832. Read the comment docs.

@dgageot dgageot force-pushed the kaniko-builder branch 2 times, most recently from 6929c7c to c26e30d Compare October 16, 2018 12:52
@@ -97,6 +89,14 @@ func runKaniko(ctx context.Context, out io.Writer, artifact *latest.Artifact, cf
return imageDst, nil
}

func logLevel() logrus.Level {
level := logrus.GetLevel()
if level < logrus.InfoLevel {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the special logic?
If users ask for debug logs, let them feel the onslaught of debug logs :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the opposite I tried to achieve. Should be at least Info otherwise nothing is ever shown. I'll add a few tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops I didn't read closely enough. Maybe kaniko should output some useful information by default wdyt @priyawadhwa?

}

func podTemplate(cfg *latest.KanikoBuild, args []string) *v1.Pod {
return &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
GenerateName: "kaniko",
GenerateName: "kaniko-",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR, but WDYT about generateName for the secrets as well? I forget if I put it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do that, I don't think it's done

@@ -34,6 +34,10 @@ type artifactBuilder func(ctx context.Context, out io.Writer, tagger tag.Tagger,

// InParallel builds a list of artifacts in parallel but prints the logs in sequential order.
func InParallel(ctx context.Context, out io.Writer, tagger tag.Tagger, artifacts []*latest.Artifact, buildArtifact artifactBuilder) ([]Artifact, error) {
if len(artifacts) == 1 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't InParallel handle the single case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I don't think we can do multiple kaniko artifacts in parallel since we don't generateName for the secret?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inParallel can handle the single case but it's extra work on streams. More important than that, it loses a bit the colors. I couldn't fix it.

Building in // should work since the secret is shared by all jobs. It's defined at the builder level not the artifact level.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Fixes GoogleContainerTools#1145

Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
@dgageot dgageot merged commit 7a396f4 into GoogleContainerTools:master Oct 17, 2018
@dgageot dgageot deleted the kaniko-builder branch December 28, 2018 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants