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

submodules are not cached #52

Closed
AlexisTM opened this issue Jan 25, 2025 · 7 comments · Fixed by #53
Closed

submodules are not cached #52

AlexisTM opened this issue Jan 25, 2025 · 7 comments · Fixed by #53

Comments

@AlexisTM
Copy link

Problem

When doing a recursive shallow clone, I expect every submodule to be also cached and fetched through git-cache.

 git cache clone -U https://github.com/PX4/PX4-Autopilot --recurse-submodules --shallow-submodules
@kaspar030
Copy link
Owner

When doing a recursive shallow clone, I expect every submodule to be also cached and fetched through git-cache.

Thanks for the suggestion. I'll see what I can do!

@kaspar030
Copy link
Owner

@AlexisTM do you mind testing this?

You'd need to use the git version (cargo install --git https://github.com/kaspar030/git-cache-rs). Hint: increase default fetch jobs, like git config --global submodule.fetchJobs 16.

@AlexisTM
Copy link
Author

Oh, wow. You made my day.
I made a quick bash wrapper for the recursive cloning while you integrated it to the tool & made the process parallel.

If you need more ideas on missing features, I would mention:

  • Remote server for the cache storage (Allows for multiple CI agents to use the same remote to use/store the cache; Sadly, a simple shared folder would cause data races)
  • git cache submodule -U update --recursive (Update all remote submodules recursively and update them locally from the cache)

@AlexisTM
Copy link
Author

AlexisTM commented Jan 27, 2025

It works amazingly btw. I didn't add it to Jenkins yet but locally, it went from over 20 minutes to 11 seconds for the "fresh" clones.

@kaspar030
Copy link
Owner

It works amazingly btw. I didn't add it to Jenkins yet but locally, it went from over 20 minutes to 11 seconds for the "fresh" clones.

Happy to hear, and thanks for testing!

@kaspar030
Copy link
Owner

  • Remote server for the cache storage (Allows for multiple CI agents to use the same remote to use/store the cache; Sadly, a simple shared folder would cause data races)

So git-cache does do locking, using a shared .gitcache concurrently should actually work. This is depended on heavily by git-cache's initial use case, https://ci.riot-os.org/. So it does work on local file systems. If it doesn't for you, please open an issue with more details (which fs etc.!).

Being able to act as a server, or have a tree of caches, would be great. I know I'll get nerd-sniped one day.

git cache submodule -U update --recursive (Update all remote submodules recursively and update them locally from the cache)

That makes sense, I'll add that. (Not this week though. 😇)

@AlexisTM
Copy link
Author

That is great to know! Thanks for the tool :)

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

Successfully merging a pull request may close this issue.

2 participants