#dagger hang with running with service binding

1 messages Β· Page 1 of 1 (latest)

hoary umbra
#

I have try to binding redis as a service binding by invoke graphql directly with dagger query and found that its hang when run it. Here is script:

#!/bin/bash

container_id=$(dagger query <<EOF | jq -r .container.from.withExposedPort.id
query{
  container{
    from(address:"redis"){
      withExposedPort(port:6739){
        id
      }
    }
  }
}
EOF
)

dagger query <<EOF
query{
  container{
    from(address:"redis"){
      withServiceBinding(alias:"redis-srv",service:"${container_id}"){
        withEntrypoint(args:["redis-cli","-h","redis-srv"]){
          withExec(args:["set","foo","abc"]){
            withExec(args:["save"]){
              stdout
            }
          }
        }
      }
    }
  }
}
EOF

I have been stuck with this before but I don't remember why it stuck. facepalm

sweet holly
#

Did you mean port 6379? πŸ™‚ I think it's hanging because it's waiting to health-check port 6739, but Redis's default port is 6379.

#

The UX here could definitely be improved. You might see health check progress if you re-run with --debug, but I'm not sure if that has shipped yet.

#

Might change it to just log directly to the output, so you don't have to remember to do that.

astral igloo
#

I was actually looking at this and also missed the port thing. facepalm . Thx Alex πŸ™. Just tried it and changing the port works πŸš€

hoary umbra
#

Ouch, code at midnight 😭.

hoary umbra
#

The debug is very helpful. ❀️

#

The original issue come running service binding in Elixir SDK an curious why its hang. This could be great if we support healthcheck on plain text mode. πŸ˜„

astral igloo
hoary umbra
#

Oh. Is that landed into dagger main branch?

astral igloo
hoary umbra
#

Thank you @sweet holly @astral igloo

astral igloo
#

did you find the issue @hoary umbra !?

hoary umbra
#

The problem is now solved. πŸ™‚

astral igloo
#

πŸš€