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

[ci] make use of composer install cache to make parallel jobs faster #12695

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

TomasVotruba
Copy link
Contributor

No description provided.

@TomasVotruba TomasVotruba marked this pull request as ready for review September 5, 2023 12:29
@mollux
Copy link
Contributor

mollux commented Sep 5, 2023

@TomasVotruba this makes sense.

I retriggered the CI pipeline to see the effect

@mollux mollux added the CI Anything related to CI (Continuous Integration) label Sep 5, 2023
@TomasVotruba
Copy link
Contributor Author

Thanks 👍

I've checked the CI jobs on my PR and they were extreemely long. I thought it's the databse, but the composer was taking 1-2 minutes in most cases.

I use this Github action everywhere for past 5 years.
It solves composer caching in the best way possible, in the background and for us 👍

@TomasVotruba
Copy link
Contributor Author

Good to go ✔️

@mollux
Copy link
Contributor

mollux commented Sep 5, 2023

@TomasVotruba

can you elaborate on extremely long CI jobs?
I see this PR as a valuable improvement, but the impact is not that

as the caching merely removed 10 - 20 seconds

before / first run

after / cached run

@TomasVotruba
Copy link
Contributor Author

TomasVotruba commented Sep 5, 2023

The 1 m 22 seconds is way too much for composer install, even for 248 packages. I think the caching might kick-in later, as 1st run has to trigger it.


To compare, Rector has 93 packages to install - https://github.com/rectorphp/rector-src/actions/runs/6085162917/job/16508611947, including patching +10 files

It's done in 13 seconds.

image


I'll check for the bottleneck further, to keep scope of this PR narrow and easy to merge 👍

@mollux
Copy link
Contributor

mollux commented Sep 5, 2023

@TomasVotruba

the cache is active, see screenshot of the run and the cache.

But still a no-brainer improvement! 🥳

Screenshot 2023-09-05 at 15 26 06

Screenshot 2023-09-05 at 15 27 17

@TomasVotruba
Copy link
Contributor Author

Exactly 😆

@mollux
Copy link
Contributor

mollux commented Sep 5, 2023

@TomasVotruba
be aware that there are some extra tasks executed in the Composer post install event, see post-install-cmd.
That may be the main reason of the longer time, as e.g. assets need to be compiled.

I was just looking to the capabilities of the that github Action, to check if it could also run the composer validate.
But we have another task / test that does that + vallidation if the composer.lock file fully corresponds with the changes in composer.json

so good to go!

Copy link
Sponsor Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea! 💡

@escopecz escopecz added the enhancement Any improvement to an existing feature or functionality label Sep 5, 2023
@escopecz escopecz added this to the 5.0-beta milestone Sep 5, 2023
@escopecz escopecz merged commit 01fdd19 into mautic:5.x Sep 5, 2023
14 checks passed
@TomasVotruba TomasVotruba deleted the tv-faster-composer-install branch September 5, 2023 17:21
@TomasVotruba
Copy link
Contributor Author

Thanks for quick merge 🥳

@escopecz escopecz added chore Tasks that relate to maintaining this Github repository and removed enhancement Any improvement to an existing feature or functionality labels Sep 6, 2023
@staabm
Copy link
Contributor

staabm commented Sep 12, 2023

fyi, I did some measuring with rector on the mautic code-base and found some low hanging fruits.

memory wise you should now be able to run rector without a ever climbing RAM usage (not yet released)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Tasks that relate to maintaining this Github repository CI Anything related to CI (Continuous Integration)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants