#Calling installed module from within a module
1 messages · Page 1 of 1 (latest)
Here is the repro in an easy-to-copy-paste form:
# This works
dagger -m github.com/shykes/daggerverse/daggy@v0.2.3 call \
container \
with-exec \
--experimental-privileged-nesting \
--args=sh,-c,"dagger -m github.com/shykes/daggerverse/core@v0.2.0 functions" \
stdout
# This does not work, but should
dagger -m github.com/shykes/daggerverse/daggy@v0.2.3 call \
container \
with-exec \
--experimental-privileged-nesting \
--args=sh,-c,"cat dagger.json; dagger -m core functions" \
stdout
Think you just need to change this line to be v0.9.11: https://github.com/shykes/daggerverse/blob/21b2cfeac8717b9e11bb21336374eabae702fc84/daggy/main.go#L78
there was a bug in the support for short dep names in v0.9.10 that it looks like you're hitting
Ah! Will try right away, thanks
By the way, I didn't know what engineVersion actually meant:
- "Known to work on at least this version"?
- "Please instantiate exactly this engine when loading this module"?
Looks like it's the latter
It's "the version of the engine that was most recently used while developing the module" (i.e. most recent dagger init/install/develop used with it). Atm it's only used to:
- Track metadata (which could be used for all sorts of purposes down the road)
- Invalidate cache of execs based on the version of the engine (otherwise you can get cached results for older versions of the API, which creates all kinds of headaches)
So closer to Known to work on at least this version actually
The idea is someday it should be Please instantiate exactly this engine when loading this module, but that will require a lot more work
@sinful knot it looks like I'm still hitting the issue on main..
Oh doh I forgot to update the engine line
@sinful knot OK, I still have the error
dagger call -m github.com/shykes/daggerverse/daggy@v0.3.0 \
container \
with-exec \
--experimental-privileged-nesting \
--args dagger,-m,core,functions \
stdout
That line looks like it's still v0.9.10 at the daggy/v0.3.0 tag: https://github.com/shykes/daggerverse/blob/115bad8519ee1f885884926db2d223da0ba979a4/daggy/main.go#L78
Tried locally and when I update it to v0.10.0 it worked:
sipsma@dagger_dev:~/repo/github.com/sipsma/shykes-daggerverse$ dagger call -m ./daggy container with-exec --experimental-privileged-nesting --args dagger,-m,core,functions stdout
Name Description
fs -
git -
oh I updated the engine version in core 🤦
Ah yeah that bug was specifically in the CLI
When the engine version is pinned in a module, does the CLI still contact our registry to check for last engine version?
(wondering about IP analytics)
@sinful knot are you sure about the daggy/v0.3.0 tag? Here's what I see: https://github.com/shykes/daggerverse/blob/daggy/v0.3.0/daggy/dagger.json
Ooooh sorry I'm slow, but just caught up to youo
"the bug is in the CLI" -> roger
Just pushed 0.3.1, can you try please?
Works for me now!
And yeah, no problem, getting these nested dagger-in-dagger scenarios working is a great way to go insane quickly 😄
actually is there a way to automatically get the CLI at the same version running the current function?
I guess I could load and parse my own dagger.json, as long as I remember to set engine version there
Yeah that would be cool. The engine version can be either A) a git tag (for official release), B) a git commit (for CI build off our main branch), or C) a content hash of the current repo (for local build).
A+B are straightforward. C would require being passed the local source code as an (optional) arg I guess?
Also, while yeah for now you could parse from dagger.json, we should probably just add Query.engineVersion: String!, we already have a Query.checkVersionCompatibility field but not one that just tells you the version
technically we could expose a core function that returns the executable for the current platform. fetched and built JIT of course 😎