#Remote builder

1 messages Β· Page 1 of 1 (latest)

prisma wasp
#

Short answer: not at the moment but there is an experimental setting that WILL break in the future

dry wing
#

Ok, not even if I define the environment variable BUILDKIT_HOST?

prisma wasp
#

correct. there is _EXPERIMENTAL_DAGGER_RUNNER_HOST which will work the same way. It works today but WILL break in the future once wr introduce the final version of this feature

dry wing
#

TL;DR I'm deploying a build system that is running on AWS ECS and can't run buildkit, so we deployed a CoreOS stack with buildkitd as a container in podman.... That is running on an internal DNS record. I'm looking to replace my custom Go program with Dagger

#

I mean, it will break in the final - but if I have some decent tests I should see that right? I'm running a test stack with a local docker-compose.yaml that runs both the Go program and buildkit...

#

Also, is there existing documentation on configuring the clients (other than the Go docs)?

prisma wasp
#

let me get to a real keyboard πŸ™‚

dry wing
#

(btw, love what you are doing - I completely understand the speed and nature of the project - don't want to sound ungrateful)

slow anchor
prisma wasp
#

What Erik said πŸ‘†

dry wing
#

Honestly, Dagger simplified almost all of my Go code... so that is πŸ₯³

prisma wasp
#

Basically we are in a state of transition between architectural models. While we make the transition, we don't people to be stuck, hence the experimental setting.

dry wing
#

I'll probably just use that experimental feature and see if I can write a good integration test for if/when it changes

#

Yeah, I tried the alpha of Dagger and it was good - but this approach is a huge improvement

#

So πŸ‘ on the work being done to the team

prisma wasp
#

@dry wing the important thing to understand is that, in the new model we are moving towards, dagger will not support swapping out buildkit. Going forward we consider buildkit to be an internal component. This is because some of Dagger's features require tight control over the version, build and configuration of buildkit to work properly.

#

So we will never support BUILDKIT_HOST for that reason. But we will support something equivalent

#

Another reason for this, probably most important: the dagger runner API may in the future extend to be not just a pass-through of the buildkit API, but a superset of it

dry wing
#

Hmmm, that is interesting... since its being considered an internal component... Doesn't that limit the deployment options for Dagger SDKs? Internal assuming that it needs to be installed on the same machine/container of the SDK?

prisma wasp
#

We ship the Dagger engine as an OCI image. So you can provision it yourself in the manner you prefer, then configure your clients to connect to it. This is the feature being developed now.

#

Of course under the hood it’s still buildkit plumbing so all works roughly the same

#

So buildkit is internal to that engine, not to the client SDK

spark niche
#

Since the dagger image is a superset of the buildkit image (we build on top of buildkit, but we have extra stuff on top)

slow anchor
dry wing
#

Ok, but when using the Go SDK... I'm not using the Dagger image... at least I have not reach the "deploy my code that uses the SDK" yet so maybe that is where I would using the image?

spark niche
dry wing
#

Sorry if these questions seem kind of silly

spark niche
#

If that makes sense

dry wing
#

I think I get it... right now I have a server running buildkit and exposing as a TCP service... I would instead replace that with a container running the dagger image, which internally houses buildkit as the internal dependency

dry wing
#

So really what I should be doing is dropping the buildkitd service and replacing it with a container exposing the Dagger container - then the Go SDK would use the remote builder option to connect and run the builds

#

If that is right, thank you all for the rubberduck session - I also just finished the buildkit coreos build last night - easy enough to swap out though πŸ˜‰

dry wing
spark niche
dry wing
slow anchor
slow anchor
# dry wing I'm browsing the docs now - thank you... I think the only thing I am missing is ...

I'm browsing the docs now - thank you... I think the only thing I am missing is how to run the dagger instance as a container (e.g. exposing it over TCP). Buildkit has this section (https://github.com/moby/buildkit#expose-buildkit-as-a-tcp-service) but I'm not sure what the equivalent would be on the dagger image?
Yeah that's currently where you'll have to be willing to engage in some DIY if you want to go that route. Currently the entrypoint to the dagger engine image is just buildkitd, so you can configure buildkitd to listen on a tcp socket with flags there (see buildkitd --help or those docs you linked to). That again is something subject to breakage at any point.

However, if it's possible for your use case, a likely better route would be to use a different conn type like podman-container:// (or docker-container:// orkube-pod://). If you use those, you don't have to change the buildkitd configuration at all. You can just start the dagger engine image in podman (or docker or k8s) and just point your client to it by the container name.

dry wing
#

Ok perfect, I'll just adjust that to use the flags I linked - thank you all again!!

prisma wasp
#

@dry wing while I'm at it, I'll flag an evolving best practice: you can wrap your dagger client with dagger run. For example dagger run python myscript.py or dagger run my-custom-tool. You can use this as a reliable way to "inject" the desired configuration into your dagger session.

For example:

_EXPERIMENTAL_DAGGER_RUNNER_HOST='podman-container://my-dagger-engine' dagger run my-tool

This will be the recommended way to run dagger clients in production going forward. We will add various configuration options, available not only by env variables but also CLI flags and config file.

#

It's not mandatory - you can also run your tool directly as you already do. But we anticipate that in the long run, it will be more practical and more reliable to use the dagger run wrapper, at least in production

dry wing