-
Notifications
You must be signed in to change notification settings - Fork 124
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
Consider adding config option for treeless clones (--fetch-opt=--filter=...) #638
Comments
Did you try Also take a look at https://github.com/zephyrproject-rtos/west/issues?q=shallow+ EDIT: and now the better https://github.com/zephyrproject-rtos/west/issues?q=label%3Aperformance |
Ah nice, hadn't seen the
Yea, I'd looked at the shallow clone options, but shallow cloning isn't viable for git hosts that don't allow cloning arbitrary commit hashes (github). |
Github does allow this now |
These discussions were not just about shallow options. Some of these discussions may be obsolete now with these new (to me!)
So are you confirming that To be honest I'm not a fan of |
I recently noticed that At the risk of stating the obvious: don't forget to fetch the FULL, 40-digit long SHA. This is a bit confusing BTW:
It's confusing because Github does support |
On Thu, Mar 02 2023, Marc Herbert wrote:
> > https://github.com/zephyrproject-rtos/west/issues?q=shallow+
> Yea, I'd looked at the shallow clone options,
These discussions were not just about shallow options. Some of these
discussions may be obsolete now with these new (to me!) `--filter=`
options. I finally took the time to read the
https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/
page you shared and `--filter=` looks impressive! Will have to try it
soon, thanks for sharing.
I'd be curious to know if there's any low-hanging fruit there if you
find the time.
|
On Thu, Mar 02 2023, Marc Herbert wrote:
> but shallow cloning isn't viable for git hosts that don't allow cloning arbitrary commit hashes (github).
I recently noticed that `west update --narrow` is incompatible with
direct SHA fetch from github
Wait, what?!
We added --narrow precisely *because* github supported direct sha fetch.
It used to not work, then it suddenly started working, so we took
advantage.
Did they change their behavior yet again?
|
Wait, maybe it's the other way round. Need to test this again. It's either one or the other for sure:
That wasn't my understanding, I saw Some projects generate branches and tags automatically and have hundreds of them: |
On Thu, Mar 02 2023, Marc Herbert wrote:
Wait, may it's the other way round. Need to test this again. It's either one or the other for sure:
- thesofproject/sof@68b49c186e130c96
- thesofproject/sof#7111 (comment)
> We added --narrow precisely *because* github supported direct sha fetch.
That wasn't my understanding, I saw `--narrow` as a way to avoid
fetching many unused branches and tags
Right!
But since zephyr/west.yml exclusively uses SHAs as revisions, the only
way to make that possible was to directly fetch SHAs.
So GitHub supporting this was the critical feature we needed, and why we
added it while working on `west update` optimizations.
|
Why try to use my brain and remember things correctly when I can just dump my thoughts into github projects instead?
Just confirmed in https://github.com/thesofproject/sof/actions/runs/4319928351/jobs/7539643427 |
@marc-hb I believe your above comment confirms that you can fetch SHAs directly from GitHub. |
Yes but ONLY with |
Wait, https://github.com/thesofproject/sof/actions/runs/4374649912/jobs/7654345972
None of that makes sense. But I've seen this error consistently in the same conditions. (yes I should file a new bug. I might) |
So apparently "no news is good news" - in this case excellent news even. I tried this myself and I was very pleased and surprised to find that it works. I guess that's why this issue was closed :-)
So unlike the manifest after commit e283d99 , subprojects are still cloned in two steps:
Not just "it works" but the results are very impressive. "Impressive" as in: stop what you're doing now and try it in your CI right away. From my system inside the company network (behind proxies and what not)
Does not seem compatible with https://github.com/actions/checkout though :-( |
Test new, fancy and impressive looking git --filter optimization on non-critical "manifest check". Extend it later to other checks if it hasn't caused any issue. https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ zephyrproject-rtos/west#638 (comment) Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Test new, fancy and impressive looking git --filter optimization on non-critical "manifest check". Extend it later to other checks if it hasn't caused any issue. https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ zephyrproject-rtos/west#638 (comment) Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Please upvote: |
On Tue, Mar 21 2023, Marc Herbert wrote:
> So are you confirming that --fetch-opt=--filter= ... works with the initial cloning too?
So apparently "no news is good news" - in this case excellent news
even. I tried this myself and I was very pleased and surprised to find
that it works. I guess that's why this issue was closed :-)
Great! I'm glad this is working for you in west.
Good luck getting this enabled in the GitHub action.
|
Twice faster than shallow clones without any of the git describe or other hassle. More info in zephyrproject-rtos/west#638 Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Twice faster than shallow clones without any of the git describe or other hassle. More info in zephyrproject-rtos/west#638 Signed-off-by: Marc Herbert <marc.herbert@intel.com>
--depth=1 is unreliable, see zephyrproject-rtos/west#638.
When running west in CI, it's useful to be able to minimise the amount of data that a job has to download. The
clone-depth
setting in manifests allows git clones to be "shallow", but this doesn't work with all git hosts -- it's not always possible to shallow clone an arbitrary commit hash. What makes this even worse is that what could be shallow-cloned yesterday cannot necessarily be shallow-cloned today -- some git hosts permit shallow cloning on the last N commits -- this makes a build that was working one day fail the next, even if the local project has not been changed.A solution to this may be to add a config option to permit the use of "treeless" clones (more info here). Or perhaps even just allowing a git filter to be specified for maximum flexibility.
cc:
The text was updated successfully, but these errors were encountered: