A Dependency Graph Manager
A dependency graph analysis and processing tool written in Python..
In a micro-services scenario, we usually have multiple services with various dependencies. This give us many advantages such as loose coupling, high maintainability & testability.
On the other hand, it brings on its own complexity. Services have multiple dependencies between each other, and it can quickly get difficult to manage.
This tool allows us to scan a services’ spec, then determine in what order we can start them or stop them. In order to make things faster, we can start or stop them in parallel in some cases. Namely:
- Services should be started in parallel if all their dependencies (if any) have already started.
- Services should be stopped in parallel if all their dependents (if any) have already stopped.
From the PyPi repository
Use the package manager pip to install mograph.
pip install mograph
Manually from this repository
You can also clone this repository, install its dependencies and run the tool from there.
# Clone the repository git clone email@example.com:molamk/mograph.git && cd mograph # Install the project python3 setup.py develop
The program works as follows:
- Load a yaml file describing some services with dependencies.
- Analyze the dependencies and build the graph.
- Print the starting (or stopping) sequence.
The yaml file looks something like this:
# services.yaml mysql: deps:  zookeeper: deps:  kibana: deps: - mysql fullhouse: deps: - kibana - zookeeper
To run the program, invoke it with either the start command or stop:
mograph start ./services.yaml # or (depending on your configuration) python3 -m mograph ./services.yaml
The output should be:
START SEQUENCE 0 : ['mysql', 'zookeeper'] 1 : ['kibana'] 2 : ['fullhouse']
And for the stop command, it should look like this:
STOP SEQUENCE 0 : ['fullhouse'] 1 : ['zookeeper', 'kibana'] 2 : ['mysql']
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size mograph-0.1.5-py3-none-any.whl (12.9 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size mograph-0.1.5.tar.gz (11.3 kB)||File type Source||Python version None||Upload date||Hashes View|