Skip to content
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

Add support for git lfs #22

Open
jusdino opened this issue Mar 23, 2020 · 4 comments · May be fixed by #29
Open

Add support for git lfs #22

jusdino opened this issue Mar 23, 2020 · 4 comments · May be fixed by #29

Comments

@jusdino
Copy link

jusdino commented Mar 23, 2020

Any chance it would be worthwhile for you guys to add support for git lfs to this layer? Or perhaps that should be something I request be added to yumda?

@mhart
Copy link
Member

mhart commented Mar 23, 2020

Good question – what's required to support that?

@jusdino
Copy link
Author

jusdino commented Mar 23, 2020

I'm not sure, really. I think it would depend on how you went about installing it:
https://github.com/git-lfs/git-lfs/wiki/Installation

I tried to install with yumda using their rpm installer script, but it tries to add an external repo, which doesn't seem to work with yumda. Alternatively, it looks like they mention adding their raw binary git-lfs to anywhere in the PATH would also work, but I'm still experimenting.

I'm working on a lambda that does a git clone, zip, ship to s3 that uses this lambda layer. It works great until I try to do this with a repo that uses LFS.

freakingawesome added a commit to freakingawesome/git-lambda-layer that referenced this issue Mar 4, 2021
Resolves lambci#22

This adds the appropriate `git-lfs` RPM repo and validates its signature, then installs it with the `yum install` command. We have to manually move the `git-lfs` binary (which is [the only file required for git-lfs](https://github.com/git-lfs/git-lfs/wiki/Installation#other)) into the `/opt/bin/` folder of the output so that it will be available in the `$PATH` in the lambda layer.

This manual handling of the RPM repo is done because the [standard git-lfs install script](https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh) has hardcoded `/etc/` all over the place, whereas we need it to respect the `/lambda/` root.
@freakingawesome
Copy link

I think I've got the git-lfs installation working correctly in this forked PR. I have yet to fully vet it out by pushing up and running it as an actual Lambda Layer, but I wanted to link the in-process work here in case you wanted to take it for a spin before I fully vet it out.

I'm pretty sure it'll work just fine based on testing within the container in which it was built, but I'll report back here when I'm able to get it up on AWS for additional testing, and if it's all good I'll open a PR here.

This commit only targets the Lambda Runtime 2 (so far...).

@freakingawesome freakingawesome linked a pull request Mar 6, 2021 that will close this issue
@freakingawesome
Copy link

PR submitted. I updated it to allow specification of the git-lfs version, and I added a line in the test lambda function to run git lfs on the lambda instance, which proves that it's working correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants