This repository was archived by the owner on Jan 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
Rework how install and run work internally #145
Copy link
Copy link
Closed
Description
This is a post-Summit problem
Given an example of wordpress application:
wordpress-atomicapp
├── mariadb-atomicapp
└── skydns-atomicapp
When install is called, atomicapp installs wordpress-atomicapp and, loads Nulecule and goes through graph. When it finds external dependency it recursively starts installation for this dependency with a destination path external/<dep-app-id>. Once the installation of dependency is finished, recursion ends and the graph cycle goes on.
Example:
atomicapp install wordpress-atomicapp
FOUND mariadb-atomicapp:
atomicapp install --destination external/mariadb-atomicapp mariadb-atomicapp
FOUND skydns-atomicapp:
atomicapp install --destination external/skydns-atomicapp skydns-atomicapp
It works the same for run.
Problems
- Once install is finished for a dependency, atomicapp cannot access it's data easily
- We cannot easily inspect what a dependency provides (f.e. providers) and thus cannot give a user list of available providers or guess default provider
- It would be better if
provider.deploy()happened from one "cycle" not from a recursively called instance cause that makes it hard to properly react if something fails.
Solution
Implement a Python class which will represent a Nulecule application (nulecule_base.py is sort of where to start) and
- Create object for the main app
- Create objects for all deps and reference them from main app object
- Rework install and run so that once all objects are created and filled with data, install/run gathers them to a single list and performs needed actions.
Comments?:)