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

Standardize Cache Flag options #1077

Closed
8 tasks done
dwillist opened this issue Feb 17, 2021 · 10 comments
Closed
8 tasks done

Standardize Cache Flag options #1077

dwillist opened this issue Feb 17, 2021 · 10 comments
Assignees
Labels
good for mentorship A good issue for a mentorship project. type/enhancement Issue that requests a new feature or improvement.
Milestone

Comments

@dwillist
Copy link
Contributor

dwillist commented Feb 17, 2021

Description

We have received a couple different requests for functionality around the flexibility of the .build cache. These have all been implemented by adding additional flags to the pack cli. and as a result we have --cache-image and --cache-name? (pending) to specify the build cache type & name.

It feels like we might want consolidate this behavior to use more descriptive flags to make these combinations both easier to understand & extensible.

Proposed solution

Flags can be specified in a way similar to the --mount option for docker.
Possible Flags:

pack build ... --cache 'src_type=volume,src=<VOLUME-NAME>,dst_type=remote_image,dst=<IMAGE-PATH>

Additional context

  • This feature should be documented somewhere

Related issues:
#1024
#665
#317


Update (2022-06-15)

Since this issue was opened an RFC was created and approved.

The following are tasks that need to be implemented in order to consider this issue resolved:

@dwillist dwillist added type/enhancement Issue that requests a new feature or improvement. status/discussion-needed Issue or PR that requires in-depth discussion. status/triage Issue or PR that requires contributor attention. labels Feb 17, 2021
@ekcasey
Copy link
Member

ekcasey commented Feb 18, 2021

@dwillist Not sure I am following this. How can the cache src be a volume but the cache destination be a remote image?

@dwillist
Copy link
Contributor Author

@ekcasey I would expect using the --cache-dir argument for the analyzer and restorer would allow pulling info from a mounted cache volume, then using a --cache-image flag for the exporter would cause the lifecycle to push the cache as a remote image. Am I missing something?

@ekcasey
Copy link
Member

ekcasey commented Feb 19, 2021

@dwillist ahhh gotcha. I hadn't thought about that use case (migrating caches) but I think it would work fine from a lifecycle perspective if you use the individual phase. With creator (trusted builders), this would not work because we don't accept different inputs for source cache and destination cache. creator would need to be changed to support this.

If we did something like this I think it would be important to have good defaults. As a user --cache-volume my-cache feels easier (to remember, type, autocomplete) than --cache 'src_type=volume,src=my-cache,dst_type=volume,dst=my-cache but if --cache my-volume worked (because we default src_type to volume and default the dst and dst_type to match src and src_type etc.) the proposed optionality would be great.

@jromero jromero added status/requires-rfc Issue or PR that requires an RFC to be filed. and removed status/triage Issue or PR that requires contributor attention. status/discussion-needed Issue or PR that requires in-depth discussion. labels Mar 3, 2021
@jromero
Copy link
Member

jromero commented Mar 24, 2021

An additional use case for this feature with Bitbucket (via slack):

image

image

Links:

@jromero
Copy link
Member

jromero commented Mar 25, 2021

@dwillist I've started an RFC. Would love to get your contributions in there.

buildpacks/rfcs#149

@jromero jromero added status/ready Issue ready to be worked on. and removed status/requires-rfc Issue or PR that requires an RFC to be filed. labels Aug 18, 2021
@jromero
Copy link
Member

jromero commented Aug 18, 2021

This is ready to implement as per RFC#0091

@Nivedita-coder
Copy link

Hi @jromero @dwillist, I want to contribute to this project for GSoC 2022, can you guide me on how can I get started with this project? Thanks!

@jromero jromero added status/blocked Issue or PR that is blocked. See comments. and removed status/ready Issue ready to be worked on. labels Feb 16, 2022
@jromero
Copy link
Member

jromero commented Feb 16, 2022

Setting status to blocked, since this issue was submitted to Google Summer of Code. This is scheduled to be worked on by a mentee.

@jromero
Copy link
Member

jromero commented Feb 16, 2022

Hi @Nivedita-coder 👋 ,

Nice to see you here. I'd be more than happy to show you around.

If you can, could you reach out to me over in the CNCF slack? My username there is @jromero. Also, we have #buildpacks-mentoring channel if you have more general questions regarding Google Summer of Code.

@rahulsurwade08
Copy link

Hey @jromero, I want to contribute for this project in GSoC 22, I have setup pack locally and already started playing with it.
Can you guide me regarding caching options that are being in evaluation and the expectations for this project?

@jromero jromero removed the status/blocked Issue or PR that is blocked. See comments. label Jun 27, 2022
@jromero jromero moved this from Todo to In Progress in GSoC 2022: Nitish Gupta Jun 27, 2022
@jromero jromero added this to the 0.28.0 milestone Aug 16, 2022
@jromero jromero closed this as completed Sep 14, 2022
Repository owner moved this from In Progress to Done in GSoC 2022: Nitish Gupta Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good for mentorship A good issue for a mentorship project. type/enhancement Issue that requests a new feature or improvement.
Projects
Status: Done
Development

No branches or pull requests

6 participants