Skip to the content.

Code style: black

Build

calm-dsl

About Calm DSL

Calm DSL describes a simpler Python3 based DSL for writing Calm blueprints. As Calm uses Services, Packages, Substrates, Deployments and Application Profiles as building blocks for a Blueprint, these entities can be defined as python classes. Their attributes can be specified as class attributes and actions on those entities (procedural runbooks) can be defined neatly as class methods. Calm blueprint DSL can also accept appropriate native data formats such as YAML and JSON, allowing the reuse and leveraging that work into the larger application lifecycle context of a Calm blueprint.

Why Python3 as DSL ?

Language design is black art, and building upon a well-established language is design-wise a big win. The language has also solved many issues like scoping, modules, if-else, inheritance, etc. Well established languages have great tooling support: IDEs, syntax checkers, third-party modules, coding practices, better readability, editing, syntax highlighting, code completion, versioning, collaboration, etc. They see much more community improvements as well. Python specifically comes with a very good REPL (read–eval–print-loop). Having an interactive prompt to play around and slowly build objects is an order-of-magnitude improvement in developer productivity. Python is very easy language to learn and use; and most of the ITOps/DevOps community already use Python for scripting.

Getting Started for Developers

Initialization

Calm DSL Context

Context info includes server, project and log configuration for dsl operations.

Blueprint

Application

Brownfield Application

Decompiling Blueprints (.json->.py)

Decompilation is process to consume json data for any entity and convert it back to dsl python helpers/classes. Currently, decompile is supported for converting blueprint json to python files. Summary of support for blueprint decompilation(Experimental feature):

Runbooks

Decompiling Runbooks (.json->.py)

Decompilation is process to consume json data for any entity and convert it back to dsl python helpers/classes. Currently, decompile is supported for converting blueprint and runbook jsons to python files. Summary of support for runbook decompilation(Experimental feature):

Task Library

Getting started for Admins

Initialization

Calm DSL Context

Context information includes server, project and log configuration for dsl operations.

Roles

Use calm get roles to list all roles in PC. The below roles are relevant for Calm:

Directory Services

Users

User-Groups

Projects

Environments

Access Control Policies

Access control policies ensures that a project member can access only the entities or perform only the actions defined in the role assigned to that project member.

Examples

Sample Project flow for Admin users:

Sample Project Flow for Project Admin users:

Docker

Dev Setup

MacOS:

Centos:

Use:

Documentation

Blogs

Demos