-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Git LFS support? #1846
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
Comments
To be concrete, I have a branch of my docs (https://github.com/lsst-sqre/lsst_stack_docs/tree/tickets/DM-4511) that includes a Git LFS managed image (https://github.com/lsst-sqre/lsst_stack_docs/tree/tickets/DM-4511/_static/development/docs) The RTD build seems to be failing https://readthedocs.org/projects/lsst-stack-docs/builds/3548182/ at the LaTeX build stage because it can't read and covert the JPEG image. I'm guessing that the git-lfs client isn't installed? |
So no, the LFS client is not currently part of our server provisioning. We'll want to spend some time with it before it goes into production and we call it supported. Without much time to look into this, it wasn't immediately clear if LFS makes the files available on cloning. It sets up git hooks, which wouldn't be present on clone, requiring extra commands for us to run. Additionally, the docs are not clear about how the file is presented on the filesystem once installed. Is the link file replaced with the actual file? Or is the LFS client expected to be an intermediary somehow? The build above is failing because it's getting the link file, which doesn't have a JPEG header. The HTML output will likely just show a broken file. Marking this as community support for now, our roadmap is very full right now, and I'm not sure how far out support for this might be. If it comes down to just being a server provisioning change, that's a lot less daunting. |
I think it's 'just' a server provisioning change. Basically you can get the Go binary from https://git-lfs.github.com and run
once on the server to setup LFS in the Then the (*) Though GitHub Git LFS users should be easy to support, I just realized that since we're using our own Git LFS server at the Large Synoptic Survey Telescope, rather than GitHub's, there's a kludgy aspect of being prompted for usernames and passwords (which can be blank) on clone; so I don't think our Git LFS will work with a RTD build in the foreseeable future. See http://docs.lsst.codes/en/latest/development/git_lfs.html#setting-up-git-lfs-authentication (@jmatt any opinions?) That said, most people will be using GitHub's LFS server that works perfectly and might benefit from everything 'just working' on RTD. |
Well, there is still the issue of the |
Yes please! Multiple projects I'm working on make use of LFS. Two of which are for hosting images/graphs for our documentation. |
For anyone interested in simple workaround: you can easily use git-lfs Python package to get all LFS-stored files during RTD build. See example: https://github.com/swistakm/pyimgui/blob/master/doc/source/conf.py#L36-L37 |
Does anyone know about this issue? I try to repeat @swistakm but it isn't work for me. May be I do something wrong. Can you help me to configure my project to force RTD to work with git lfs? |
Yes, @swistakm is right. His solution works fine! Thank you! When I had moved the invocation of git_lfs to the top of conf.py it began to work. Also I added git-lfs dependency to my pip.txt. But anyway I hope that git lfs will have native support. |
Requires tweaking upstream RTD settings to install from pip. This logic was pulled from a discussion here: readthedocs/readthedocs.org#1846
Requires tweaking upstream RTD settings to install from pip. This logic was pulled from a discussion here: readthedocs/readthedocs.org#1846
Implementing this in RTD will be non-trivial, but the suggested workaround would make a great guide topic in our |
Trying the LFS hack by @swistakm and @AlexMAS and got an error.
Reference: |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi everybody! I'm re-opening and re-purposing this issue to have some actionable things. I read the whole conversation and it seems we need different things at this point:
I created a small example using a file that is tracked via Installing |
Thanks for re-opening this @humitos. I'm looking forward to seeing how it develops. :) |
I should have mentioned that the # docs/conf.py
# Workaround to install and execute git-lfs on Read the Docs
import os
if not os.path.exists('./git-lfs'):
os.system('wget https://github.com/git-lfs/git-lfs/releases/download/v2.7.1/git-lfs-linux-amd64-v2.7.1.tar.gz')
os.system('tar xvfz git-lfs-linux-amd64-v2.7.1.tar.gz')
os.system('./git-lfs install') # make lfs available in current repository
os.system('./git-lfs fetch') # download content from remote
os.system('./git-lfs checkout') # make local files to have the real content on them
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
We do not plan to support this soon. We can keep this issue closed for now. |
Hi, thanks for letting us know. Is there a published, documented, workaround available for those who have git-lfs installed. I am wondering how to go about setting the git-lfs tracking configuration to, say, let everything with a certain file suffix stay as binary instead of being tracked under git-lfs. Or maybe, some method to make all items inside the _static folder that are tracked under git-lfs to, now, not be tracked under git-lfs. If there is no workaround, I will attempt to find one and update once discovered. |
The indicator environment variable is listed at https://docs.readthedocs.io/en/stable/builds.html This solution follows the current best practice presented at readthedocs/readthedocs.org#1846 [ci skip]
I have tried the process described by @humitos but I get an authentication error:
Both git and git-lfs seem to be using the same endpoint:
|
Hi, I am facing a similar issue, so curious if there will any official support for LFS? |
Hi @Borda - when you say "it seems to be working", do you refer to @humitos hack here? #1846 (comment) If that's the case, it's still a hack, so in my opinion we should not add docs for it. |
in fact none of that above, we are linking this repo which has enabled ipynb as LFS to this repo as a submodule and all notebooks seem to be properly rendered - which would not happen if LFS or submodule won't work... |
FWIW, I have packaged the workaround described in this issue in a currently working state into a Sphinx extension: https://github.com/ssciwr/sphinx_lfs_content |
Thanks for letting me know (and doing this!)
I will try this out. It will certainly clean things up a bit.
… On 5 Jul 2021, at 21:49, Dominic Kempf ***@***.***> wrote:
FWIW, I have packaged the workaround described in this issue in a currently working state into a Sphinx extension: https://github.com/ssciwr/sphinx_lfs_content <https://github.com/ssciwr/sphinx_lfs_content>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#1846 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AC2SZP775W4R5H27KYN3M6TTWIECZANCNFSM4BVWIDUQ>.
|
@JamesRandom Did you ever sort out your authentication issue? We're using BitBucket and having just installed the |
I had to add username and a GitHub access token to the Git URL: |
I couldn't find any projects using @dokempf extension https://libraries.io/pypi/sphinx-lfs-content/ on GitHub, Google, or libraries.io. @Borda @JamesRandom @sjalloq @forikal-uk could you please give sphinx-lfs-content a try and report back if it worked? We would be happy to promote it more in our FAQ if we gather some social proof. |
@astrojuanlu I couldn't get it working but I think that was an auth issue rather than as issue with the extension. I don't have enough time to try and make it work so backed out the use of LFS. |
@astrojuanlu I use this in some of my personal projects, although I have recently reduced my LFS usage due to the low bandwidth quota by GitHub. I have never faced the auth issue described here, but I would welcome an issue on the extension repo https://github.com/ssciwr/sphinx_lfs_content that gives a bit of context when exactly that happens. |
I tried it but it didn't work properly. Can't remember exactly what went wrong, but it seemed to behave as if git-lfs hadn't't been installed — despite the fact the output showed it was installed. Almost like some sort of race condition. I didn't have time to look into it further at the time. I'll try to have another look after our pending sw release |
Update: Read the Docs supports Git LFS by extending the build process. It's described in the docs: https://docs.readthedocs.io/en/stable/build-customization.html#support-git-lfs-large-file-storage |
We're using Git LFS to store images for our docs. I tried building a test doc on RTD with a Git LFS-managed image, and it looks as though the
git-lfs
client isn't install on the RTD's build servers. Is it true that Git LFS isn't currently setup on readthedocs.org? Or am I messing something up somehow?I think there's a good use case for letting people manage static binary assets with Git LFS, and installing git-lfs (see https://git-lfs.github.com) client is fairly easy.
The text was updated successfully, but these errors were encountered: