#dagger run (dagger call; dagger call)

1 messages ยท Page 1 of 1 (latest)

nocturne whale
#

Opening an issue never hurts; we can probably fix this, but more generally I think the jury's out on how/whether dagger run plays into Zenith, i.e. whether it gets retired/replaced. I definitely never thought to wrap dagger call in it ๐Ÿ˜…

atomic mica
#

What's happening is that if the same module gets invoked twice, we get that error

humble veldt
#

ohhh could this be about nesting dagger sessions?

atomic mica
#

well.. nesting I think it's another condition where this observed. I think the generic way of defining this is "dagger call can't be invoked multiple times within the same session"

#

which in the nesting case, happens to be the same

#

I'd assume the same thing happens also if you do a dagger listen and issue dagger call against the same session.

nocturne whale
#

my guess is this happens specifically with the CLI because it works by calling Module.serve which mutates the current session

dire cosmos
nocturne whale
#

calling .Serve() is how it's able to execute the query, since that's what installs the schema

dire cosmos
#

Oh, right. ๐Ÿ™‚

whole gate
#

Generally speaking if you want something to run in the same session, you can put it in a function. So if you have a top-level function that invokes Hello.message twice, then both invocations would be in the same session when that top-level function is invoked.

#

Is that viable for what you're trying with the webhook?

small pelican
#

We are doing something a bit "funky". We are running a service using dagger up. This service creates a container with a Go server that itself uses the Dagger SDK (via dagger.Connect, the container is started with nesting enabled) to create a service that requests are proxied to. Based on what I understood, dagger.Connect is creating a new session within an existing session started by dagger up.

I'll test running only the main.go and see if that creates any problem. It shouldn't

atomic mica
#

I don't think so since what we're basically doing is starting a web server with nesting enabled that allows users to call dagger call on-demand whatever module they want. So those dagger calls will all be using the same dagger session (started by the web server). ๐Ÿ˜ฌ