You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2015/03/03 13:14:26 UTC

stratos git commit: Fixed more-complex-app sample application.

Repository: stratos
Updated Branches:
  refs/heads/master a7d0473da -> d76559436


Fixed more-complex-app sample application.


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/d7655943
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/d7655943
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/d7655943

Branch: refs/heads/master
Commit: d7655943634820ffd7fd83f0d4cc47756712ba1f
Parents: a7d0473
Author: Dinithi <di...@wso2.com>
Authored: Tue Mar 3 17:04:21 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Tue Mar 3 17:04:21 2015 +0530

----------------------------------------------------------------------
 .../nested-group/artifacts/application.json     | 14 ++++++-----
 .../artifacts/autoscaling-policy.json           | 14 +++++++++++
 .../artifacts/deployment-policy.json            | 25 ++++++++++++++++++++
 .../nested-group/scripts/common/deploy.sh       | 16 ++++++++++---
 samples/cartridges-groups/group6c.json          |  8 ++++---
 5 files changed, 65 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/d7655943/samples/applications/nested-group/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/nested-group/artifacts/application.json b/samples/applications/nested-group/artifacts/application.json
index 2ab76df..d7a6e04 100644
--- a/samples/applications/nested-group/artifacts/application.json
+++ b/samples/applications/nested-group/artifacts/application.json
@@ -5,13 +5,14 @@
         "groups": [
             {
                 "name": "group6",
-                "alias": "mygroup6",
+                "alias": "my-group6",
                 "groupMinInstances": 1,
                 "groupMaxInstances": 1,
+                "deploymentPolicy":"deployment-policy-2",
                 "groups": [
                     {
                         "name": "group7",
-                        "alias": "mygroup7",
+                        "alias": "my-group7",
                         "groupMinInstances": 1,
                         "groupMaxInstances": 1,
                         "cartridges": [
@@ -20,7 +21,7 @@
                                 "cartridgeMin": 1,
                                 "cartridgeMax": 2,
                                 "subscribableInfo": {
-                                    "alias": "group7tom",
+                                    "alias": "my-tomcat1-group7",
                                     "autoscalingPolicy": "autoscaling-policy-1",
                                     "artifactRepository":{
                                         "privateRepo":false,
@@ -39,7 +40,7 @@
                         "cartridgeMin": 1,
                         "cartridgeMax": 2,
                         "subscribableInfo": {
-                            "alias": "group6tom",
+                            "alias": "my-tomcat2-group6",
                             "autoscalingPolicy": "autoscaling-policy-1",
                             "artifactRepository":{
                                 "privateRepo":false,
@@ -58,8 +59,9 @@
                 "cartridgeMin": 1,
                 "cartridgeMax": 2,
                 "subscribableInfo": {
-                    "alias": "mytomcat",
+                    "alias": "my-tomcat",
                     "autoscalingPolicy": "autoscaling-policy-1",
+                    "deploymentPolicy":"deployment-policy-2",
                     "artifactRepository":{
                         "privateRepo":false,
                         "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
@@ -71,7 +73,7 @@
         ],
         "dependencies": {
             "startupOrders": [
-                "group.group6,cartridge.tomcat"
+                "group.my-group6,cartridge.my-tomcat"
             ],
             "terminationBehaviour": "terminate-all"
         }

http://git-wip-us.apache.org/repos/asf/stratos/blob/d7655943/samples/applications/nested-group/artifacts/autoscaling-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/nested-group/artifacts/autoscaling-policy.json b/samples/applications/nested-group/artifacts/autoscaling-policy.json
new file mode 100755
index 0000000..b41726e
--- /dev/null
+++ b/samples/applications/nested-group/artifacts/autoscaling-policy.json
@@ -0,0 +1,14 @@
+{
+    "id": "autoscaling-policy-1",
+    "loadThresholds": {
+        "requestsInFlight": {
+            "threshold": 80
+        },
+        "memoryConsumption": {
+            "threshold": 90
+        },
+        "loadAverage": {
+            "threshold": 50
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d7655943/samples/applications/nested-group/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/nested-group/artifacts/deployment-policy.json b/samples/applications/nested-group/artifacts/deployment-policy.json
new file mode 100644
index 0000000..e0a0bd6
--- /dev/null
+++ b/samples/applications/nested-group/artifacts/deployment-policy.json
@@ -0,0 +1,25 @@
+{
+   "id": "deployment-policy-2",
+   "networkPartition": [
+       {
+           "id": "network-partition-1",
+           "partitionAlgo": "one-after-another",
+           "partitions": [
+               {
+                   "id": "partition-1",
+                   "max": 5
+               }
+           ]
+       },
+       {
+           "id": "network-partition-2",
+           "partitionAlgo": "one-after-another",
+           "partitions": [
+               {
+                   "id": "partition-1",
+                   "max": 5
+               }
+           ]
+       }
+   ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d7655943/samples/applications/nested-group/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/nested-group/scripts/common/deploy.sh b/samples/applications/nested-group/scripts/common/deploy.sh
index bb5102a..f74b241 100755
--- a/samples/applications/nested-group/scripts/common/deploy.sh
+++ b/samples/applications/nested-group/scripts/common/deploy.sh
@@ -11,6 +11,9 @@ artifacts_path=`cd "${script_path}/../../artifacts"; pwd`
 iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
 cartridges_path=`cd "${script_path}/../../../../cartridges/${iaas}"; pwd`
 cartridges_groups_path=`cd "${script_path}/../../../../cartridges-groups"; pwd`
+autoscaling_policies_path=`cd "${script_path}/../../../../autoscaling-policies"; pwd`
+network_partitions_path=`cd "${script_path}/../../../../network-partitions/${iaas}"; pwd`
+deployment_policies_path=`cd "${script_path}/../../../../deployment-policies"; pwd`
 
 set -e
 
@@ -19,9 +22,16 @@ if [[ -z "${iaas}" ]]; then
     exit
 fi
 
-echo ${artifacts_path}/autoscaling-policy.json
+echo ${autoscaling_policies_path}/autoscaling-policy-1.json
 echo "Adding autoscale policy..."
-curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/autoscaling-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+curl -X POST -H "Content-Type: application/json" -d "@${autoscaling_policies_path}/autoscaling-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies
+
+echo "Adding network partitions..."
+curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-1.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+curl -X POST -H "Content-Type: application/json" -d "@${network_partitions_path}/network-partition-2.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions
+
+echo "Adding deployment policies..."
+curl -X POST -H "Content-Type: application/json" -d "@${deployment_policies_path}/deployment-policy-2.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies
 
 echo "Adding tomcat cartridge..."
 curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/tomcat.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges
@@ -43,4 +53,4 @@ curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/applicat
 sleep 1
 
 echo "Deploying application..."
-curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/deployment-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/nested-group-app/deploy
\ No newline at end of file
+curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application-policy.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/nested-group-app/deploy
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/d7655943/samples/cartridges-groups/group6c.json
----------------------------------------------------------------------
diff --git a/samples/cartridges-groups/group6c.json b/samples/cartridges-groups/group6c.json
index 495b88b..4b24b02 100644
--- a/samples/cartridges-groups/group6c.json
+++ b/samples/cartridges-groups/group6c.json
@@ -2,13 +2,15 @@
     "name": "group6",
     "groups": [
         {
-            "name": "group6-1",
+            "name": "group7",
             "cartridges": [
-                "tomcat1",
-		"tomcat2"
+                "tomcat1"
             ]
         }
     ],
+    "cartridges": [
+        "tomcat2"
+    ],
     "dependencies": {
         "terminationBehaviour": "terminate-all"
     }