Closed
Description
What are you trying to do?
- I'm trying to achieve a workflow where dev machines could spin up dagger engine as the state can shared on buildkit.
- I would like to avoid using Docker to spin up Buildkit.
- I'm okay with the responsibility of directly having to maintain buildkit - although it would be nice if Dagger could have links to Buildkit docs for operational concerns like scaling, caching, etc.
Why is this important to you?
I think Docker should remain an optional dependency for Dagger.
Note: this was supported in v0.3.x but recent changes(from v0.4.0 I think?) seem to have stopped picking BUILDKIT_HOST .
How are you currently working around this?
I think this could be a viable solution : #3938
Metadata
Metadata
Assignees
Labels
No labels

Activity
sipsma commentedon Nov 21, 2022
@RealHarshThakur Thanks for reaching out and filing this issue!
We are thinking about the best way to approach our support for this in the short term and will update you when we have a decision soon.
Two questions right away though:
tcp://to connect to the remote buildkit. Do you need to also configure TLS certs to connect to it? Or do you just want to use plain tcp?moby/buildkitimage and now have a few customizations that require our own image. Will that work for you provided we give you a stable image repo + tags to pull from?moby/buildkitfor whatever reason?RealHarshThakur commentedon Nov 22, 2022
Thanks @sipsma for getting back.
Plain tcp works.
No, happy to run and operate the fork.
Yep.
morlay commentedon Dec 7, 2022
With #3938, (@RealHarshThakur, Thanks)
Engine could start before all jobs in code.
In this way, I could be easy to migrate cue version of dagger in my CI (just buildkit in k8s, without docker in job runner)
Engine image is not necessary.
sipsma commentedon Dec 7, 2022
@morlay The engine image will be necessary for running any execs (on go sdk version v0.4.1 and above). We bundle a binary in the image that we use as a shim for redirecting stdio (among other things). It won't work with vanilla
moby/buildkitanymore. We expect that divergence to grow over time too as we add more custom features, so it's not just temporary.We're working on figuring out the path to supporting provisioning outside of docker here currently (but may need to break that out into separate issues depending on the direction it goes).
morlay commentedon Dec 7, 2022
@sipsma Got it.
Could I use
ghcr.io/dagger/enginewith mounting/etc/buildkit/buildkitd.toml?Just for exposing tcp address, registry mirrors settings, and gc settings.
If it could, I really hope #3938 could be landed ASAP.
it is the only block for me to migrate from
dagger-cue.Graph of @RealHarshThakur is my use case too.
Shared
buildkit(dagger/engine) will be speed up the CI with controllered caches.RealHarshThakur commentedon Dec 7, 2022
@morlay I think that PR won't go through as there are different plans but I'm confident Dagger team will make it easy support our use-case. I'm on v0.3.x until it's officially sorted out
morlay commentedon Feb 17, 2023
@RealHarshThakur
Now we could use
_EXPERIMENTAL_DAGGER_RUNNER_HOST=tcp://<engine_service_host>:1234to connect remote dagger engineJust run the engine with custom
buildkitd.tomland mount to/etc/dagger/engine.tomlRealHarshThakur commentedon Feb 17, 2023
Nice! I haven't migrated over yet to the newer version but thanks for pointing out. Out of curiosity, how are you hosting the engine? Personally, I've this setup on Kubernetes deployment behind a LB in round-robin mode.
From what you showed above, it looks as simple as changing the image. From the initial setup, I found that each Buildkit pod can only handle one request at a time i.e if a second build request arrives, the second build will fail. We're working on setting up HPA which triggers scaling based on CPU usage but I wonder if there's a more reliable metric. I assume the challenges will lie with Dagger engine too.
morlay commentedon Feb 18, 2023
Just k8s deployments and simple service
I have not seen this issue. Maybe becasue of my buildkit configuration.
https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md
Btw each buildkit instance has a lockfile at
root, so I need to set my deployment when mount HostPath / PVCRealHarshThakur commentedon Feb 18, 2023
Thanks @morlay. Gonna try that out.
RealHarshThakur commentedon May 5, 2023
I've been using self-hosted dagger engine for some time now- closing this. Thanks team :)