Jump to: navigation, search

Difference between revisions of "Murano/Documentation/How to create application package"

(Step1. Prepare installation scripts)
(Step1. Prepare Execution Plans)
Line 12: Line 12:
 
* '''Parameters''' - parameters required by execution scripts
 
* '''Parameters''' - parameters required by execution scripts
 
* '''Body''' - Python statement, should start with | symbol
 
* '''Body''' - Python statement, should start with | symbol
* '''Scripts''' - dictionary that maps script names to script definitions. Note that specified files should be exist under ''Resource/scripts'' directory and path to them can be nested.
+
* '''Scripts''' - dictionary that maps script names to script definitions.
:Scripts are the building blocks of Execution Plans and they may be executed as a whole (like a single piece of code), expose some functions that can be independently called in Execution Plan script or both. This depends on Deployment Platform and Executor capabilities.
+
:Scripts are the building blocks of Execution Plans and they may be executed as a whole (like a single piece of code), expose some functions that can be independently called in Execution Plan script or both. This depends on Deployment Platform and Executor capabilities. One script can be defined with the following properties:
 
 
:Scripts are specified using “Scripts” attribute of Execution Plan. This attribute maps script name to a structure (document) that describes the script. It has the following properties:
 
 
:* '''Type:''' Deployment Platform name that script is targeted to.  
 
:* '''Type:''' Deployment Platform name that script is targeted to.  
 
:* '''Version:''' optional minimum version of deployment platform/executor required by the script.  
 
:* '''Version:''' optional minimum version of deployment platform/executor required by the script.  
:* '''EntryPoint:''' ID of the file that contains entry point for the script (eg. main file).
+
:* '''EntryPoint:''' relative path to the file that contains has a script entry point
:* '''Files.''' This is an optional array of additional files (IDs)  that are required for the script
+
:* '''Files.''' This is an optional array of additional files that are required for the script. These files should be exist under ''Resource/scripts'' directory and path to them can be nested.
:* '''Options:''' an optional dictionary of type String->JsonObject that contains additional options for script Executor. If not provided than empty dictionary is assumed.
+
:* '''Options:''' an optional argument of type contains additional options
  
:Type and EntryPoints attributes are mandatory. Execution plan must fail immediately if it contains any scripts without those attributes. The same is also true if Files entry of Execution Plan does not contain any of mentioned script files (entry point or additional files).
 
 
''Example"
 
''Example"
 
  FormatVersion: 2.0.0
 
  FormatVersion: 2.0.0

Revision as of 11:03, 14 April 2014

Composing application package manual

Murano is Application catalog that supports types of applications. To deploy an application with the Murano This document intends to make composing application packages easily.

Step1. Prepare Execution Plans

An Execution Plan is a set of metadata that describes the installation process of an application in a virtual machine. It's a minimal unit of execution that can be triggered in Murano Workflows and should be understandable by Murano agent. From Execution plans any script can be triggered. It could be any type of scripts which will execute commands and install application components as the result. Each script may consists of one or more files. Scripts may be reused across several Execution Plans. One of the scripts should be an entry point and should be specified in a resource template file in a Scripts. Besides this Scripts section the following section must be presented in a resource template file:

  • FormatVersion - version of Execution Plan syntax format
  • Version - version of Execution Plan
  • Name - human-readable name of the Execution Plan
  • Parameters - parameters required by execution scripts
  • Body - Python statement, should start with | symbol
  • Scripts - dictionary that maps script names to script definitions.
Scripts are the building blocks of Execution Plans and they may be executed as a whole (like a single piece of code), expose some functions that can be independently called in Execution Plan script or both. This depends on Deployment Platform and Executor capabilities. One script can be defined with the following properties:
  • Type: Deployment Platform name that script is targeted to.
  • Version: optional minimum version of deployment platform/executor required by the script.
  • EntryPoint: relative path to the file that contains has a script entry point
  • Files. This is an optional array of additional files that are required for the script. These files should be exist under Resource/scripts directory and path to them can be nested.
  • Options: an optional argument of type contains additional options

Example"

FormatVersion: 2.0.0
Version: 1.0.0
Name: Deploy Telnet
Parameters:
 appName: $appName

Body: |
 return deploy(args.appName).stdout

Scripts:
 deploy:
   Type: Application
   Version: 1.0.0
   EntryPoint: deployTelnet.sh
   Files:
     - <installer.sh>
     - <common.sh>
   Options:
     captureStdout: true
     captureStderr: false

Step2. Prepare MuranoPL class definitions

MuranoPL classes control application deployment workflow execution. Full information about MuranoPL classes can be found here.

Step3. Prepare installation scripts