How do predefined caches work on pipelines?

Ben
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 7, 2017

I see there are predefined caches in pipelines now...that's great.  We are using maven, so I'll use that as an example here.

I am, however, unclear on how they work. I could see it one of two ways. 

  1. The predefined maven cache comes pre-populated with some well-known subset of maven central and is shared among all users, and is not updated by the build process at all.
    • pro: shared caching.
    • con: depends on Atlassian to update that cache with new versions as they are released by the community. This was often a pain point for us on Bamboo Cloud with the predefined images (but more wrt tools like java or mvn itself in that case).
    • requires additional cache defined for our own artifacts, which we can define as 
      maven-corporate: ~/.m2/repository/our/corporate/package
  2. It is just a predefined definition, and the cache is actually populated on every repo's build so it include everything that we put into that maven local repository, including stuff from maven central, but also stuff we get from our own corporate repository.
    • pro: everything cached in one place.
    • con: population of the cache for common maven dependencies/plugins is still downloaded from our own corporate artifact repository.
    • con: potential privacy/security concern that our corporate artifacts are cached. (more information on this issue is appreciated in the docs at well).

I've been trying to configure it assuming option #1 above, but it does not seem to work properly -- or at least the reported cache size is very small (eg <900 B), so I don't think it is working based on that.

It would be nice if the documentation of Pipelines Caching were updated with more details, about this issue and all around.

1 answer

1 accepted

1 vote
Answer accepted
xtjhin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 12, 2017

Hi Ben,

Thanks for your question.

Pre-defined caches work like you described as 2. They are just a convenient mapping of commonly cached directories so that users won't need to define them. Indeed they'll cache the entire m2 repository.

Caches are private to the repo. Could you describe your security requirements a little further?

Re: caches being <900B, looks like we have an issue where for some Docker images, caches are saved empty. The dev team are looking into.

Thanks for the feedback, I'll update our documentation to clarify this.

Ben
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 12, 2017

Thanks for the response.

Our security concerns are just born out of this line the docs:

  • Sensitive data such as passwords and credentials – cache contents are available to commands in the steps of pipelines.

To me, this implies that there is a security risk with the caching, but perhaps no more so than any other part of our source code and artifacts being available to pipelines, so I'm sure it's fine.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events