Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current cache-from configuration format doesn't allow for cache types #194

Open
purajit opened this issue Aug 3, 2024 · 2 comments
Open
Assignees
Labels
backlog Identified as a backlog item, often combined with low-priority and help-wanted labels enhancement New feature or request

Comments

@purajit
Copy link

purajit commented Aug 3, 2024

Orb version

Current

What happened

When using cache-from: type=registry,ref=<registry>/<repo>:<tag>, I see

Pulling type=registry
invalid reference format
Pulling ref=ref=<registry>/<repo>:<tag>
invalid reference format

and essentially no caching behavior is observed.

Expected behavior

The entire argument should be taken as a single cache-from argument, instead of being split on the comma with
each part assumed to be a different cache source. I'd suggest accepting a list. This behavior is extremely unexpected
while trying to use this orb, and is a sufficient enough blocker to not use it at all.

Am I missing anything with how to use this config? I read through the code as well.

@purajit purajit changed the title Current cache-from/to configuration format doesn't allow for cache types Current cache-fromconfiguration format doesn't allow for cache types Aug 3, 2024
@purajit purajit changed the title Current cache-fromconfiguration format doesn't allow for cache types Current cache-from configuration format doesn't allow for cache types Aug 3, 2024
@marboledacci marboledacci self-assigned this Sep 9, 2024
@marboledacci marboledacci added enhancement New feature or request backlog Identified as a backlog item, often combined with low-priority and help-wanted labels labels Sep 9, 2024
@marboledacci
Copy link
Contributor

The cache_from here is designed to work directly with type=registry, which is the default, so you would only need to specify the registry not the type, for example cache-from: mydockerimage:cache.
I like the idea of having this parameter as a list, to allow the use of the other cache types, but for now that is a low priority functionality as most people uses only the registry type.
For your example I suppose you are also using type registry, if you are using other type let me know, and we can prioritize this higher.

@purajit
Copy link
Author

purajit commented Sep 10, 2024

Gotcha, yeah we're using registry caches, but this still prevents using other parameters like mode, image-manifest, oci-mediatypes, which are pretty critical (especially for multi-stage builds).

We resolved our issues by inlining our docker build instead, since we didn't want to rely layers of updates and abstractions, but if this arg is going to be useful, I think adhering to standard syntax is a must.

(Or, the limitations should be documented)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Identified as a backlog item, often combined with low-priority and help-wanted labels enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants