-
Notifications
You must be signed in to change notification settings - Fork 12
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
CI: Caching #468
CI: Caching #468
Conversation
Thanks! I ran the pipeline again to see the level of improvement. This is the run: https://github.com/contrib-tracker/backend/actions/runs/9128381842/attempts/1. The task where it pulls images took 1m33s. Caching took 1m50s (it was 1.6 GB) but that will probably not happen every time. |
As the new run is progressing, I see the "images pull" task is taking 20s. But the problem is that the task that restores the cache takes 1m31s. This beats the point. I don't know if this is going to improve over time. |
@zeshanziya, you can run actions again without doing a dummy commit. :) |
Not a lot of improvement here. I think the transfer and decompressing the images offsets the saving we see. The overall time is improved only by about 30s or so... |
I wanted to run a separate one so that I can compare with the previous one. |
I just saw it on github, it runs a separate one. Thank you. |
I have added cache steps for npm and composer. Please see below I have added cache steps for npm and Composer. Please see below: NPM:
Composer:
Currently, caching is not making a significant impact, but it will certainly help on other projects where we have many modules/packages installed. I would also suggest keeping the Docker cache too, as we have a plan to include Solr and Varnish in DDEV, which will increase the number of images, and caching those may help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my comments on Docker caching.
.github/workflows/ci.yml
Outdated
- name: Cache Docker images | ||
uses: ScribeMD/docker-cache@0.5.0 | ||
with: | ||
key: ddev-images-${{ runner.os }}-${{ hashFiles('.ddev/config.yaml', '.ddev/docker-compose.cypress.yaml', '.ddev/docker-compose.redis.yaml') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern with this key is that if there is a new DDEV version, what would be the impact here? I don't think the pipeline will fail but I am curious if the cache size will keep increasing indefinitely.
For example, we have DDEV 1.23.0 in cache and 1.23.1 is out. The key will still match and it will restore the images. But DDEV will download new images anyway.
Now, the question is what happens in the post action step. Will it see the new images and update the cache? If it updates the cache, will it remove the older images? If it doesn't remove the old images, then the cache size will increase significantly and it will take more time to restore the images than downloading fresh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion is to figure out if we can bring the DDEV version within this key. If that takes some time, then we should remove this into a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hussainweb Thanks for noticing out concern with cache key. I have added ddev version
to cache key. Please review.
No description provided.