# Enabling Role-Based Orchestration for Cloud Applications
## 4 Experimental Evaluation
### TOSCA Model Conversion Cost  
We defined the WordPress application of our motivational scenario in our extended TOSCA model. Listing 5 is a YAML snippet of TOSCA Topology Template of the sample application. The TOSCA Topology Template consists of multiple parts: two workload Node templates representing the WordPress application and MongoDB database, two operational Node templates for auto-scaling and rollout capabilities, and a Relationship template connecting the nodes. Given the TOSCA Service Template specification as input, our prototype system generates a manifest of OAM resources including an Application Configuration and two Components as in Listing 6. Through observing the mapping relationship between the same name fields in the two listings, we can see how the conversion is actually performed. Each property of extended TOSCA types has a corresponding field in OAM entities. The OAM Kubernetes runtime will provision and deploy the application according to the OAM manifest in a Kubernetes cluster. To evaluate the performance of the model conversion engine, we performed a series of conversions of different TOSCA Service Templates into OAM configurations. The motivational scenario serves as a baseline to compare the execution times of the cases with an increasing number of workloads and operational capability nodes. Conversions for the same service template with varying number of workloads were executed ten times. Elapsed times for the model translation are plotted in Figure 10 across different scales of the application. As seen in the graph, the conversion time increases gradually, as the application becomes more complicated. ```
1 topology_template:
2 node_template:
3 mongodb-comp:
4 type: dcc.workload.containerized
5 properties:
6...
7 wordpress-comp:
8 type: dcc.workload.containerized
9 properties:
10 containers:
11-name: wordpress-app
13 image: dcc-dev/wordpress-app:1.0
14 ports:
15-containerPort: 8080
16 name: wordpress-svc
17 requirements:
18-connect-to: monogodb-comp
19 relationship: workloads_connection
20 auto-scaling:
21 type: dcc.operational.autoScaling
22 properties:
23 maxReplicaCount: 5
24 minReplicaCount: 1
25 promQuery: sum(rate(http_request[Zm]))
26 promThreshold: 3
27 requirements:
28-attach-to: wordpress-comp
29 relationship: attachesTo
30
31 rollout:
32 type: dcc.operational.simpleRollout
33 properties:
34...
35 requirements:
36-attach-to: wordpress-comp
37 relationship: attachesTo

Figure 9: Key components of WordPress application deployment. ```
1 apiVersion:core.oam.dev/v1 alpha2 kind:ApplicationConfiguration
3 metadata:
4 name:WordPress-app
5 spec:
6 components:
7-componentName:mongodb-comp
8 dataOutputs:
9-name:mongodb-conn-endpoint
10 fieldPath:status.connEndpoint
11-name:mongodb-conn-secret
12 fieldPath:status.connSecret
13-componentName:wordpress-comp
14 dataInputs:
15-name:mongodb-conn-endpoint
16 fieldPath:spec...connEndpoint
17-name:mongodb-conn-secret
18 fieldPath:spec...connSecret
19 traits:
20-trait:
21 apiVersion:extend.dcc/v1 alpha1
22 kind:AutoScaling
23 spec:
24 maxReplicaCount:5 minReplicaCount:1
25 promQuery:sum(rate(http_request[2m]))
26 promThreshold:3
27-trait:
28 apiVersion:extend.dcc/v1 alpha1
29 kind:SimpleRollout
31 spec:
32...
33
34 apiVersion:core.oam.dev/v1 alpha2
35 kind:Component
36 metadata:
37 name:wordpress-comp
38 spec:
39 workload:
40 apiVersion:core.oam.dev/v1 alpha2
41 kind:ContainerizedWorkload
42 spec:
43 containers:
44-name:wordpress-app
45 image:dcc-dev/wordpress-app:1.0
46 ports:
47-containerPort:8080
48 name:wordpress-svc
```
**Listing 6** Resultant OAM Application Configuration. ### Deployment and Complexity Reduction

The conversion module outputs OAM manifests that are fed into OAM Kubernetes runtime in a target Kubernetes cluster. To evaluate the deployment of applications across diverse cloud environments, we installed our orchestration system on four mainstream cloud platforms including Amazon Web Service, Microsoft Azure, Google Cloud, and Alibaba Cloud.