#Jenkins and Kubernetes

1 messages · Page 1 of 1 (latest)

earnest salmon
#

Hi, I'm trying to run dagger engine as a container service on a Jenkins instance with Kubernetes (connected using Kubernetes plugin)
Here's an example of the declarative pipeline (posted in second thread)

Here I'm trying to create dagger as a separate container in the same pod and have another pod compile the CI code and run it, I've tried setting numerious URLs for the _EXPERIMENTAL_DAGGER_RUNNER_HOST but none of them seems to connect properly

All I keep getting is this
Error: buildkit failed to respond: failed to list workers: Unavailable: connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:2376: connect: connection refused"
EOF: Error: buildkit failed to respond: failed to list workers: Unavailable: connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:2376: connect: connection refused"

So my question is, is such setup possible? if so what's the proper way to connect here? Does dagger-engine expose some sort of tcp port that is not 2376?

trim charm
#

looks like the docker daemon isn't running or is not accessible on 127.0.0.1:2376

#

one alternative would be to use Podman (which is daemonless) instead of Docker, but I understand that it doesn't really solve the issue

jagged goblet
jagged goblet
#

I am seeing kube-pod://\$MY_POD_NAME?&container=dagger in the attached Jenkinsfile

#

Having looked through the code, I am not entirely certain that this works as documented. Still digging.

earnest salmon
#

Ok I think I made it work, basically kube-pod is not an option here since it appears to rely on kubectl and even if I download that I'm lacking permissions (service-account inside the pod)

tcp + docker-container params did not work as I'm not totally familiar with how these work to connect and how's dagger is supposed to run from the other side

In the end I just created a shared emptyDir volume to mount the dagger buildkit socket and used unix:///run/buildkit/buildkitd.sock path

Uploaded updated jenkinsfile for future references

earnest salmon
#

And another question if it's possible to continue with this thread, what are my options for better logging of dagger inside jenkins? I'm looking at what this generated so far and it seems that part of it is omitted, are there any visualization solutions that I can use here perhaps? or different settings for a verbose logging?

vast lintel