I assume they do this because the clone step is slow or unreliable and then the subsequent moving around of the bundle is faster and more reliable. One other thing I've seen to reduce the Git clone bottleneck is to clone from Git once, create a Git bundle from the clone, upload the bundle to cloud storage, and then have the subsequent steps use the bundle instead of cloning directly. Why not keep a copy around? That’s what TFS does. If you have pull requests landing concurrently and you only clone the most recent commit, there is a race condition between when you queue the build with a specific commit id and when you start the clone.Īll that being said, I don’t know why you would need you build agents to clone the whole damn repo for every build. I can’t speak for the original post, but I’ve seen other people increase the commit count because part of the build process looks for a specific commit to checkout after cloning. Sadly the CI provider wasn't great at handling multi-GB caches, so we went with the approach outlined above. our first take on this was to have the submodules cloned and stored in the CI cache, then use the rather neat `-reference` flag to grab objects from this local cache when initialising the submodule - incrementally updating the CI cache was way cheaper than recloning each time. It was only because our CI would hard-fail after 3 hours that the infra team really started digging in (on this and other things) - had we left it, I suspect we might be at around 5 hours by now! Contributors want to do their work, not investigate "what does a git clone really do". Īlso, as a counterpoint to some other comments in this thread - it's really easy to just shrug off CI getting slower. In the end we put in place a hack to download the tar.gz of our LLVM repo from github and just copy it in place of the submodule, rather than cloning it. I sympathise a lot with this post! Git cloning can be shockingly slow.Īs a personal anecdote, clones of the Rust repository in CI used to be pretty slow, and on investigating we found out that one key problem was cloning the LLVM submodule (which Rust has a fork of). I left this job a few weeks later, but have heard that this solution was very useful for many devs that joined the team afterwards. Then I copied that entire proxy content into the production machine before every deploy, and voila, no more surprises. I set up a pypi proxy into one of our spare office machines and routed all my daily package installs through that. But my most valuable contribution came when at some point, tired of that unpredictable torture that were the deploys, started researching into solutions. I worked there for almost a year, did many cool gigs and learned a lot. Sometimes we spent hours doing this again and again until all dependencies were finally resolved. At my second job in the industry I worked on a Python project that had to be deployed in a kind of sandboxed production environment where we had no internet access.ĭeploys were painful, as any missing dependency had to be searched in our notebooks over 3G, then copied to an external storage, then plugged into a Windows machine, uploaded to the production server through SCP and then deployed manually over SSH.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |