-
Notifications
You must be signed in to change notification settings - Fork 864
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
Sync only a subset of an LFS enabled repo #1894
Comments
@tjaffri for your scenario, i would recommend you go with 2) if want customize lfs fetch process. |
@TingluoHuang thank you. I considered that but I have two concerns: A. First, no sources are syncing in option 2 above for the LFS enabled repo due to the error (not even the simple git files since LFS insists on running as it is enabled on the remote, yet fails due to missing creds... I clarified above). So I have to turn off source syncing entirely for LFS enabled repos. That seems like a straight up bug, right? Isn't the CI process completely broken for LFS enabled repos if you have to sync all files (or do a complicated custom sync)? By definition LFS is when the repo has large files and you don't want to sync the entire repo. So I was hoping to report that as a bug. What's the process to do that? B. Second, I guess I could do a manual git clone and I did look at the commands the agent is doing. But it seems to be doing complex git magic like merging PRs in the case of CI builds. I wanted to benefit from all that and not have to duplicate all that as a custom bash script. Is there a recommendation or template for how to correctly write a custom source sync? Thanks so much for your time! |
@tjaffri without |
Thanks! I ran on Hosted Ubuntu 1604, as well as Mac OSX. Same error, specifically when Get Sources does NOT have "Checkout files from LFS" selected it is still trying to do some stuff with git lfs (same smudge error reported originally). On my local machine for the same remote repo (on Ubuntu as well as Mac OS) I can simply do a git clone and that does not trigger git-lfs. I have to separately do a git lfs pull for files I want to pull from git lfs. I researched this a bit and it seems when you install git-lfs on the agent image you should need to call ... I think I am unblocked with this workaround, but I'm sure others will run into this bug. It is quite confusing. What do you suggest as a fix? My proposal:
I'm happy to send a PR if you can point me the right direction? Sorry I'm new to Pipelines. |
@tjaffri i remembered we need to figure a way out for Linux/macOS. :) |
@TingluoHuang for linux/macOS maybe just set that env variable and that's it? All you need to do is set GIT_LFS_SKIP_SMUDGE=1 and that will make lfs not checkout the object (this is what I am doing to work around this issue... works great). LMK if there's a place I can PR this to. I bet you guys have a config somewhere setting env vars for the agent... |
@TingluoHuang it looks like your PR has fixed this, yes? Can you close the issue, or is there still more work to be done? |
I haven't verified the fix, but I suspect you're right @moswald we should be able to close this issue. My workaround is exactly what @TingluoHuang implemented in the PR. |
Have you tried trouble shooting?
Trouble shooting doc
Yes
Agent Version and Platform
vsts-agent-linux-x64-2.140.2.tar.gz
OS of the machine running the agent? Hosted Linux Preview
VSTS Type and Version
VisualStudio.com
What's not working?
We have a repo with a lot of large files. We use git LFS to make this manageable.
I am creating a CI build to run a script on some of the files, using a hosted linux agent. My problem is that the very first step
Get Sources
seems to only have two choices:I can select "Checkout Files from LFS" which works, but the agent runs out of disk space when trying to pull down absolutely everything in the repo from LFS. In any case this is wasteful since I don't need all the LFS files, just a couple of them.
I can ofcourse decide to not select "Checkout Files from LFS" (default) with the thought that I could write a manual step to do
git lfs pull --include="foo.tar.gz"
later. However, in this case the entire souce sync step fails with some cryptic LFS auth error (see below) specifically "Git credentials not found". So I can't even do a non LFS basic git sync on an LFS enabled repo. It seems that Loc, test class organization, various... #1 above is required to give the right credentials to LFS?What's the correct way to pull only a couple of LFS files without sucking down absolutely everything?
Agent and Worker's Diagnostic Logs
The text was updated successfully, but these errors were encountered: