xlab-si / xopera-opera

xOpera orchestrator compliant with TOSCA YAML v1.3 in the making
https://xlab-si.github.io/xopera-docs/
Apache License 2.0
35 stars 14 forks source link

Present orchestration process with graph of nodes and relations #189

Open anzoman opened 3 years ago

anzoman commented 3 years ago

Description

The TOSCA blueprint and its orchestration process can be represented with nodes and relationships between them. Moreover, we create a DAC (Directed Acyclic Graph) with nodes and relations that gives us the estimated structure of the deployment and undeployment. The info about that can already be retrieved and used from the opera python library. However, for the users of the CLI it could be useful to see it there.

Some time ago we wanted to have the a separate command that would print out the graph in the desired format (XML, YAML, JSON or some tree structure). So, I propose either creating new opera graph CLI command or adding --graph and other flags to opera validate CLI command.

Steps

The main part for creating DAC happens in src/opera/instance/node.py. We need to study it in order to see how we can retrieve or create the graph.

After that we can use some available pip packages to store the graph to a desired format. The graphviz and pygraphviz seem to be useful for us.

Current behaviour

The nodes and their order and relationships can be retrieved in python files by importing and using the opera library.

Expected results

To be able to retrieve tree-structure of the orchestration in the desired format.