Repository navigation
feat: custom dagger config file - #8800
Conversation
Yep SGTM, will make it easier to interop with our API potentially too.
Sounds great enough to me 😄
Good questions, but to start I'd probably just make the file configuration be the config when the engine starts and anything applied at runtime is just maintained in memory. Persistence would be potentially useful but can be layered on later once needed.
Probably doesn't hurt, informational if nothing else. |
c540ec7 to
d200e58
Compare
d200e58 to
c8d6a19
Compare
|
I've ported a few of the most interesting configs:
However, a couple questions on some of the others:
I think the end goal is that we would be able to spin up a dagger engine entirely from this config file, and ideally avoid the need to manually start and manage an engine container out-of-band. |
|
Also wanted to note that this is also interesting in the context of external compute providers #5583 (and other associated issues). Some of these settings might be interesting for remote compute - others don't make sense. E.g. it doesn't make sense to configure engine logging, security settings or even gc in the context of a remote provider - those would be the responsibility of the provider. But allowing configuration of proxy settings, or registry settings does feel useful - would we maybe want to go the direction of having a single engine config file for all of this, so users could easily take their existing local config to a compute provider? |
c8d6a19 to
b85b061
Compare
Love what I'm reading here! I would indeed be awesome to be able to set up proxies and CA certificates this way so we don't have to maintain our own version of the engine. My ask is make the config location configurable via ENV. Something like
Yes, at least in my case I need http_proxy. But something that I know I'll need in the future is GOPROXY. So it makes sense to allow configuring arbitrary env vars. |
I wonder if it would make sense to also mount the Idea: adding a symlink of those into the This could be a nice UX to centrally declare how / when to mount those for #8809, and #8766 |
Okay, I have decided that conceptually, these config options probably don't belong engine wide - I think these should somehow only be session-wide - #8766 (comment). I'm still not sure of the exact config mechanism (it might even be something like A couple reasons why:
Anyways, I think it's ambiguous enough that I don't want to put it in this PR, and might try and do it separately. |
67198ec to
d9b5682
Compare
fb8cf57 to
97101a7
Compare
|
This is now ready-for-review - however, the new We've previously discussed this in #t-infrastructure before, but we should try and find a longer term solution. If we can't, this suite can be split out and run on the |
9e0f6aa to
7941e0c
Compare
7941e0c to
6ba0c43
Compare
ecd80d1 to
8a9763c
Compare
|
Worked around the https://dagger.cloud/dagger/traces/7a505333193220b491e0d2dd6a919032#28ff250b26c960f1 |
sipsma
left a comment
There was a problem hiding this comment.
Couple nits but LGTM overall!
| } else if !errors.Is(err, os.ErrNotExist) { | ||
| fmt.Println(err) | ||
| return nil, errors.Wrapf(err, "could not stat config at %s", engineConfigPath) |
There was a problem hiding this comment.
I feel like there could plausibly be some other errors worth ignoring here, especially since this code runs on linux/macos/windows (e.g. permission errors). Maybe it would be safest to just always print the error but ignore it? At least for now? Just don't want the engine to become unstartable due to us missing some obscure error handling on one of the platforms.
There was a problem hiding this comment.
Yeah, fair! Just changed this to be a logging statement for now.
8bcef17 to
4d8abf6
Compare
Signed-off-by: Justin Chadwell <[email protected]>
This PR adds a custom engine config file for dagger - this doesn't *currently* replace our existing buildkit `engine.toml` (that format will still continue to work). However, our custom engine config should be the preferred way to edit config moving forwards. By detaching ourselves from the upstream buildkit toml config, we can do a few important things that we couldn't easily before: - Keep the config clean and relevant to what we do - we don't need config items for multiple oci/containerd workers, configuring buildkit frontends doesn't make sense, we don't expose the history API, etc. - Add our own config properties for the engine, instead of needing to hack it using lots of environment variables. - Document our own config format! We can ideally document this using JSON schema. Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
4d8abf6 to
a50fcc5
Compare

This PR adds a custom engine config file for dagger - this doesn't currently replace our existing buildkit
engine.toml(that format will still continue to work).However, our custom engine config should be the preferred way to edit config moving forwards. By detaching ourselves from the upstream buildkit toml config, we can do a few important things that we couldn't easily before:
TODO:
insecureRootCapabilitiescontrol)Registry settings(this should instead be part of Session config file #9007).config/daggerinto newly created engineengine.json#9022)Bikeshedding topics:
engine.jsonto start, but that's not a great name.dagger core engine ...? (suggested by @sipsma in feat: use new cache policies #8725 (comment))engineVersionhere? Might be good for backwards compatibility (we could ignore it for time being, and introduce compat checks later?)