#"dagger run" hangs forever

1 messages · Page 1 of 1 (latest)

drifting island
#

For some reason, when I run the following code using dagger run, after successfully printing the result, the tool never exist - it just hangs there, counting seconds, until it receives a kill signal:

# dagger-simple.exs

Mix.install([{:dagger, github: "dagger/dagger", sparse: "sdk/elixir"}])

client = Dagger.connect!()

client
|> Dagger.Query.container()
|> Dagger.Container.pipeline("Pipeline", description: "A simple pipeline")
|> Dagger.Container.from("alpine:3.18.2")
|> Dagger.Container.with_exec(~w(echo Example!))
|> Dagger.Container.stdout()
|> IO.inspect()

Dagger.close(client)

I run the above code like this:

DOCKER_HOST=ssh://local-linux-box dagger run elixir dagger-simple.exs

Why would this hang? What am I missing?

Trivia:

  • dagger v0.6.3 darwin/amd64
#

cc @grave carbon

Sorry for a tag, you're the only one I know who use Dagger with Elixir 😅 Though maybe this particular issue is not Elixir-specific

grave carbon
#

Just woke up 👋.

#

The code is looks fine.

#

Let me check in a few hours. 😊

south phoenix
#

@drifting island does it also happen with v0.6.4?

last ruin
grave carbon
#

I try it with Docker Desktop, it looks fine:

$ elixir test.exs
Connected to engine c98af681a67a
#1 resolve image config for docker.io/library/alpine:3.18.2
#1 DONE 5.0s

#2 Pipeline
#2 DONE 0.0s

#3 from alpine:3.18.2
#3 resolve docker.io/library/alpine:3.18.2@sha256:82d1e9d7ed48a7523bdebc18cf6290bdb97b82302a8a9c27d4fe885949ea94d1 done
#3 sha256:8c6d1654570f041603f4cef49c320c8f6f3e401324913009d92a19132cbf1ac0 0B / 3.33MB 0.2s
#3 sha256:8c6d1654570f041603f4cef49c320c8f6f3e401324913009d92a19132cbf1ac0 3.33MB / 3.33MB 0.5s done
#3 extracting sha256:8c6d1654570f041603f4cef49c320c8f6f3e401324913009d92a19132cbf1ac0 0.1s done
#3 DONE 0.6s

#2 Pipeline
#2 0.142 Example!
{:ok, "Example!\n"}
#

I suspect that the issue would be DOCKER_HOST?

last ruin
grave carbon
#

So that if we use docker command, like ps, the docker should not working also?

last ruin
drifting island
#

I was just able to confirm everything works as expected if I SSH into the local machine, and run dagger CLI (v0.6.3) from there

south phoenix
#

DOCKER_HOST=ssh://local-linux-box dagger run elixir dagger-simple.exs should be something that works though.. I'd wait for the v0.8.1 release which should go out anytime soon today and try again 🙏

drifting island
#

btw checked the tcp:// too & engine v0.6.4. it hangs at the end of executing my simple elixir code - too

grave carbon
#

@drifting island Did you try on dagger 0.8.1 ?

drifting island
#

I have tried 0.8.1, currently using 0.8.2 and still seeing the same issue 😦