json-proxy: Add GetEngineConfig to advertise retry policy#951
Conversation
Basically podman as of recently retries by default, but we can't easily replicate that behavior in the proxy - the "client" needs to handle retries. Expose the engine configuration (with retries) as an API so that projects like containers-image-proxy-rs can honor it. Assisted-by: https://github.com/cgwalters/#llms Signed-off-by: Colin Walters <walters@verbum.org>
mtrmac
left a comment
There was a problem hiding this comment.
Thanks!
Expose the engine configuration (with retries) as an API
Hum, that doesn’t work exactly the same either, because c/common/libimage/copier has another level of defaults, setting a default for RetryDelay. I’m not sure how all these pieces are ideally expected to fit together in Podman / Buildah.
(@Luap99 PTAL at least at the config / defaults reading.)
| // A negative delay is meaningless; treat it as unset (exponential | ||
| // backoff) rather than advertising a nonsensical value to clients. |
There was a problem hiding this comment.
- AFAICS the actual behavior of
c/common/pkg/retryis to treat this as “no delay” (= wait for $delay immediately complete), not as exponential backoff - I’m aesthetically worried about silently replacing invalid data with some other data. It will not be trivial to find out how the value is “lost” if anyone had to dig into it.
Luap99
left a comment
There was a problem hiding this comment.
I am missing the larger picture here, why does the proxy need to care about containers.conf at all? Just use whatever retries you want?
So far containers.conf is used by Podman and Buildah and nothing more.
| // config.Default() memoizes internally, so this is cheap to call here. | ||
| cfg, err := config.Default() |
There was a problem hiding this comment.
I know where little about that proxy but since it is used by skopeo never depended on containers.conf in any way.
This adds a large dependency chain thus to skopeo and makes it care about something it never did before, I do not maintain skopeo so I do not have a strong opinion but it is a design choice that likely should be looked at carefully.
There was a problem hiding this comment.
Oops, yes. That’s pretty likely to be a big issue.
The status quo is documented and I understand the rationale behind it, but from the user PoV at a high level it is kind of confusing (I hope you'd agree) for bootc to read Hmm....we could add retries into |
skopeo does not read this either but does expose retry cli options. containers.conf is documented only to work with podman and buildah so I am not sure why a user would think bootc needs to use it? Practically sharing the config files has both benefits and downsides. It sounds good to have all tools use just one file but then it also means you cannot configure different defaults for different tools.
I think the possible concern there would be that retries are driven by external callers outside of the image module so we would add an option that is not used there at all. |
|
Because I want to inject a config into our CI that forces on more and longer retries for registry operations, and I want that to affect both podman and bootc.
(One can do so by e.g. injecting For a situation in which I'd want them to be different, I think we could also offer CLI flags.
Agree.
At least in the use case in which I want to bump retries, I can't think of a case where I'd want "okay the registry for caching hasn't been responding for 30 seconds, I'm going to rebuild from source instead". |
Or consider a CI job: When run nightly, users never want registry flakes, so giving it many retries 10 minutes apart is fine. When run against developers work (which they can’t test locally), it’s important for the developer to be told “the registry is unreliable now and you are not going to get this done”.
My point really is about the proper location of the configuration — at the use case top level, not as a system-wide config file. I’m sure there are deployments where the two collapse into the same thing, but that does not erase the distinction nor the argument against putting the option in global config files. [Yes, we have it in |
Basically podman as of recently retries by default, but we can't easily replicate that behavior in the proxy - the "client" needs to handle retries.
Expose the engine configuration (with retries) as an API so that projects like containers-image-proxy-rs can honor it.
Assisted-by: https://github.com/cgwalters/#llms