#Dagger Cloud
1 messages · Page 1 of 1 (latest)
Actually @quiet maple do you mind taking this? I sent out the change here: https://github.com/dagger/dagger/pull/11266
But it looks like there's a couple failures related to the various package managers that can be config'd https://dagger.cloud/dagger/traces/9c6a47d30202d29304695f01dbbc1aa9?listen=49fc26064eb5092e&listen=231f5e7f70ece9c9&listen=a956fa1a87f3ef68&listen=f6972a2b5e2c06e2&listen=18bd7ad2e7ee6b52&listen=89579cc80a13c837&listen=fd455d5a04a12f20&listen=d739107a63d1585d&listen=4fb77a3eb1e7e550
I don't want to get overly distracted from finishing up function caching stuff
Hey sure, I'm also doing couple of things on the TS container so it's the right time
I have a branch almost ready to apply Yves' optimization with moduleTypeDef
There's two fixes in the PR:
- don't reinstall npm if it's already present at the given version in the container
- put the
withSetupPackageManagerstep before mounting in the module source code, that way we can re-use those expensive steps across modules rather than re-run them for every different module source
Thanks! The fix there seems extremely worth it, but looking at the traces of typescript SDK steps I think there's probably a lot of other worthwhile optimizations
We already setupPackageManager before mounted the source code 😮
oh really? I might have misunderstood then, I just saw that it was after withGeneratedSDK
maybe that's different
return runtimeBaseContainer(cfg, t.SDKSourceDir).
withConfiguredRuntimeEnvironment().
withGeneratedSDK(introspectionJSON). <-- Generate client (because we need it)
withSetupPackageManager(). <-- Setup
withInstalledDependencies().
withUserSourceCode(). <--- Here
withEntrypoint().
Container(), nil
We can't put the setupPackageManager before withGeneretedSDK because some dependency will be missing in case the SDK library is local and not bundle
And also because for a stupid reason, the way we install yarn using corepack will automatically also run an install that we cannot disable (because that's stupid)
At some point I think I might just drop yarn v2+ support so we don't have to deal with that anymore
I see, let me see if my PR passes if I get rid of that part and just leave in the npm install npm optimization
Is because of that, the local lib is installed after the setup so it created an issue
But ideally, I want to deprecate the local lib support, it creates so many problem for absolutely no gain
(And that way we could in theory setup the package manager at the beggining)
Makes sense, yeah whatever we can do to put the expensive steps before any steps that might invalidate their cache would be good
Yeah, I don't think many users would complain if I just deprecate that, I could fail with an explicit warning to explain how to migrate to the new way
In the meantime, there actually is cache invalidation happening because we are in the previous step mounting to a path like /src/sdk/typescript/dev/node/sdk, which is gonna be different for each module. So modules can't share the cache for that step.
Hmm