We’ve recently started using git’s LFS (Large File Support) extension. Our repository is running on GitHub.
We ran into some issues where we went over our quota on GitHub because Bitrise seems to be downloading the LFS dependencies over and over again, which will rapidly become very expensive for us.
Is there some way to cache the git-lfs dependencies between builds?
I have found a caching article for cocoapods with the cache steps in a workflow, but git-lfs work during the git clone
phase, so I don’t know if this will work for us…
2 Likes
Hi @scspijker ,
Sure, it’s definitely possible. As git LFS is just a git
“plugin”, the same rules apply for it as with the git repo itself.
This means that it’s not possible to only cache the LFS files without the rest of the repository, without extensive tweaking. But you can of course cache the whole repo, including the LFS files. You can find the related How To guide here:
Bitrise does not do automatic git/source code caching, unless you configure it for yourself. This is part of our Security policy too (that we don’t store your code and we never access it outside of the ephemeral build VMs): Redirecting…
You can of course configure the source to be cached, a very simple / minimal example:
workflows:
primary:
steps:
- activate-ssh-key@3.1.1:
- cache-pull@0.9.2: {}
- git-clone@3.4.3:
inputs:
- reset_repository: 'Yes'
- cache-…
If you’d have any questions, issues or feedback just let us know!
2 Likes
Cool, thanks!
I’ve added the caching step per instructions and will report back whether this helps our bandwidth issues
1 Like
Thanks, please definitely do, I’m interested
Definitely looks like this is working. Our bandwidth is not used exponentially anymore, and Bitrise build still reliable Thnx
1 Like
Glad to hear, thanks for reporting @scspijker !
I ran into an issue with the git clone step not playing nice with the cache:
opened 07:10PM - 24 Sep 18 UTC
closed 03:44PM - 02 Apr 21 UTC
stale
```
+--------------------------------------------------------------------------… ----+
| (3) git-clone |
+------------------------------------------------------------------------------+
| id: git-clone |
| version: 4.0.12 |
| collection: https://github.com/bitrise-io/bitrise-steplib.git |
| toolkit: go |
| time: 2018-09-24T12:04:35-07:00 |
+------------------------------------------------------------------------------+
| |
INFO[12:04:35] * [OK] Step dependency (go) installed, available.
config:
- RepositoryURL: git@github.com:instructure/ios.git
- CloneIntoDir: /Users/vagrant/git
- Commit: b3c43b3abdd50a048ef94acfa4e33fe293b169a8
- Tag:
- Branch: earlgrey_2
- BranchDest: master
- PRID: 2313
- PRRepositoryURL: git@github.com:instructure/ios.git
- PRMergeBranch: pull/2313/merge
- ResetRepository: true
- CloneDepth: 0
- BuildURL: https://app.bitrise.io/build/24f418723816bac6
- BuildAPIToken: [REDACTED]
- UpdateSubmodules: true
- ManualMerge: true
git "init"
Initialized empty Git repository in /Users/vagrant/git/.git/
git "remote" "add" "origin" "git@github.com:instructure/ios.git"
git "fetch" "origin" "master"
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
From github.com:instructure/ios
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
git "checkout" "master"
error: The following untracked working tree files would be overwritten by checkout:
scripts/ftl/.gitignore
scripts/ftl/ios_student_ftl.sh
scripts/ftl/ios_teacher_ftl.sh
scripts/ftl/ios_teacher_run.sh
Please move or remove them before you switch branches.
Aborting
ERROR: manual merge, error: pull failed (master), error: checkout failed (master), error: exit status 1
| |
+---+---------------------------------------------------------------+----------+
| x | git-clone (exit code: 1) | 13 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-git-clone/issues |
| Source: https://github.com/bitrise-io/steps-git-clone |
+---+---------------------------------------------------------------+----------+
```
untracked working tree files are not being removed.
1 Like
Bumped the related task’s priority in our backlog!