Skip to content

engine: support registry mirror configs on engine.json - #11040

Merged
matipan merged 2 commits into
dagger:mainfrom
matipan:engine-config-registry-mirrors
Sep 22, 2025
Merged

matipan merged 2 commits into
dagger:mainfrom
matipan:engine-config-registry-mirrors

Conversation

@matipan

@matipan matipan commented Sep 12, 2025 •

Copy link
Copy Markdown
Contributor

Currently registry mirrors can only be configured on engine.toml. This requires users to have to manually provision dagger engines with a buildkit-specific config. In this PR we add support to configuring registries in engine.json directly. With this change users can add their configs on ~/.config/dagger/engine.json and the dagger cli (e.g dagger call) will automatically pick it up when provisioning the engine.

This PR implements only the first step that was described in #4217: CLI only config. There's an active discussion on whether this configuration should be engine wide or scoped to the individual session. The work for that will come in a separate PR. This is the first step that allows us to at least be able to configure it.

Fixes #4217.

@matipan
matipan force-pushed the engine-config-registry-mirrors branch 3 times, most recently from 1a442c2 to 544642d Compare September 12, 2025 19:53
@matipan
matipan marked this pull request as ready for review September 12, 2025 19:55
@matipan
matipan requested a review from a team as a code owner September 12, 2025 19:55
@shykes

shykes commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

@matipan to parahphrase my question in the issue: since we agree that in the future this should be moved from an engine-wide config to a session config, is there a config file other than engine.json that we could use now, to avoid a breaking config change later?

@jedevc

jedevc commented Sep 15, 2025

Copy link
Copy Markdown
Contributor

x-linking #9007.

Are we renaming engine.json entirely? Or are we splitting the functionality across multiple files (which you seemed to dislike back in #9007 (comment)).

If we're renaming the file, my suggestion is to pick a new name (throwing out config.json as a potential option, or even just have a full-on config directory, load all of the JSON files in there) - attempt to read both, but update our docs to point to the new one. Some settings are read per-session, some are per-engine lifetime, but over time, we try and move the implementation to be more per-session.

@jedevc jedevc added the needs/changelog Pull requests that require a changelog entry label Sep 15, 2025
@matipan
matipan force-pushed the engine-config-registry-mirrors branch from 544642d to b22f2ba Compare September 16, 2025 12:34
@matipan

matipan commented Sep 16, 2025

Copy link
Copy Markdown
Contributor Author

@shykes as we discussed in yesterday's meeting, there is no other config file we could use. That said, we wouldn't be introducing breaking changes in the future.

Even if we introduce a new session based config.json I still think we should keep engine.json and allow users to configure things at an engine level. For developers on their machines having a way to configure engines without needing to reprovision it is great. But I'd argue its also great for engine operators to provide an already configured engine that does not need their users providing configs that are applicable to the entire organization. If we provide this configs as part of engine.json as is in this PR, then when we introduce a new session-level config we wouldn't break any API. Users would still be able to provide configuration on engine provisioning, but they would also be able to provide session-based config for things applicable to the session.

@shykes

shykes commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

@matipan I don't think that's how it will go, but we can discuss that separately. Since there is only one config file for now, let's go ahead and merge as-is 👍

As for future evolution of config files, we have some debating to do..

@matipan
matipan force-pushed the engine-config-registry-mirrors branch from b22f2ba to f287ed1 Compare September 22, 2025 14:31
@matipan
matipan requested a review from marcosnils September 22, 2025 14:31
@matipan
matipan merged commit 004f829 into dagger:main Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs/changelog Pull requests that require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support client-side registry configuration of CA+Mirrors

4 participants