-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
Use App::cpm to install perlcritic faster, and clean .perl-cpm
cache
#3036
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/build
|
.perl-cpm
cache
/build
|
ed1a7b7
to
480342f
Compare
nvuillam
approved these changes
Oct 23, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dependencies
Pull requests that update a dependency file
docker
Pull requests that update Docker code
performance
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The installation of perlcritic left some cache files in the image, about 31 MB. This PR fixes that.
Also, I tried out other installation methods, and to see if I was able to remove the perl-dev dependency (I couldn't).
App::cpm is a fast CPAN module installer, and they claim it is 3x faster than cpanm. It can use multiple threads to parallelize the work to do. This PR uses that.
I used the tool called
dive
to look into the images, andhyperfine
to benchmark building of the perl_perlcritic image.Results are :
docker buildx build --pull --rm -f "linters/perl_perlcritic/Dockerfile_cpanminus" --progress plain --no-cache -t megalinter-only-perl_perlcritic:test-echoix-cpanminus .
docker buildx build --pull --rm -f "linters/perl_perlcritic/Dockerfile_cpanminus_clean" --progress plain --no-cache -t megalinter-only-perl_perlcritic:test-echoix-cpanminus-clean .
docker buildx build --pull --rm -f "linters/perl_perlcritic/Dockerfile_cpm" --progress plain --no-cache -t megalinter-only-perl_perlcritic:test-echoix-cpm .
docker buildx build --pull --rm -f "linters/perl_perlcritic/Dockerfile_cpm_pipe" --progress plain --no-cache -t megalinter-only-perl_perlcritic:test-echoix-cpm-pipe .
docker buildx build --pull --rm -f "linters/perl_perlcritic/Dockerfile_cpm_pipe_workers2" --progress plain --no-cache -t megalinter-only-perl_perlcritic:test-echoix-cpm-pipe-workers-2 .
Details of run time
Details of disk usage
Using dive with a command similar to:
Note that there is missing the
-g
global flag in the installation screenshots for cpm, but the sizes are the same, only installed in another folder to be found without changing any paths.Original installation:
![image](https://private-user-images.githubusercontent.com/27212526/277220426-11b2bc4d-c11e-424e-b9a3-d1ee3082401c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNDAyNDksIm5iZiI6MTczOTIzOTk0OSwicGF0aCI6Ii8yNzIxMjUyNi8yNzcyMjA0MjYtMTFiMmJjNGQtYzExZS00MjRlLWI5YTMtZDFlZTMwODI0MDFjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAyMTIyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTViNjVhNTQyNTI2NTJiY2Y4YWI3NDE1MjUwZWY3NmEzMjRhNjlkOTQxNjQ2OTQyNjJhY2Q3NGFlM2M0NTQ1NGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.6atx2dRAaItaG7koC_tpyazjpfZoBgmovHCoRU3dq4A)
Original installation, cleaning
![image](https://private-user-images.githubusercontent.com/27212526/277220295-5177d1ce-eb0a-4f2a-8af2-e0a8c34825c2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNDAyNDksIm5iZiI6MTczOTIzOTk0OSwicGF0aCI6Ii8yNzIxMjUyNi8yNzcyMjAyOTUtNTE3N2QxY2UtZWIwYS00ZjJhLThhZjItZTBhOGMzNDgyNWMyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAyMTIyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ5MzZkNzY5ZGQ3YmFhYTgzOTAyODk5YzQ1OWY0ZmIxMTRkYmIyNzY3N2ViZjBlYmI1OTU2NGM5MTMxNGRjZmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.iMXbw1tGj31Sk-t2AWVqkOHuPdOOJGnSXK-Tgcj5rWY)
/root/.cpanm
folder:Installing and using App::Cpm, cleaning the
![image](https://private-user-images.githubusercontent.com/27212526/277221520-7219e305-4835-4c89-b8ea-f8d6c8ffe5f4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNDAyNDksIm5iZiI6MTczOTIzOTk0OSwicGF0aCI6Ii8yNzIxMjUyNi8yNzcyMjE1MjAtNzIxOWUzMDUtNDgzNS00Yzg5LWI4ZWEtZjhkNmM4ZmZlNWY0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAyMTIyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNhODFmY2VmOWI5MGY5NWM3MDBlZmNhZGI3YzY5ZTA3ZWU0YzM0ZmYxYjU5ZDUxN2VmZGExZjFhZWNkN2ZmZTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.AUC8NX0O-o7xJ979EcqnUeWZQko624GbFkXdk4Whzbk)
/root/.perl-cpm
folder:Using cpm directly from a pipe, without installing it:
![image](https://private-user-images.githubusercontent.com/27212526/277222866-9bc9b091-de1b-4183-8866-904a3ef8afad.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNDAyNDksIm5iZiI6MTczOTIzOTk0OSwicGF0aCI6Ii8yNzIxMjUyNi8yNzcyMjI4NjYtOWJjOWIwOTEtZGUxYi00MTgzLTg4NjYtOTA0YTNlZjhhZmFkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAyMTIyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk0ZDY1MzcwNTI0MmY2ZjgwNTdjYTdkZjY0ODMzOTE1ODgwZmI3YjU0OTE0ZmUwMDAzODY0ZTU4MTEyZmRkYzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ErCZng2XDT8AsPYe61MAS_tqFePl3SakdRcOAmKhG88)
Using cpm directly from a pipe, without installing it, and limiting to 2 workers, the closest I can get to what it will be on GitHub Actions runners:
![image](https://private-user-images.githubusercontent.com/27212526/277223626-c25e362e-db11-4ce3-9b38-6db385392c1e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNDAyNDksIm5iZiI6MTczOTIzOTk0OSwicGF0aCI6Ii8yNzIxMjUyNi8yNzcyMjM2MjYtYzI1ZTM2MmUtZGIxMS00Y2UzLTliMzgtNmRiMzg1MzkyYzFlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAyMTIyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY3YjE2MjQ2N2E2MzRkZTQwNmQ1NjhiZTBjYzczZDBkNzgzZTU3MGEyODQwZTI1NTRmMzBiMzc1ZmNiZWY4OGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.JWXSkmFQULQa26MhDNJbwByVnVLCGtDDowjzLwnvTNE)
I also tested linting a Perl repo locally with the new installation method, and works as the original
Proposed Changes
Readiness Checklist
Author/Contributor
Reviewing Maintainer
breaking
if this is a large fundamental changeautomation
,bug
,documentation
,enhancement
,infrastructure
, orperformance