Skip to content

Conversation

@ofalvai
Copy link
Contributor

@ofalvai ofalvai commented Sep 16, 2021

Checklist

  • I've read and followed the Contribution Guidelines
  • step.yml and README.md is updated with the changes (if needed)

Version

Requires a PATCH version update

Context

Git LFS is an optional dependency that some projects utilize. Normally it is preinstalled on Bitrise stacks, but a recent VM update didn't have this installed. Let's guard against this by installing the dpenedency at runtime if needed.

Changes

Use the deps feature of step.yml to check and install Git LFS if necessary.

Investigation details

Performance impact:

vagrant@prd-atl-elt-e2-xcode-13-0-210916091305-dLSbByNQ2pcr3iXsDCfw7a ~ % time brew install git-lfs
Warning: git-lfs 2.13.3 is already installed and up-to-date.
To reinstall 2.13.3, run:
  brew reinstall git-lfs
brew install git-lfs  1.11s user 1.08s system 98% cpu 2.223 total
root@prd-20-04-use1c-210916091822-mvbwsqcsrhyed4w4zvdft9:/bitrise/src# time apt install git-lfs
Reading package lists... Done
Building dependency tree
Reading state information... Done
git-lfs is already the newest version (2.13.3).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

real	0m1.718s
user	0m1.389s
sys	0m0.111s

This was run through remote access while the build VM was executing other steps, so I think the real perf impact is even lower.

Decisions

@shams-ahmed
Copy link

@ofalvai Do we need to call git lfs install afterwards to make sure it's fully installed?

@ofalvai
Copy link
Contributor Author

ofalvai commented Sep 16, 2021

@shams-ahmed good catch, thank you. My understanding is that this command only adds git hooks, so let's hope those are untouched in the hypothetical situation when the Git LFS binary is missing for some reason.

@ofalvai ofalvai merged commit 3b17afb into master Sep 20, 2021
@ofalvai ofalvai deleted the ofalvai-patch-1 branch September 20, 2021 10:44
@pavm035
Copy link

pavm035 commented Oct 19, 2021

Looks like git-lfs from v3.0.x has authentication issue with bitbucket for git lfs pull, so if we use this step will cause that problem? or is there a way to use lower version like 2.x.x ?
https://jira.atlassian.com/browse/BSERV-12989

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants