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

Refactor kaniko builder to cluster builder #2037

Merged
merged 3 commits into from
Apr 30, 2019

Conversation

priyawadhwa
Copy link
Contributor

Custom artifacts will need to work with both the local builder and the
cluster builder. However, currently the "cluster" builder is really just
the kaniko builder.

This refactor renames pkg/build/kaniko to pkg/build/cluster, and
reorganizes pkg/build/cluster so that it looks like pkg/build/local. This way, we
should easily be able to add a new CustomArtifact to the cluster
builder just as easily as we can to the local builder.

Custom artifacts will need to work with both the local builder and the
cluster builder. However, currently the "cluster" builder is really just
the kaniko builder.

This refactor renames `pkg/build/kaniko` to `pkg/build/cluster`, and
reorganizes it so that it looks like `pkg/build/local`. This way, we
should easily be able to add a new CustomArtifact to the cluster
builder just as easily as we can to the local builder.
}

// Otherwise, run the builds in sequence.
return build.InSequence(ctx, out, tags, artifacts, b.runBuildForArtifact)
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm...it's a bit more complicated but I think we should collect the kaniko builds and run them in parallel with building all the custom artifacts in sequence. Building all kaniko artifacts in sequence sounds like a very slow solution and a waste of resources on a cluster.

Copy link
Member

Choose a reason for hiding this comment

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

Why should be default building custom artifacts in sequence?
Is it because we don't know what the scripts do and they might use same resources and could not run in parallel?

Copy link
Member

Choose a reason for hiding this comment

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

Something we should consider documenting when we add CustomBuilder.

Copy link
Member

Choose a reason for hiding this comment

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

With the way this is organized right now, i dont think this is going to used until we support another builder type for in cluster.
Maybe we shd remove it for now? It will help us get our test coverage up too since this branch isn't tested

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it because we don't know what the scripts do and they might use same resources and could not run in parallel?

Yah, exactly. There's a section in my DD about letting users define if they want their builds to run in parallel or not, which could be an option.

Am happy to remove it for now and add it back later.

Copy link
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

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

LGTM except the InParallel vs InSequence comment.

@priyawadhwa
Copy link
Contributor Author

@balopat I ended up removing the logic for running in sequence, and I'll add it back when I add the CustomArtifact to the cluster builder.

@codecov-io
Copy link

codecov-io commented Apr 29, 2019

Codecov Report

Merging #2037 into master will decrease coverage by 0.05%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2037      +/-   ##
==========================================
- Coverage   56.09%   56.03%   -0.06%     
==========================================
  Files         175      175              
  Lines        7607     7615       +8     
==========================================
  Hits         4267     4267              
- Misses       2932     2940       +8     
  Partials      408      408
Impacted Files Coverage Δ
pkg/skaffold/build/cluster/sources/gcs.go 0% <ø> (ø)
pkg/skaffold/build/cluster/secret.go 0% <ø> (ø)
pkg/skaffold/build/cluster/sources/localdir.go 0% <ø> (ø)
pkg/skaffold/build/cluster/logs.go 20% <ø> (ø)
pkg/skaffold/build/cluster/sources/sources.go 89.33% <ø> (ø)
pkg/skaffold/build/cluster/cluster.go 0% <0%> (ø)
pkg/skaffold/runner/runner.go 66.87% <0%> (ø) ⬆️
pkg/skaffold/build/cluster/types.go 0% <0%> (ø)
pkg/skaffold/build/cluster/kaniko.go 37.14% <0%> (ø)

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 1780a80...0dac1ae. Read the comment docs.

@priyawadhwa priyawadhwa merged commit 11f8a1b into GoogleContainerTools:master Apr 30, 2019
@priyawadhwa priyawadhwa deleted the refactor branch April 30, 2019 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants