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

upgrade git to 2.18+ for better compatibility with github actions #351

Open
andreineculau opened this issue May 27, 2021 · 8 comments
Open

Comments

@andreineculau
Copy link

I'm wondering if you would consider bumping the git to 2.18 or greater on your images.

The background of this request is that the Github Actions' Checkout action (that's a mouthful!) falls back to checking out via REST API (source: https://github.com/actions/checkout#whats-new) when git version is below 2.18. What this means is that you actually get a snapshot (archive) of your sourcecode rather than all commits, tags, etc.

Github's reasoning is not compelling, but the argument goes that git 2.18 implements support for partial clone via transport protocol v2 which decreases the load on Github's side. There is no way to tell the action to go ahead with a regular clone, despite the presumable higher load on Github, even if it's negligible for small repos.

So for instance in testing jesse on Github Actions with your images, on every run there's a 2-3 minute "waste" installing git 2.18 plus its dependencies (source: https://github.com/for-GET/jesse/blob/master/.github/workflows/ci.yml#L51-L58). In order to remove that waste, it's a question of upgrading git on your images or forking github's action to checkout as usual, just without the partial clone via transport protocol v2.

Thanks in advance!

@vkatsuba
Copy link
Contributor

vkatsuba commented May 27, 2021

Hi @andreineculau, I was checked and detected that the git version is git version 2.31.1. Please follow to the https://github.com/vkatsuba/docker-erlang-otp/runs/2686524428 select -> the tag Build. Not sure but looks like that git version 2.18 is old info, please take a look also minimum git version in repo of tool https://github.com/actions/checkout/blob/v2/src/git-command-manager.ts#L13. Currentlly 2.18 - as you see 2.18 is minimum git version. Also please note:
https://github.com/actions/checkout/blob/25a956c84d5dd820d28caab9f86b8d183aeeff3d/adrs/0153-checkout-v2.md
(C) Git client version 2.18+ (released June 2018) is required for wire protocol version 2.
So, I suppose this is not an issue in Checkout action.

Regards,
--V

@vkatsuba
Copy link
Contributor

Hi @andreineculau, please ignore my comment above, because you are you're right, the issue shows in versions of OTP 19~19.3/20~20.3/21~21.3 and in 22.1 - all other images start use git version from 2.20.1.

Regards,
--V

@andreineculau
Copy link
Author

Hehe I didn't understand your comment so I was checking your commits in the branch. But back on topic, I noticed the same 2.20.1 - my bad as I didn't check before opening the issue. It was a behavior that I observed many months ago in January for-GET/jesse#98 (comment)

I'll give it a shot to remove the fix and come back to hopefully close the issue.

Thanks for looking into this. Sorry for the noise

@andreineculau
Copy link
Author

no go. git is older (2.11.0 to be exact) on multiple images - 19 to 21.3 and 22.1

https://github.com/for-GET/jesse/actions/runs/883210655

@vkatsuba
Copy link
Contributor

vkatsuba commented May 27, 2021

Yep, looks like issue in build image from buildpack-deps:stretch(used git version 2.11.0). To fix it I suppose or need change buildpack-deps:stretch to buildpack-deps:buster(used git version 2.20.1) with some updating Dockerfile's or try add something like(as was show @andreineculau before):

apt-get update
apt-get -y install tcl tcl-dev gettext
cd /usr/src/
wget https://github.com/git/git/archive/v2.18.0.tar.gz -O git.tar.gz
tar -xf git.tar.gz
cd git-*
make prefix=/usr/local all
make prefix=/usr/local install

to all Dockerfiles where used buildpack-deps:stretch and maybe to debian:stretch too.
In any case this can be fixed, however this fix can be apply as I understand only for latest version of each OTP version: 19, 19.3/20, 20.3, 21.3 only... At the same time all other images 19.1, 19.2/20.1, 20.2/21.1, 21.2 and in 22.1 will be still have the same issue...

@andreineculau
Copy link
Author

however this fix can be apply as I understand only for latest version of each OTP version

I can assume why, but since assumption is the mother of all evil, could you clarify?

@vkatsuba
Copy link
Contributor

vkatsuba commented May 27, 2021

I suppose, because will be needed do step by step for all official docker images and also search and roll back changes that were up to the latest versions in the master. Like: revert changes for all old OTP images 19.1, 19.2/20.1, 20.2/21.1, 21.2, then apply changes for fix and then apply them into official docker images... I would even say it's easier to leave it as it is 🙃 as it is very easy to break the work of old images/projects/builds, or update only latest OTP versions only - 19, 19.3/20, 20.3, 21.3.

@vkatsuba
Copy link
Contributor

vkatsuba commented May 27, 2021

In other hand 🙃 based on:

The dates of OTP releases is from 2016 till 2018 which means that the git at that time was lower 2.18. This means that this can consider this as expected behavior

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

No branches or pull requests

2 participants