-
Notifications
You must be signed in to change notification settings - Fork 667
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
WIP: Enable *some* parallelizable sequences for Molecule #2135
WIP: Enable *some* parallelizable sequences for Molecule #2135
Conversation
7be2c2b
to
1d31520
Compare
1d31520
to
6c11d96
Compare
I have a few scattered thoughts, with no guarantees that any of them are useful. As always, I apologize in advance for the verbosity. Of all of these thoughts, I think only the
|
How about a “molecule_naming_suffix” which would be empty by default in non-parallel mode? We should keep the logic of how we determine that suffix separated from the places where we use it. |
Ah, I didn't realise others might want this for other purposes. Sounds good.
Well, it's all a bit circular but the way I have it my head is: 1) end-user passes --parallel 2) we store that on the Config 3) we generate the uuid. If we remove the is_parallel_mode, we'll have to do hasattr checks instead for the uuid property? Perhaps the uuid will not be the defining indicator of whether or not things are going in parallel mode, so I think it makes sense to keep this high level "the user passes --parallel" and leave uuid/whatever as deeper _internals. You mentioned this in your last point.
I think that's for another PR but I was thinking about announcing the uuid that was under for the run (some obvious logging) and then extending
Yep, agreed! It will be coming down the line on this PR.
Good point. |
Well, I see no major objections to the approach, so I'll try to get this into a reviewable state. |
OK, next attempt @ #2137. |
OK, here is a working draft of a potential approach to running molecule in parallel. This is not the final implementation but rather something that can be tested early by those who need it. Please test it! I need constructive feedback on this change and this approach.
Notes on the implementation:
--parallel
flag which is stored at the molecule.config.Config levelparallel_run_uuid
at the molecule.scenario.Scenario levelmolecule create --parallel && molecule login
because theparallel_run_uuid
will be lost and molecule won't know which state to load.How to Test
I tested this with the following commands:
This shows how we can run molecule in parallel 3 times and shows how each separate cache folder created as well as the separate instances. I've played around with it a bit and it looks to be a working proof-of-concept.
TODO:
--enable-parallel
since--parallel
might be misleading because Molecule itself does not manage any parallelization itself but simply allows the internals to be parallelized.