-
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
Add heuristics to speed up Jib check in skaffold init #3120
Add heuristics to speed up Jib check in skaffold init #3120
Conversation
Codecov Report
|
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.
This is really cool. It could be worse in the status quo when artifacts are not downloaded in Maven/Gradle caches.
The only corner case I have been thinking about is the multi-module/project case, where I can imagine <artifactId>jib-maven-plugin</artifactId>
is defined only in the parent project or the other way around. Will skaffold init
work for both Maven and Gradle in these cases?
Assuming I tested everything correctly, my findings: Maven
Gradle
|
Are your findings before or after this quick check? Doesn't this PR change any behavior? I think I better talk to you offline. |
Does this work if jib is configured further down the tree in a multimodule project? (and not at the root) |
With this PR, skaffold first checks for Jib-related strings in the build file before attempting to run the task/goal, rather than attempting to call into Jib any time a build.gradle or pom.xml is found. This eliminates a lot of false positives and speeds up
skaffold init
considerably on projects that don't have Jib configured.Here are the timings for running
skaffold init --XXenableJibInit --analyze
on a 2-module maven project with no Jib configurations, before and after this PR:Timings before and after are about the same if Jib is configured on all modules. This PR seems to save around 2-3 seconds for every module Jib is not configured.
It still may be a good idea to consider automatically applying Jib on Java projects where it isn't already configured, but in the meantime this seems like a good improvement to have.
Release Notes
Speed up Jib checks in
skaffold init
on Java projects.