Repository navigation
fix module source cache invalidation + cleanup api - #9505
Merged
Merged
Conversation
sipsma
force-pushed
the
simplify-module-load-take3
branch
from
February 4, 2025 22:52
1fd68c0 to
7483906
Compare
jedevc
reviewed
Feb 5, 2025
jedevc
reviewed
Feb 5, 2025
jedevc
reviewed
Feb 5, 2025
jedevc
reviewed
Feb 5, 2025
jedevc
reviewed
Feb 5, 2025
sipsma
force-pushed
the
simplify-module-load-take3
branch
8 times, most recently
from
February 11, 2025 21:23
b29e701 to
8d9afe3
Compare
sipsma
force-pushed
the
simplify-module-load-take3
branch
12 times, most recently
from
February 14, 2025 04:23
fd81d0c to
0a3b94b
Compare
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
sipsma
force-pushed
the
simplify-module-load-take3
branch
from
February 18, 2025 21:59
b12dd30 to
ca58af8
Compare
Signed-off-by: Erik Sipsma <[email protected]>
sipsma
force-pushed
the
simplify-module-load-take3
branch
from
February 18, 2025 23:14
b42de4a to
560ec15
Compare
5 of 6 tasks
TomChv
pushed a commit
to TomChv/dagger
that referenced
this pull request
Feb 20, 2025
The current implementation is broken because the way SDK is loaded since dagger#9505 is closely coupled with module source. But in the client gen case, the generator isn't the SDK itself, it could be but it could also be an external one. Signed-off-by: Tom Chauveau <[email protected]>
TomChv
pushed a commit
to TomChv/dagger
that referenced
this pull request
Feb 20, 2025
The current implementation is broken because the way SDK is loaded since dagger#9505 is closely coupled with module source. But in the client gen case, the generator isn't the SDK itself, it could be but it could also be an external one. Signed-off-by: Tom Chauveau <[email protected]>
TomChv
pushed a commit
to TomChv/dagger
that referenced
this pull request
Feb 20, 2025
The current implementation is broken because the way SDK is loaded since dagger#9505 is closely coupled with module source. But in the client gen case, the generator isn't the SDK itself, it could be but it could also be an external one. Signed-off-by: Tom Chauveau <[email protected]>
TomChv
pushed a commit
to TomChv/dagger
that referenced
this pull request
Feb 21, 2025
The current implementation is broken because the way SDK is loaded since dagger#9505 is closely coupled with module source. But in the client gen case, the generator isn't the SDK itself, it could be but it could also be an external one. Signed-off-by: Tom Chauveau <[email protected]>
TomChv
pushed a commit
to TomChv/dagger
that referenced
this pull request
Feb 24, 2025
The current implementation is broken because the way SDK is loaded since dagger#9505 is closely coupled with module source. But in the client gen case, the generator isn't the SDK itself, it could be but it could also be an external one. Signed-off-by: Tom Chauveau <[email protected]>
This was referenced Mar 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔥 Breaking Change
This improvement comes with a few breaking changes that are not expected to impact most users. Impacted users are those who:
They may need to update their dagger.json configuration file to add an explicit
"include"setting to ensure those extra files or directories are loaded with the module. This is because numerous files previously implicitly loaded are now skipped by default, which contributes to the performance improvements.For example, if your module code is in
.daggerand relies on thego.modfile in the parent directory, you would add the following to yourdagger.jsonfile:{ "include": ["../go.mod", "../go.sum"] }The values in the
"include"array are relative to the directory containingdagger.json. They can be also be glob patterns (e.g."**/*.txt"). To explicitly exclude some files matched by a previous include pattern, you can prepend the include pattern with a!character (e.g."!**/foo.txt").excludesetting existed but has now been superseded by prefixing an include pattern with a!character. However, this is backwards-compatible, so existingexcludesettings will be automatically turned into equivalent!-prefixed include settings when runningdagger develop. No user intervention is needed.The core API's
ModuleSourceandModuletypes have also undergone some cleanup that includes breaking changes. Most users do not interact with these APIs, but any that do may need some minor adjustments to their code. In particular:Module.initializeno longer needs to be called; the module is initialized on creationResolveFromCallerno longer needs to be called for local module sources; context is automatically loaded and resolved efficiently as needed by other API callsFinally, an undocumented feature called
viewshas been removed as it has been superseded by default path arguments.Goals here are:
So far the results are looking good.
For some concrete numbers, here are
load moduletimes for thedagger-dev's module in Dagger's repository under different scenarios:dagger call --helpon new engines with an empty cachedagger call --helpwith no file changes in the repo:dagger call --helpafter making a change to a random source code file in the repo:The difference in
2.above of 10x speedup should make our day to day development quite a bit less painful; a lot less waiting around an extra 30s every time any change is made.In terms of the simplifications, the net deletion of over 4k lines of code is indicative of success so far there 😄
TODOs: