Git lfs / renku storage pull try to commit files to git

Hi all

we have some files in our repositories that got added to lfs. When starting a new environment they are not automatically loaded despite setting the auto_fetch_lfs setting.

calling either ‘git lfs pull’ or ‘renku storage pull data/’ will fetch and load the data, but also stage them to be added to git:

git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   file1
        modified:   file2

and

git lfs status
On branch master
Objects to be pushed to origin/master:

Objects to be committed:

        data/file1 (LFS: hash1 -> Git: hash1)
        data/file2 (LFS: hash2 -> Git: hash2)

The project has been created from the most recent r template (renku/renkulab-r:4.0.5-0.8.0)

What I would expect to happen is that the data is automatically available with the auto fetch, and that there are no staged files trying to add the large files back to git? Admittedly though the files are not part of a dataset.

Thanks

Okay it looks like git lfs was not actually tracking the files in git lfs. The .gitattributes files did not exists and having files automatically put into git lfs at commit/push time does not generate it.

For the existing files I did this:

touch .gitattributes
git lfs track data/file1 data/file2
git lfs pull
git add .gitattributes && git commit -m 'add misisng .gitattributes' && git push

with that the auto fetch during the environment creation does work.

Which version of the renku cli are you using? We had a bug that broke automatically putting data into LFS some time ago so that could be related. Also, if those files are big they are now in your repo as normal git objects which isn’t great - you may want to look at git lfs migrate.

It’s a new project created from the most recent R template:
ARG RENKU_VERSION=0.16.0

I did not commit the files to git, they went no further than the staging I quoted above.
I think the part about adding the files to lfs automatically worked, they are marked as lfs in gitlab and get pulled in by git lfs pull. But I’m not sure why the .gitattributes file was missing.