ansible / molecule

Molecule aids in the development and testing of Ansible content: collections, playbooks and roles
https://ansible.readthedocs.io/projects/molecule/
MIT License
3.88k stars 662 forks source link

Mitogen integration #2195

Closed luiscachog closed 5 years ago

luiscachog commented 5 years ago

Issue Type

Molecule and Ansible details

ansible --version && molecule --version

ansible 2.7.0
  config file = /home/luis/ansible.cfg
  configured module search path = ['/home/luis/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/luis/.virtualenvs/python3.6/lib/python3.6/site-packages/ansible
  executable location = /home/luis/.virtualenvs/python3.6/bin/ansible
  python version = 3.6.7 (default, Oct 21 2018, 04:56:05) [GCC 5.4.0 20160609]
molecule, version 2.20.1

Molecule installation method (one of):

Ansible installation method (one of):

Desired Behavior

Integrate mitogen directly on Molecule.

ssbarnea commented 5 years ago

I don't think that any change is needed to enable use of mitogen, if you configure ansible environments right.

dw commented 5 years ago

There is unfortunately apparently some bug I haven't gotten around to sorting yet ( https://github.com/dw/mitogen/issues/467 ), even though @dsgnr was kind enough to create a reproduction for me.

Is anyone here having trouble with Molecule? I admit to not having used it yet

decentral1se commented 5 years ago

Sounds cool, didn't know about this one! It would be cool to speed up execution time because Molecule has to do a lot of work and it is often seen as quite slow. If it goes like @ssbarnea says then we can add a config/option/env var to arrange it all internally to use mitogen.

dw commented 5 years ago

I'm not sure how much integration is really needed -- for example in the reproduction, any Mitogen cutpaste seems to be entirely limited to a few lines in this file: https://github.com/dsgnr/mitogen-molecule-test/blob/master/molecule/default/molecule.yml

Longer term, AFAIK Mazer will have / already has support for packaging up strategy plugins. The existing Galaxy manifest was not flexible enough for it (again AFAIK). Perhaps installing Mitogen is just a specific instance of the general problem of depending on stuff from Galaxy/mazer. (Mitogen does not support this yet, but if it's possible, once mazer is popular it's the obvious solution for packaging in future)

luiscachog commented 5 years ago

Hi,

My suggestion is to integrate it for an easy usage on CI/CD. I'm trying to use it on circleci with the changes described on: https://github.com/dsgnr/mitogen-molecule-test/blob/master/molecule/default/molecule.yml

But it is failing, that is why I prefer to ask for a easy integration.

ssbarnea commented 5 years ago

I will close this because no core is willing to work on doing this but if you find a way to add this as an optional feature, make a PR and we can watch it and see how reliable it is. If it proves decently reliable, we can add this feature.

Still, if Molecule own testing would not pass with mitogen enabled, I will not accept the PR.