nutanix / calm-dsl

Keep Calm and DSL On!
https://nutanix.github.io/calm-dsl/
Apache License 2.0
33 stars 51 forks source link

Re-structure the DSL blueprint.py file created on decompile #127

Open balugeorge opened 4 years ago

balugeorge commented 4 years ago

Using the decompile option on a Blueprint json currently generates a single blueprint.py file along with separate directories for package install scripts and environments specs. The blueprint.py file is easy to understand after investing a bit of effort to understand Calm concepts.

However, editing the blueprint can become really difficult as it grows in complexity(such as addition of multiple profiles).

In case of a BP DSL file with multiple profiles and substrates, quickly identifying which profile a substrate belongs to can be really difficult(unless the substrate/provider name has a clear indication on the profile it belong to). It becomes even more difficult if there are multiple providers of the same type in the BP(say two Nutanix profiles). This is the same for other objects within profiles.

It would be great if we can split the decompiled DSL file into multiple files with a directory structure that would help users to:

  1. Identify and understand calm abstractions easily
  2. Edit a decompiled BP without too much effort

We can start with a structure similar to the one in the screenshot to split out profiles and services.

  1. the common directory will contain any shared components to avoid duplication under profiles
  2. I don’t have any better ideas on where to put the services directory for now bp-structure