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

Split shop building in independent single job for optimization #44

Merged
merged 37 commits into from
Sep 25, 2023

Conversation

jolelievre
Copy link
Contributor

@jolelievre jolelievre commented Aug 17, 2023

Questions Answers
Description? Split docker building in an independent single job for optimization, then the sources and dump are shared as artifacts for the following steps that handles test commands thus making the setup of the shop faster

This PR comes with a related one in the core PrestaShop/PrestaShop#33690 Not required but it allows optimizing a bit more the test phase (no need to install composer and node in the docker during the second test phase since everything has already been installed and built)

The workflow itself has multiple optimizations:
  • Only one build for all following campaigns
  • Sanity tests are handled separately because they already handle installation, that saves some build time and improves stability
  • Keycloak service is only built for API tests
  • Long campaigns are started in priority to optimize the total duration
  • You can now run a single dedicated campaign
  • Javascript dependencies are run in parallel to win a bit of time, a systematic check is performed at the end to make sure the built is over
  • Docker images are pulled and built early in background while dependencies are built/installed to save some time during the final build


New features:
  • Possibility to run a single campaign
  • Possibility run force fast fail (still false by default)
Type? improvement
BC breaks? no
Deprecations? no
Fixed ticket? ~
Sponsor company ~
How to test? ~

Remaining possible improvement

  • the base branch from PR could be used to avoid selecting it manually

Benchmark

Using the optimized PR PrestaShop/PrestaShop#33690

Only this benchmark was run without another build in parallel for the sake of showing the improvement

With the split workflow

Without cache

https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/6207662484
Total duration: 31m 5s
Total run time: 7h 20m 47s

With cache already set

https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/6208145339
Total duration: 31m 18s
Total run time: 7h 1m 43s

Note

In both cases sanity tests are fixed

With the split framework but less cache management

Without cache

https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/6278375332

With cache already set

https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/6276944907
Total duration: 33m 30s
Total run time: 7h 18m 49s

Without the split workflow

No cache system

https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/6208570595
Total duration: 54m 49s
Total run time: 10h 30m 48s

Warning

Sanity tests failing, which makes the total duration longer because failing tests are long to finish

Other PRs

Merge PR

PrestaShop/PrestaShop#33952
https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/6208800734

PR to update doctrine that failed sanity tests

PrestaShop/PrestaShop#33459
https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/6226478282

PR targeting 8.1.x

PrestaShop/PrestaShop#33930

Split jobs

https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/6226487438

No split jobs

https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/6222099607

PR that updates ps_linklist

PrestaShop/PrestaShop#33853

Split jobs

https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/6208823720

No split jobs

https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/6222085952

@boubkerbribri
Copy link
Contributor

I love this, did you start a test somewhere ?

@jolelievre
Copy link
Contributor Author

@boubkerbribri yep one of the tests https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/5891548178 but it's not working yet I'm still experiencing

.github/workflows/pr_test.yml Outdated Show resolved Hide resolved
.github/workflows/pr_test.yml Outdated Show resolved Hide resolved
.github/workflows/pr_test.yml Outdated Show resolved Hide resolved
.docker/docker-compose.yml Outdated Show resolved Hide resolved
.docker/docker-compose.yml Outdated Show resolved Hide resolved
@jolelievre jolelievre changed the title Split docker building in independent single job for optimization Split shop building in independent single job for optimization Sep 22, 2023
@jolelievre jolelievre merged commit 9e95ce5 into PrestaShop:main Sep 25, 2023
@matks
Copy link

matks commented Sep 25, 2023

Great job @jolelievre and thank you @Progi1984 and @boubkerbribri for the extensive review work

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

Successfully merging this pull request may close these issues.

6 participants