#Calling installed module from within a module

1 messages · Page 1 of 1 (latest)

drowsy monolith
#

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
sinful knot
# drowsy monolith ```shell # This does not work, but should dagger -m github.com/shykes/daggerver...

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

GitHub

My personal collection of Dagger modules. Contribute to shykes/daggerverse development by creating an account on GitHub.

drowsy monolith
#

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

sinful knot
# drowsy monolith By the way, I didn't know what `engineVersion` actually meant: - "Known to work...

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:

  1. Track metadata (which could be used for all sorts of purposes down the road)
  2. 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

drowsy monolith
#

@sinful knot it looks like I'm still hitting the issue on main..

#

Oh doh I forgot to update the engine line

drowsy monolith
#

@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
sinful knot
# drowsy monolith ```shell dagger call -m github.com/shykes/daggerverse/daggy@v0.3.0 \ container ...

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    -
drowsy monolith
#

oh I updated the engine version in core 🤦

sinful knot
drowsy monolith
#

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)

#

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?

sinful knot
sinful knot
drowsy monolith
#

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

sinful knot
#

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

drowsy monolith
#

technically we could expose a core function that returns the executable for the current platform. fetched and built JIT of course 😎