-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add a button to invalidate the cached Docker image #544
Comments
Yeah, this should be a part of #379. In the meantime you can add something like ENV VERSION 16122019 to your |
Ooft, I didn't realise this is a duplicate issue. Should it be closed? |
Let's keep it separate to not forget about the Docker image. 🙌 |
For a rather simple solution, one of these three options will already cover a lot of use cases:
Is it possible to implement one of those? |
@real-or-random what is your use case? Can you use cache instructions? Building a Docker image for each build might be a bit time costly. |
I could use cache instructions but I doubt it'll be easier or more efficient. We have around 30 tasks Linux test tasks testing our C code with different compilers and config settings etc. (Maybe this number will go down a little bit but not a lot.) My idea is to rely on a "bleeding-edge" distro to always get the newest build tools in order to notice if our tests breaks with new compiler versions or other changes in the environment, e.g., due to compiler bugs or ways how the compiler interacts with our code. (It's not clear yet if this will be annoying because we may run into many "boring" failures. I guess we'll need to see.) Here, docker is simply used to install packages in the distro, e.g., the aforementioned compilers. I still think that's a good idea then. The docker task runs in about 30 s. Maybe without docker, installing the packages will be only 20 s but then we still save roughly 30 * 20 s = 10 min in the build. So it makes sense to build an image for each build. Of course, an option to expire the cache once per day or something like this would be equally fine. And I believe this should be there anyway. I think a lot of people will want to rebuild their images from time to time to keep with updates and patches of other packages, even if this is done only every 3 or 6 months. So adding a expiry time or (even more flexible) a fingerprint script will be very helpful and should be easy to do. (See the linked PR for details.) |
I see. Looks pretty bleeding edge. 😅 But maybe it will be hard to troubleshoot what caused failure in that case. Was it the environment or was it the code issue. I saw people having a separate repository that defines docker images which are rebuild with a cron. That way you can rebuild once a day and have date as a tag as well as |
Indeed, that's sounds like nice setup but I fear it's overkill for our purposes. I'm using NixOs as a distro, which has a rolling release channel. If that breaks, rolling back hopefully won't be too hard because NixOs supports pinning of specific commits of the package repository. I think we'll really need to see if all of this is a good idea. :D |
Just a bump here, since the Docker build invalidations are not part of #379, right? Would be great to be able to do this without extra commits. |
My experiments confirm this. But it seems that you can simply trigger a build by clicking "Re-Run" on a Dockerfile task. See for example https://cirrus-ci.com/task/6185661871423488. This is the task skipped due to caching ( We may need this for bitcoin-core/secp256k1#1313, though a cache expiry option that could be set to a time, e.g., a day or a week, still seems better. I wonder if we could emulate this with env variables after cirruslabs/cirrus-cli#464, but I don't see how to get the current date in an env variable. Maybe one could be provided? ;) |
Context
I occasionally rebuild compiler images and push them to DockerHub, and it'd be great to have an invalidate button so that one can conveniently update the CirrusCI-prebuilt image.
I need to make small changes like adding or removing a comment to trigger the rebuild at present, so the button would be considered very useful.
The text was updated successfully, but these errors were encountered: