-
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
Recompute docker dependencies across dev loops. #5121
Recompute docker dependencies across dev loops. #5121
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5121 +/- ##
==========================================
+ Coverage 72.19% 72.24% +0.04%
==========================================
Files 380 380
Lines 13303 13326 +23
==========================================
+ Hits 9604 9627 +23
Misses 3006 3006
Partials 693 693
Continue to review full report at Codecov.
|
62b2d0b
to
a380575
Compare
927b56f
to
f96742f
Compare
Performance stats I ran
|
@gsquared94, @briandealwis and @nkubala please take a look. |
49867f8
to
35bff8e
Compare
@@ -53,3 +52,8 @@ func GetDependencies(ctx context.Context, workspace string, a *latest.CustomArti | |||
return list.Files(workspace, a.Dependencies.Paths, a.Dependencies.Ignore) | |||
} | |||
} | |||
|
|||
func getDockerBuildConfig(ws string, artifact string, a *latest.CustomArtifact) docker.BuildConfig { | |||
dockerfile := a.Dependencies.Dockerfile |
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.
should we normalize the Dockerfile path here itself instead of 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.
That is a good suggestion. ThenormalizeDockerpath
is used a lot many places. while going through the code, there is a huge scope of avoiding repetition across docker.SyncMap
and docker.GetDependencies
I don't want to error out here in this stage of creating a BuildConfig
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
…#5121) * only read chached values in createContext * remove sf.do * Move key from dockerfilePath to artifact name * Fix kaniko test
* Recompute docker dependencies across dev loops. (#5121) * only read chached values in createContext * remove sf.do * Move key from dockerfilePath to artifact name * Fix kaniko test * Release notes for v1.17.2
fixes #5110 & #5115
In #4896, we cache results for
docker.GetDependencies
since there were getting computed atleast 2 times for docker builds.However, this PR ended up caching the results across dev loops.
In this PR,
GetCachedDependencies
which will be used in subsequent calls.This fixes issue in Skaffold v1.17.1 unable to stream build output when copying from directory of larger context #5115 where same dockerfile was used in different artifacts.
Alternate approach considered,
dependencyCache
for each loop.docker.GetDependency
is a public method.dependencyCache
at end of each dev loopThis would have required adding
pkg/skaffold/docker
package dependency inpkg/skaffold/runner
. If all dependencies were cached, we could have addedInvalidateDependencyCache()
toBuilder
interface. However only docker dependencies are cached, so went with the approach to add a new methodGetCachedDependencies
and use it when creating tar contextTesting notes
skaffold dev
touch node/src/new.js