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

The CI is too slow #1669

Closed
decentral1se opened this issue Jan 16, 2019 · 14 comments
Closed

The CI is too slow #1669

decentral1se opened this issue Jan 16, 2019 · 14 comments
Labels
test Improvement to quality assurance: CI/CD, testing, building

Comments

@decentral1se
Copy link
Contributor

Issue Type

  • Gripe about the CI

On https://travis-ci.com/ansible/molecule/builds/97459293, we saw:

Ran for 1 hr 26 min 9 sec
Total time 4 hrs 59 min 45 sec 

Hopefully this ticket can be a place to gather ideas on how to speed this process up.

PS. I am thankful for all the great work that has been done to get this CI in place.

@ragingpastry
Copy link
Contributor

ragingpastry commented Jan 16, 2019

Is this something that could be fixed using a tool like detox?

@ssbarnea
Copy link
Member

I am not sure if there is much to be done about it as molecule needs to test a huge combination of python versions, ansible versions, platforms/distributions, containers/vms/clouds...

Even with a paid travis plan this could be limited. I wonder if using openstack build infrastructure would not be a better way to test changes.

@ragingpastry
Copy link
Contributor

Detox would help the execution of python / ansible tests as they would happen concurrently which could speed some things up. Maybe "fixed" was the incorrect word to use but I could see concurrent builds working fairly quickly.

@decentral1se
Copy link
Contributor Author

decentral1se commented Jan 20, 2019

OK, detox might be a good first step then but I see in that repository link:

detox is unmaintained and incompatible with tox > 3.6. detox was a plugin for tox to enable parallel environment execution. tox 3.7 added a native possibility to do this (tox -p|--parallel) and effectively supercedes detox.

So, perhaps we can improve by simply passing -p FOO!

EDIT: See https://tox.readthedocs.io/en/latest/config.html.

decentral1se added a commit to decentral1se/molecule that referenced this issue Jan 20, 2019
Something for ansible#1669.

Signed-off-by: Luke Murphy <lukewm@riseup.net>
@decentral1se
Copy link
Contributor Author

OK, after some experimenting. I see that we can't get anything out of detox/tox -p because we run each build environment in isolation. We can't parallelize this. I thought it might be useful in that it would speed up somehow these individual builds (by using multiple cores) but that functionality doesn't seem to offered.

@themr0c
Copy link
Contributor

themr0c commented Jan 23, 2019

Would sitepackages = true in tox.ini bring some improvement?

@themr0c
Copy link
Contributor

themr0c commented Jan 23, 2019

Some tests don't need the all armada of requirements to be installed, so we could gain time here also. For instance, AFAIK, lint only need flake8 (and should not depend on, let's say, having lxc up and running)

@decentral1se
Copy link
Contributor Author

@themr0c, good idea about the requirements! Not sure about sitepackages. Let's try these.

And just to link, #1698 looks like it will definitely help!

@decentral1se
Copy link
Contributor Author

#1695 addresses the linting install skips? Think so.

@webknjaz
Copy link
Member

Related to: #1702 (comment)

Once the problem with parallel Molecule execution is solved, we can try using thread-based parallelism which via pytest-xdist. It could improve things dramatically.

@decentral1se
Copy link
Contributor Author

dramatically

🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉

@themr0c
Copy link
Contributor

themr0c commented Jan 28, 2019

Are we not installing the packages twice ? First time with deps = -rrequirements.txt, and a second time with PBR install (that can be skipped with skip_install = true) ? So maybe removing the line with rrequirements.txt could help gain some seconds ?

themr0c added a commit to themr0c/molecule that referenced this issue Jan 29, 2019
…gain, maybe only 5 minutes in total, because we are targeting 3 to 4 minutes jobs, and travis runners have only 2 cores.

Signed-off-by: Fabrice Flore-Thebault <themr0c@users.noreply.github.com>
@webknjaz
Copy link
Member

@themr0c I hope once pbr is removed, we'll have it in one place anyway. I'd not touch it right now.

webknjaz pushed a commit that referenced this issue Jan 29, 2019
It won't be a huge gain, maybe only 5 minutes in total,
because we are targeting 3 to 4 minutes jobs,
and travis runners have only 2 cores.

PR #1706. Ref #1669.

Signed-off-by: Fabrice Flore-Thebault <themr0c@users.noreply.github.com>
@decentral1se decentral1se added the test Improvement to quality assurance: CI/CD, testing, building label Jan 31, 2019
@decentral1se decentral1se added this to the v.2.21 milestone Jan 31, 2019
ssbarnea pushed a commit to ssbarnea/molecule that referenced this issue Jan 31, 2019
It won't be a huge gain, maybe only 5 minutes in total,
because we are targeting 3 to 4 minutes jobs,
and travis runners have only 2 cores.

PR ansible#1706. Ref ansible#1669.

Signed-off-by: Fabrice Flore-Thebault <themr0c@users.noreply.github.com>
@decentral1se decentral1se removed this from the v.2.21 milestone Feb 27, 2019
@decentral1se
Copy link
Contributor Author

I think we've done a lot of good things with regard to this. The major remaining issue (run things in parallel) is tracked elsewhere and we're also moving forward with Zuul integration (see #1770) too! I'm gonna close this off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Improvement to quality assurance: CI/CD, testing, building
Projects
None yet
Development

No branches or pull requests

5 participants