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

feat(git): compile git instead of relying on apt ppa repository #1180

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

smerle33
Copy link
Contributor

@smerle33 smerle33 commented May 17, 2024

as per jenkins-infra/helpdesk#4100

compiling git now from tag source on github

@smerle33
Copy link
Contributor Author

goss : [git][stdout] git version 2.45.1

@dduportal
Copy link
Contributor

I'm not sure if it is a blocker or not, but: our images seems to have the git and git-man packages from default Ubuntu APT repositories installed:

[2024-05-17T14:32:00.339Z] �[0;32m2024-05-17T14:32:00Z:     azure-arm.ubuntu: ii  git                                    1:2.34.1-1ubuntu1.10                    amd64        fast, scalable, distributed revision control system�[0m
[2024-05-17T14:32:00.339Z] �[0;32m2024-05-17T14:32:00Z:     azure-arm.ubuntu: ii  git-man                                1:2.34.1-1ubuntu1.10                    all          fast, scalable, distributed revision control system (manual pages)�[0m

It is most probably installed as a dependency from another installation. The goss test seems to indicate the proper (compiled and recent) version is used.

However we should carefully check the following (before going further):

  • What is the path of the git binary installed by the APT package and is it conflicting, overriden or other by the make install introduced by this change?
  • What is/are the package(s) requiring git package (as we introduce the implicit installation by removing the PPA installation)
  • Do we also have the git package from Ubuntu on the latest release (currently in production) 1.63.0 of the packer image?

@smerle33 smerle33 marked this pull request as draft May 20, 2024 09:17
@smerle33
Copy link
Contributor Author

I'm not sure if it is a blocker or not, but: our images seems to have the git and git-man packages from default Ubuntu APT repositories installed:

[2024-05-17T14:32:00.339Z] �[0;32m2024-05-17T14:32:00Z:     azure-arm.ubuntu: ii  git                                    1:2.34.1-1ubuntu1.10                    amd64        fast, scalable, distributed revision control system�[0m
[2024-05-17T14:32:00.339Z] �[0;32m2024-05-17T14:32:00Z:     azure-arm.ubuntu: ii  git-man                                1:2.34.1-1ubuntu1.10                    all          fast, scalable, distributed revision control system (manual pages)�[0m

It is most probably installed as a dependency from another installation. The goss test seems to indicate the proper (compiled and recent) version is used.

However we should carefully check the following (before going further):

* What is the path of the `git` binary installed by the APT package and is it conflicting, overriden or other by the `make install` introduced by this change?

* What is/are the package(s) requiring `git` package (as we introduce the implicit installation by removing the PPA installation)

* Do we also have the `git` package from Ubuntu on the latest release (currently in production) 1.63.0 of the packer image?

The git package has a strong dependency with the ubuntu-server package https://packages.ubuntu.com/jammy/ubuntu-server so removing it is not easy.
We already know (and check) that the default git called is the compiled one with goss.

So we can keep both version as the default one will be the compiled one.

@smerle33
Copy link
Contributor Author

smerle33 commented May 27, 2024

I'm not sure if it is a blocker or not, but: our images seems to have the git and git-man packages from default Ubuntu APT repositories installed:

[2024-05-17T14:32:00.339Z] �[0;32m2024-05-17T14:32:00Z:     azure-arm.ubuntu: ii  git                                    1:2.34.1-1ubuntu1.10                    amd64        fast, scalable, distributed revision control system�[0m
[2024-05-17T14:32:00.339Z] �[0;32m2024-05-17T14:32:00Z:     azure-arm.ubuntu: ii  git-man                                1:2.34.1-1ubuntu1.10                    all          fast, scalable, distributed revision control system (manual pages)�[0m

It is most probably installed as a dependency from another installation. The goss test seems to indicate the proper (compiled and recent) version is used.

However we should carefully check the following (before going further):

* What is the path of the `git` binary installed by the APT package and is it conflicting, overriden or other by the `make install` introduced by this change?

nowhere to find:

root@7deaabfe091c:/# find /  -name git -type f 
/usr/local/bin/git
/usr/local/libexec/git-core/git
root@7deaabfe091c:/# /usr/local/bin/git --version
git version 2.45.1
root@7deaabfe091c:/# /usr/local/libexec/git-core/git --version
git version 2.45.1
root@7deaabfe091c:/#  
dpkg -L git
dpkg-query: package 'git' is not installed

in fact it seems that dpkg -l list ALL available package not only installed ones, with their current status :

from the docker container built with this PR (un):

# dpkg -l git
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  git            <none>       <none>       (no description available)

but from the CI (ii) https://infra.ci.jenkins.io/job/infra-tools/job/packer-images/job/PR-1180/19/pipeline-console/log?nodeId=159

[2024-05-23T12:28:53.638Z] �[0;32m2024-05-23T12:28:53Z:     azure-arm.ubuntu: ii  git                                    1:2.34.1-1ubuntu1.10                    amd64        fast, scalable, distributed revision control system�[0m
[2024-05-23T12:28:53.638Z] �[0;32m2024-05-23T12:28:53Z:     azure-arm.ubuntu: ii  git-man                                1:2.34.1-1ubuntu1.10                    all          fast, scalable, distributed revision control system (manual pages)�[0m

un meaning:
first character equal wish u = unkonwn
second character equal current state n = not installed

For Information

	First Character: 
		i: Install
		r: Remove 
		u: Unknown 
		p: Purge 
		h: Hold 
	Second Character: 
		i: Installed 
		c: Config-files exist
		u: Unpacked 
		n: Not Installed
		f: Failed-config 
		h: Half-installed
* What is/are the package(s) requiring `git` package (as we introduce the implicit installation by removing the PPA installation)

* Do we also have the `git` package from Ubuntu on the latest release (currently in production) 1.63.0 of the packer image?

@dduportal
Copy link
Contributor

I'm not sure if it is a blocker or not, but: our images seems to have the git and git-man packages from default Ubuntu APT repositories installed:

[2024-05-17T14:32:00.339Z] �[0;32m2024-05-17T14:32:00Z:     azure-arm.ubuntu: ii  git                                    1:2.34.1-1ubuntu1.10                    amd64        fast, scalable, distributed revision control system�[0m
[2024-05-17T14:32:00.339Z] �[0;32m2024-05-17T14:32:00Z:     azure-arm.ubuntu: ii  git-man                                1:2.34.1-1ubuntu1.10                    all          fast, scalable, distributed revision control system (manual pages)�[0m

It is most probably installed as a dependency from another installation. The goss test seems to indicate the proper (compiled and recent) version is used.
However we should carefully check the following (before going further):

* What is the path of the `git` binary installed by the APT package and is it conflicting, overriden or other by the `make install` introduced by this change?

nowhere to find:

root@7deaabfe091c:/# find /  -name git -type f 
/usr/local/bin/git
/usr/local/libexec/git-core/git
root@7deaabfe091c:/# /usr/local/bin/git --version
git version 2.45.1
root@7deaabfe091c:/# /usr/local/libexec/git-core/git --version
git version 2.45.1
root@7deaabfe091c:/#  
dpkg -L git
dpkg-query: package 'git' is not installed

in fact it seems that dpkg -l list ALL available package not only installed ones, with their current status :

from the docker container built with this PR (un):

# dpkg -l git
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  git            <none>       <none>       (no description available)

but from the CI (ii) https://infra.ci.jenkins.io/job/infra-tools/job/packer-images/job/PR-1180/19/pipeline-console/log?nodeId=159

[2024-05-23T12:28:53.638Z] �[0;32m2024-05-23T12:28:53Z:     azure-arm.ubuntu: ii  git                                    1:2.34.1-1ubuntu1.10                    amd64        fast, scalable, distributed revision control system�[0m
[2024-05-23T12:28:53.638Z] �[0;32m2024-05-23T12:28:53Z:     azure-arm.ubuntu: ii  git-man                                1:2.34.1-1ubuntu1.10                    all          fast, scalable, distributed revision control system (manual pages)�[0m

un meaning: first character equal wish u = unkonwn second character equal current state n = not installed

For Information

	First Character: 
		i: Install
		r: Remove 
		u: Unknown 
		p: Purge 
		h: Hold 
	Second Character: 
		i: Installed 
		c: Config-files exist
		u: Unpacked 
		n: Not Installed
		f: Failed-config 
		h: Half-installed
* What is/are the package(s) requiring `git` package (as we introduce the implicit installation by removing the PPA installation)

* Do we also have the `git` package from Ubuntu on the latest release (currently in production) 1.63.0 of the packer image?

As seen together:

  • In ubuntu packages, git is a dependency of ubuntu-server
  • Linux Ubuntu container image does not have ubuntu-server package, hence the absence of git
  • But the VM Ubuntu image has ubuntu-server

From there 2 solutions as we cannot uninstall git on the VMs:

  • We override the content of the package from our own compilation
  • We build a local deb package after compiling, and we install this package

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.

2 participants