Skip to content

[WIP] fix module source cache invalidation + cleanup api - #9245

Closed
sipsma wants to merge 5 commits into
dagger:mainfrom
sipsma:simplify-module-load-take3
Closed

sipsma wants to merge 5 commits into
dagger:mainfrom
sipsma:simplify-module-load-take3

Conversation

@sipsma

@sipsma sipsma commented Dec 18, 2024 •

Copy link
Copy Markdown
Contributor

This is only half written, doesn't build yet, has commits from #9204, etc. But has enough to show usage of all the new caching features added in #9204. Sending out in case it's helpful for groking that PR and what the "grand plan" is.

Goals here are:

  • Fix various sources of excessive module building cache invalidation
    • changing completely unrelated source files in context
    • building different git commits that have no changes in the module source
    • etc.
  • Use the filesync improvements + new caching features in support for custom digests in dagql #9204 to cleanup tons of cruft from the API (ResolveFromCaller, Module.initialize, etc.)

This will have some breaking changes in the current plans:

  • dagger.json's include field will now be co-opted to only need to be set when a module imports code from local non-daggerized packages. It should never need to be set for any other case.
    • I will likely remove exclude entirely since it's redundant with ! include patterns
  • views are likely gonna be removed since they don't serve much of a purpose anymore thanks to contextual args, though I'm not 100% set on this

This enables implementations of API calls to set a custom digest on
returned IDs replacing the default digest calculated by the "call chain
digest".

Currently, this is used to enable content-based caching of certain calls
that previously relied on the separate `blob` API. The `blob` API is
thus removed as part of this change too.

The intention is to setup more use cases for this, including customizing
digests of different ModuleSource implementations and reducing cache
invalidation of SDK calls.

Signed-off-by: Erik Sipsma <[email protected]>
The type of introspectionJson changed from string to *File a long time
ago, but for some reason dagql never error'd out despite the type
mismatch (perhaps something to do with coercing an ID to a string?).

The previous commit accidentally fixed that validation, so this test
started correctly failing now and needs to be corrected.

Signed-off-by: Erik Sipsma <[email protected]>
After the recent filesync improvements, there's no downside to loading
multiple local dirs from the same client in parallel, so we may as well
load all contextual dir args in parallel.

Signed-off-by: Erik Sipsma <[email protected]>
@github-actions

github-actions Bot commented Jan 2, 2025

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions

github-actions Bot commented Jan 9, 2025

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions Bot closed this Jan 9, 2025
@sipsma

sipsma commented Feb 4, 2025

Copy link
Copy Markdown
Contributor Author

revived here: #9505

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant