In this tutorial you will learn how to write your own workflow of deployment, add it to the catalog and use it from the ProActive Service-Automation Portal.

To do so, we will use the Clearwater framework as an example of service.

To manage our service, we have to create 2 actions: the deployment and the termination. Those actions will be defined as workflows

Clearwater is an open source implementation of IMS (the IP Multimedia Subsystem) designed from the ground up for massively scalable deployment in the Cloud to provide voice, video and messaging services to millions of users. Clearwater combines the economics of over-the-top style service platforms with the standards compliance expected of telco-grade communications network solutions, and its Cloud-oriented design makes it extremely well suited for deployment in a Network Functions Virtualization (NFV) environment.

1 Write the deployment action

  1. Go to ProActive studio

  2. Register with your credentials that you provided

  3. Create a new workflow : 2 tasks will be added, the first one is used to deploy the service thanks to docker-compose, and the second one to export some variables to the ProActive Service Automation in order to integrate with the Portal.

  4. For this deployment, we will use docker and docker-compose. So it will be necessary to have these technologies installed on the machine where you want do deploy your Clearwater instance. For this tutorial, we will do it on the Try platform where we have these both technologies installed.

  5. We want to have the possibility to chose the port where the UI will be accessible, the name that will be given to the instance and which infrastructure will be used to deploy Clearwater. So we will add variables to our workflow.

    #{Try} will be transformed into a list in the Service-Automation portal when we will have to fill the fields for launching the workflow, if we wanted more elements, we could have written #{try,Openstack} for instance.

  6. So we will have to create a bash task in order to use docker-compose and the work of MetaSwitch team

    #retrieve the name used for containers
    #write the content of the docker-compose to a new file in order to use it for instanciate our clearwater
    echo -e "version: '2'
        command: >
          -name etcd0
          -advertise-client-urls http://etcd:2379,http://etcd:4001
          -initial-advertise-peer-urls http://etcd:2380
          -initial-cluster etcd0=http://etcd:2380
          -initial-cluster-state new
        image: martinacti/bono
          - "${name_Containers}sprout"
          - 22
          - "3478:3478"
          - "3478:3478/udp"
          - "5060:5060"
          - "5060:5060/udp"
          - "5062:5062"
        image: martinacti/sprout
          - "${name_Containers}homestead"
          - "${name_Containers}homer"
          - "${name_Containers}ralf"
              - scscf.sprout
              - icscf.sprout
          - 22
        image: martinacti/homestead
          - 22
        image: martinacti/homer
          - 22
        image: martinacti/ralf
          - 22
        image: martinacti/ellis
          - "${name_Containers}homestead"
          - "${name_Containers}homer"
          - 22
          - "$variables_port_redirection_UI:80""> "docker-compose.yml"
    #execute the command to launch the cluster
    docker-compose up -d

  7. Now you need to add a JavaScript task which must be called "end_deployment" that depends on the first one

    //initiate a JSON object
    var myObject = {};
    //retrieve name of instance and store it in the id field"instance_name");
    //put the status RUNNING
    //get the endpoint of the application, here, this is the address of the dashboard
    myObject.endpoint= ""+variables.get("port_redirection_UI");
    //put the string version of the JSon into the task result
    The goal of this task is to add the information needed from the ProActive Service Automation to show when the instance is deployed.

2 Add your deployment action to the ProActive Service Automation

Create your first task

  1. You will need to add Generic Info to your workflow.

  2. Now we will configure the workflow so it will be used by the ProActive Service Automation service and available on its portal. To do so, workflows have to contain a set of generic information which describes the action thanks. These generic information is clearly defined and always the same.

    pca.service.model Unique ID for your workflow:
    pca.service.type Type of your instance:
    Application Name of your service:
    pca.service.description Description of your service:
    open source implementation of IMS
    pca.action.type Type of action that workflow will provide:
    create Name that you will define for your action, for instance:
    Deploy Clearwater
    pca.action.description Description of the action that your workflow provide, example:
    Create a Clearwater instance
    pca.action.origin_state Instance state needed for launching the workflow:
    pca.action.icon URL for icon of your service, here we can use:

  3. Then, when you have added the generic information you can click on the Catalog button in the studio and select the bucket service-automation. You will see the workflows that are already in the Catalog. Now you want to publish your workflow.

    Click on Publish

  4. Then you can go on ProActive Service Automation Portal and see your service in catalog section

3 Write the termination action

  1. Create a new worflow and with 2 variables, one called instance_name and the other infrastructure_name, then, add a bash task

    #the goal will be to delete containers with this instance_name
    docker rm -fv $(docker ps -a -q --filter "name=^[^\w\s]\d*_$variables_instance_name(bono|sprout|ellis|homestead|homer|ralf)_\d$")
  2. Once the worflow is finished, you will need to add same generic information to the workflow that previously. The important is to put the same pca.service.model for the both worflow, deployement and delete. It is the way that Service Automation Portal can link these both workflows together. Here are the information to provide :

    So we have the same pca.service.model, the pca.action.type is delete and pca.action.origin.state is RUNNING because the instance of Clearwater needs to be RUNNING so we can apply the delete on it.

  3. Now, you just have to add it in the bucket service-automation in the catalog.

  4. You can click on the bin and see that your instance has disappeared.