mozilla-services / Dockerflow

Cloud Services Dockerflow specification
Apache License 2.0
195 stars 28 forks source link

Base circleci cache key on git sha #57

Closed sciurus closed 3 years ago

sciurus commented 4 years ago

This should prevent the issue of one workflow loading the cache from another when running concurrently that is described in #44

sciurus commented 4 years ago

We've run some builds using this in https://github.com/mozilla-services/topsites-proxy/pull/49 without any apparent problems.

sciurus commented 4 years ago

Although this fixes the issue, I'm not sure the cache is the right circle ci concept to use here. I think the cache is intended for save things you can reuse across workflows, and the workspace is intended for things you can reuse across builds within a single workflow.

https://circleci.com/blog/persisting-data-in-workflows-when-to-use-caching-artifacts-and-workspaces/

See how normandy uses the cache for nodejs modules: https://github.com/mozilla/normandy/blob/ff632c6a57b50d82d09330727c82c4383579c0ee/.circleci/config.yml#L39-L50

But normandy uses the workspace for the docker image: https://github.com/mozilla/normandy/blob/ff632c6a57b50d82d09330727c82c4383579c0ee/.circleci/config.yml#L80-L105

g-k commented 3 years ago

Yeah, workspaces are a better fit.

On Wed, Sep 16, 2020 at 1:23 PM Brian Pitts notifications@github.com wrote:

Although this fixes the issue, I'm not sure the cache is the right circle ci concept to use here. I think the cache is intended for save things you can reuse across workflows, and the workspace is intended for things you can reuse across builds within a single workflow.

https://circleci.com/blog/persisting-data-in-workflows-when-to-use-caching-artifacts-and-workspaces/

See how normandy uses the cache for nodejs modules: https://github.com/mozilla/normandy/blob/ff632c6a57b50d82d09330727c82c4383579c0ee/.circleci/config.yml#L39-L50

But normandy uses the workspace for the docker image: https://github.com/mozilla/normandy/blob/ff632c6a57b50d82d09330727c82c4383579c0ee/.circleci/config.yml#L80-L105

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mozilla-services/Dockerflow/pull/57#issuecomment-693547952, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXKLOR4IKMQBPK3DRK3FLSGDYAVANCNFSM4RPEVX4Q .