neoave / mrack

Multicloud use-case based multihost async provisioner for CIs and testing during development
Apache License 2.0
11 stars 14 forks source link

refactor: [draft][rfc] mrack session + host as context holder #246

Open pvoborni opened 1 year ago

pvoborni commented 1 year ago

This PR is currently more like an idea/RFC (request-for-comments). There is a lot of stuff missing, opening early to get feedback if it is a good idea.

The idea behind this is to not use global objects and rather pass a session object which would contain whole context (config, provisioning config, metadata, database, initialized providers). Adding the session to other objects (host, providers, transformers, outputs, actions).

I'd also unitize Host object for carrying a provisioning context. I.e. it would be initialized e.g. in following way:

Also the PR adds more python typing - helps with the refactoring to find areas which has type mismatch.

The envisioned benefits/purposes are: