Skip to content

Comments

Optimize startup time for parallel tests#40388

Merged
potiuk merged 1 commit intoapache:mainfrom
potiuk:pull-images-before-running-parallel-tests
Jun 23, 2024
Merged

Optimize startup time for parallel tests#40388
potiuk merged 1 commit intoapache:mainfrom
potiuk:pull-images-before-running-parallel-tests

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented Jun 23, 2024

When parallell tests start on CI, they are running parallel docker compose's and on a clean machine in CI this means that every parallel test is pulling the images needed to run tests. This means that backend images are pulled in parallell by all starting parallel runs.

This PR optimizes this step - before running the tests in parallel we run docker compose pull once with the same compose files as tests - this will pull the necessary images only once.

It should save a few seconds and save a lot of unnecessary traffic for CI tests - where same image is pulled multiple times - especially for self-hosted runners of ours where we run 8 docker compose instances in parallel.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@potiuk potiuk force-pushed the pull-images-before-running-parallel-tests branch from 64360a6 to 3943826 Compare June 23, 2024 06:37
@potiuk
Copy link
Member Author

potiuk commented Jun 23, 2024

There were some strange output on "lowest direct" tests in this one, so I will have to take a closer look before we merge this one :).

When parallell tests start on CI, they are running parallel docker
compose's and on a clean machine in CI this means that every parallel
test is pulling the images needed to run tests. This means that
backend images are pulled in parallell by all starting parallel runs.

This PR optimizes this step - before running the tests in parallel
we run `docker compose pull` once with the same compose files as
tests - this will pull the necessary images only once.

It should save a few seconds and save a lot of unnecessary traffic
for CI tests - where same image is pulled multiple times - especially
for self-hosted runners of ours where we run 8 docker compose instances
in parallel.
@potiuk potiuk force-pushed the pull-images-before-running-parallel-tests branch from 3943826 to 6860f9d Compare June 23, 2024 16:44
@potiuk
Copy link
Member Author

potiuk commented Jun 23, 2024

There were some strange output on "lowest direct" tests in this one, so I will have to take a closer look before we merge this one :).

Yeah. I had to disable caching of env variables - because they were always called without TEST_TYPE env variable.

@potiuk potiuk merged commit 741332c into apache:main Jun 23, 2024
@potiuk potiuk deleted the pull-images-before-running-parallel-tests branch June 23, 2024 18:11
romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Jul 26, 2024
When parallell tests start on CI, they are running parallel docker
compose's and on a clean machine in CI this means that every parallel
test is pulling the images needed to run tests. This means that
backend images are pulled in parallell by all starting parallel runs.

This PR optimizes this step - before running the tests in parallel
we run `docker compose pull` once with the same compose files as
tests - this will pull the necessary images only once.

It should save a few seconds and save a lot of unnecessary traffic
for CI tests - where same image is pulled multiple times - especially
for self-hosted runners of ours where we run 8 docker compose instances
in parallel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants