circleci-orb icon indicating copy to clipboard operation
circleci-orb copied to clipboard

Allow multiple cache keys

Open bbugh opened this issue 6 years ago • 5 comments

We are exploring this orb for a Rails and Vue app. bundle for gems can take quite a while since we have some native gems that require a build process. Unfortunately, with this orb, there does not seem to be any way to use the bundler cache that we produce as part of our workflow.

I imagine the feature would look like this:

workflows:
  build:
    jobs:
      - cypress/run:
          yarn: true
          cache-keys: 
            - 'yarn-packages-{{ arch }}-{{ checksum "yarn.lock" }}'
            - 'bundler-{{ arch }}-{{ checksum "Gemfile.lock" }}'

bbugh avatar Aug 02 '19 14:08 bbugh

Bump.

Same here. Our company uses React on Rails and we were trying to use this orb to update our circle configuration. We cache our gems as well and our yarn dependencies in separate caches so we're not currently able to grab the cache-keys for the multiple caches we have.

juliusdelta avatar Sep 26 '19 16:09 juliusdelta

I would love someone to implement this, because I am not sure how it would work - don't you need to implement different paths to cache, for example?

bahmutov avatar Sep 26 '19 16:09 bahmutov

We have a need for this as well. @bahmutov is it possible to simply expose Circle's native save_cache and restore_cache parameters directly? That would handle multiple keys as well as multiple paths.

atsepkov avatar Jun 05 '20 16:06 atsepkov

You can look at the src/orb.yml to see how to implement this, maybe it’s not too bad

Sent from my iPhone

On Jun 5, 2020, at 12:19, Alexander Tsepkov [email protected] wrote:

 We have a need for this as well. @bahmutov is it possible to simply expose Circle's native save_cache and restore_cache parameters directly? That would handle multiple keys as well as multiple paths.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

bahmutov avatar Jun 05 '20 16:06 bahmutov

Slightly different, but due to the cache key inflexibility, it's also preventing developers from using fallback cache keys to improve the cache hit rate and improve build times further.

For example, the node orb allows this: https://github.com/CircleCI-Public/node-orb/blob/b6951b9d4f5afda3baa3f38e0d84f94941ba06c9/src/commands/install-packages.yml#L70-L72

RyanofWoods avatar Jan 09 '23 14:01 RyanofWoods