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

Want to understand what's the best value for artifact_maximum_age for CI runs. #235

Open
anuragstar opened this issue Feb 6, 2024 · 3 comments

Comments

@anuragstar
Copy link

anuragstar commented Feb 6, 2024

My integration setup

[ ] CocoaPods cocoapods-xcremotecache plugin
[x] Automatic integration using xcprepare integrate ...
[ ] Manual integration
[ ] Carthage

Expected/desired behavior
@polac24 We are trying to run XCremote cache for our project want to understand what's the best value to configure for artifact_maximum_age on CI

Minimal reproduction of the problem with instructions

Producer Logs

 [REPLACE THIS WITH YOUR INFORMATION] 

Consumer Logs

 [REPLACE THIS WITH YOUR INFORMATION] 

Pods/Carthage file

 [REPLACE THIS WITH YOUR INFORMATION] 

Environment

  • XCRemoteCache: X.Y.Z
  • cocoapods-xcremotecache: X.Y.Z <!-- check with gem list cocoapods-xcremotecache >
  • HTTP cache server: ... <!-- e.g. demo docker, nginx, AWS etc. >
  • Xcode: X.Y.Z

Post build stats

 [REPLACE THIS WITH YOUR INFORMATION] 

Others

@polac24
Copy link
Collaborator

polac24 commented Feb 7, 2024

artifact_maximum_age is introduced to cleanup you local cache at ~/Library/Caches/XCRemoteCache/. To find the best value, you should find the sweet spot between local disk cache storage and limiting network traffic load.

In practice, the default 30d should be a long enough time and I wouldn't suggest to worry about it, unless the size of ~/Library/Caches/XCRemoteCache/ skyrockets.

So if you set artifact_maximum_age to 30, as a very early step of xcprepare, XCRemoteCache iterates over all artifacts available locally (~/Library/Caches/XCRemoteCache/) and removes files that have been deleted more than 30d ago. As the location suggests, that is only a local cache: if an artifact file is removed locally but still required, it will be redownloaded on-demand.

@anuragstar
Copy link
Author

@polac24 want to understand if it is cache on the CI machine - ~/Library/Caches/XCRemoteCache/ , If the XCRemote fetches few artifacts, will the new artifacts will be overrided ?, there won't be any risk builds will be compiled from local caches present on the CI machines ?

@polac24
Copy link
Collaborator

polac24 commented Feb 8, 2024

~/Library/Caches/XCRemoteCache/ is just a mirror of all GET requests made in the consumer mode. If you use the consumer mode on CI, it will be populated on CI too. Note that only consumer mode downloads artifacts. Producer, as name suggests, always build artifacts from scratch.

If the XCRemote fetches few artifacts, will the new artifacts will be overrided ?
it will not download an artifacts if is available locally

there won't be any risk builds will be compiled from local caches present on the CI machines ?
XCRemoteCache is not aware of CI/local, only consumer/producer. Probably you mean CI=producer - then no risk, as producer never reads anything from local or remote cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants