-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Refactor kaniko builder to cluster builder #2037
Conversation
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
@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. |
…type is supported
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
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
topkg/build/cluster
, andreorganizes
pkg/build/cluster
so that it looks likepkg/build/local
. This way, weshould easily be able to add a new CustomArtifact to the cluster
builder just as easily as we can to the local builder.