-
Notifications
You must be signed in to change notification settings - Fork 811
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
Re-work package resolution and make runners use it #3852
Conversation
PackageResolver
and ModuleCache
PackageResolver
and ModuleCache
c6b70d8
to
3987ce9
Compare
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.
Overall: amazing work!
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.
Overall: amazing work!
a95cbdc
to
e235cd6
Compare
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.
Preapproving it, we just need to simplify the trait implementation for now. But feel free to merge once that's implemented
549df13
to
4cb8694
Compare
10c4cdd
to
f1bd711
Compare
23b999d
to
9cae74e
Compare
This PR refactors runners to take advantage of #3841 and #3831. @theduke and I have also completely re-worked the package resolution workflow to better suit Deploy's needs.
TL;DR:
Runner
trait now has two methodscan_run_command()
function for checking whether a runner can run something, andrun_command()
function which gets the command name, a WEBC container, and aWasiRuntime
WasiRuntime
instead of being stored as a field in the runnerBinaryPackage
type has been repurposed so it represents not just a single package, but the entire environment that will be available at runtime (all commands, file systems, etc.)PackageLoader
- something that can load a*.webc
fileSource
- something that can answer questions about package dependencies (WAPM, local directory for testing, etc.)Registry
- a collection ofSource
sSummary
- just enough metadata about a single package to do package resolutionresolve()
- the top-level function that takes a "root" package and aRegistry
, and figures out both the concrete dependency graph (DependencyGraph
) and what the resulting package would look like (ResolvedPackage
)load_package_tree()
- a new method onWasiRuntime
that you can override when loadingResolvedPackage
into aBinaryPackage
, primarily so Deploy can add custom caching and suchLater on we'll probably refactor
BinaryPackageCommand
so commands and filesystems can be lazily loaded, but I'm leaving that for future Michael.Fixes #3603, fixes #3748, fixes #3812.