renovatebot / config-help

Please use the Discussions feature of https://github.com/renovatebot/renovate instead
https://github.com/renovatebot/renovate/discussions
MIT License
27 stars 16 forks source link

How to setup caching between executions #932

Closed candrews closed 4 years ago

candrews commented 4 years ago

Which Renovate are you using?

Renovate Open Source CLI

Which platform are you using?

GitLab self-hosted

Have you checked the logs? Don't forget to include them if relevant

What would you like to do?

I'd like my GitLab job to appropriately cache data between runs so each job runs faster: https://docs.gitlab.com/ee/ci/yaml/README.html#cache

Here's my .gitlab-ci.yml:

renovate-run:
  stage: build
  services:
    - docker:dind
  variables:
    DOCKER_HOST: "tcp://docker:2375"
    DOCKER_TLS_CERTDIR: ""
  image: renovate/renovate
  script:
    - renovate

I think I need to enable persistRepoData in config.js. And I believe I need to set the TMPDIR or RENOVATE_TMPDIR variables to point to $(pwd)/something so Gitlab CI can cache them. But should I cache the whole RENOVATE_TMPDIR or just a subdirectory within it? Or is there a more appropriate way to do this?

rarkins commented 4 years ago

When you run Renovate in a pipeline, is it running for the current repo only, or is it autodiscovering and running on all repos in the same group?

By default you likely use /tmp/renovate to store everything and everything in there could be cached between runs. persistRepoData specifically does one thing - it preserves the cloned git contents instead of deleting it afterwards. For everything else (including npm cache) it's persisted by default.

candrews commented 4 years ago

When you run Renovate in a pipeline, is it running for the current repo only, or is it autodiscovering and running on all repos in the same group?

It is autodiscovering and running on all repos

By default you likely use /tmp/renovate to store everything and everything in there could be cached between runs. persistRepoData specifically does one thing - it preserves the cloned git contents instead of deleting it afterwards. For everything else (including npm cache) it's persisted by default.

By default you likely use /tmp/renovate to store everything and everything in there could be cached between runs. persistRepoData specifically does one thing - it preserves the cloned git contents instead of deleting it afterwards. For everything else (including npm cache) it's persisted by default.

Would I want to set persistRepoData or not? It seems that setting it should speed up runs (as clones aren't necessary each time). What are the disadvantages?

rarkins commented 4 years ago

I'd recommend you measure it to know if it speeds things up or not. We only shallow clone anyway so it tends to be fast.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon if no further activity occurs. If this question is not done (either you plan to update it or are waiting on someone to respond) then please add a comment here to bump it and/or get the other person's attention. We aim to do our best to solve every problem. This bot is here to help us clean up issues which are no longer of use to the original poster, and not to close anything prematurely, so bump as you need!