# Visualize dependencies

![apollo services](output/services.gv.png)

## Installation

### Graphviz

Graphviz needs to be installed prior to everything else. Follow instruction on the official website https://graphviz.org/download/

### Requirements

1. Create virtual environment:

```shell
python3 -m venv venv
```

2. Activate virtual environment

```shell
source venv/bin/activate
```

3. Install requirements

```shell
python3 -m venv
```

## Usage

Script reads yaml file from standard input, or from a given file

```shell
cat services.yaml | ./main.py
```

or 

```shell
./main.py services.yaml
```

## Configuration format

the following configuration format required:

```yaml
services:
  cluster_a:
    service_a:
      description: 'test 1'
      attrs:
        color: 'black'
      depends_on:
        - service_b
    service_b:
      description: 'test 2'
      attrs:
        color: 'yellow'
  cluster_b:
    service_c:
      description: 'test 1'
      attrs:
        color: 'green'
      depends_on:
        - service_a
        - service_c
    service_d:
      description: 'test 2'
      attrs:
        color: 'red'
```


