-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: support lfs #5212
base: master
Are you sure you want to change the base?
feat: support lfs #5212
Conversation
Signed-off-by: thxCode <thxcode0824@gmail.com>
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! Left some comments, I don't have much knowledge with LFS but happy to see some support here.
Would it be possible to add tests?
@@ -539,6 +539,14 @@ func (gs *gitSourceHandler) Snapshot(ctx context.Context, g session.Group) (out | |||
if err != nil { | |||
return nil, err | |||
} | |||
_, err = checkoutGit.Run(ctx, "lfs", "install", "--local") |
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.
I think we should check if lfs is supported (git >= 1.8.3.1): https://github.com/git-lfs/git-lfs/wiki/Installation#requirements
@@ -539,6 +539,14 @@ func (gs *gitSourceHandler) Snapshot(ctx context.Context, g session.Group) (out | |||
if err != nil { | |||
return nil, err | |||
} | |||
_, err = checkoutGit.Run(ctx, "lfs", "install", "--local") |
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.
Should we check if there are files being tracked by LFS first?
git lfs ls-files
Or maybe look for .gitattributes
with filter=lfs
like:
*.png filter=lfs diff=lfs merge=lfs -text
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.
Or maybe git lfs status
?
https://github.com/moby/buildkit/actions/runs/10241968157/job/28396722664?pr=5212#step:8:5671
|
I will try to address your comments, thanks. |
With the development of AI, more and more Git repositories use LFS to store model weights. The
ADD
command already supports pulling from Git URLs, https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/reference.md#adding-files-from-a-url. This PR intends to support theADD
command to pull content managed by Git LFS.