-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Reduce time required for cloning remote bases #857
Conversation
This commit changes git/cloner.go from cloning the whole history and then checking out the desired ref to a implementation that only downloads the history for the desired ref. It does so by first initializing an empty repository, setting the source repository as a remote, fetching just the desired ref and then hard resetting the empty local repo to that ref. This reduces the time it takes to build the multibases example as a remote base at ref v2.0.3 from an avg of 8s with the current implementation to an avg of 2s out of 10 runs each, by drastically decreasing the data transferred. The improvement should increase as repositories grow.
/assign @pwittrock |
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.
Thanks for the git-foo!
Looks like this passes examples/remoteBuild.md
/lgtm
PS, feel free to expand / improve https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md It's both an example and a test that must exit with $?==0 |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: monopole, pst The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This commit changes git/cloner.go from cloning the whole history
and then checking out the desired ref to a implementation that
only downloads the history for the desired ref.
It does so by first initializing an empty repository, setting the
source repository as a remote, fetching just the desired ref and
then hard resetting the empty local repo to that ref.
This reduces the time it takes to build the multibases example
as a remote base at ref v2.0.3 from an avg of 8s with the
current implementation to an avg of 2s out of 10 runs each, by
drastically decreasing the data transferred.
The improvement should increase as repositories grow.