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

[1/2] stratos git commit: Fixing issues in the single-group-v2 sample application.

Repository: stratos
Updated Branches:
  refs/heads/master db5328597 -> f5272cc4c


Fixing issues in the  single-group-v2 sample application.


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

Branch: refs/heads/master
Commit: e47c48112f59d402a87d04183df92fd97ce2e35f
Parents: db53285
Author: Dinithi <di...@wso2.com>
Authored: Tue Mar 3 10:12:59 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Tue Mar 3 10:12:59 2015 +0530

----------------------------------------------------------------------
 .../artifacts/application-policy.json           |  8 +++
 .../single-group-v2/artifacts/application.json  | 14 ++--
 .../artifacts/ec2/deployment-policy.json        | 70 -------------------
 .../artifacts/kubernetes/deployment-policy.json | 71 --------------------
 .../kubernetes/kubernetes-cluster.json          | 56 ---------------
 .../artifacts/mock/deployment-policy.json       | 56 ---------------
 .../artifacts/openstack/deployment-policy.json  | 70 -------------------
 .../single-group-v2/scripts/common/deploy.sh    | 17 +++--
 .../single-group-v2/scripts/common/undeploy.sh  |  1 -
 samples/cartridges-groups/group6c.json          |  9 +--
 10 files changed, 30 insertions(+), 342 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/e47c4811/samples/applications/single-group-v2/artifacts/application-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v2/artifacts/application-policy.json b/samples/applications/single-group-v2/artifacts/application-policy.json
new file mode 100644
index 0000000..2c73f9a
--- /dev/null
+++ b/samples/applications/single-group-v2/artifacts/application-policy.json
@@ -0,0 +1,8 @@
+{
+   "networkPartition":[
+      {
+         "id":"network-partition-3",
+         "activeByDefault":"true"
+      }
+   ]
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/e47c4811/samples/applications/single-group-v2/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v2/artifacts/application.json b/samples/applications/single-group-v2/artifacts/application.json
index 758b6f4..c738a7f 100644
--- a/samples/applications/single-group-v2/artifacts/application.json
+++ b/samples/applications/single-group-v2/artifacts/application.json
@@ -1,20 +1,21 @@
 {
     "applicationId": "single_group_v2",
-    "alias": "single_group_v2",
+    "alias": "my-single_group_v2",
     "components": {
         "groups": [
             {
                 "name": "group6",
-                "alias": "mygroup6",
+                "alias": "my-group6",
                 "groupMinInstances": 1,
                 "groupMaxInstances": 1,
+                "deploymentPolicy":"deployment-policy-3",
                 "cartridges": [
                     {
                         "type": "tomcat2",
                         "cartridgeMin": 1,
                         "cartridgeMax": 2,
                         "subscribableInfo": {
-                            "alias": "tom2group6",
+                            "alias": "my-tomcat2",
                             "autoscalingPolicy": "autoscaling-policy-1",
                             "artifactRepository":{
                                "privateRepo":false,
@@ -29,7 +30,7 @@
                         "cartridgeMin": 1,
                         "cartridgeMax": 2,
                         "subscribableInfo": {
-                            "alias": "tom1group6",
+                            "alias": "my-tomcat1",
                             "autoscalingPolicy": "autoscaling-policy-1",
                             "artifactRepository":{
                                "privateRepo":false,
@@ -48,8 +49,9 @@
                 "cartridgeMin": 1,
                 "cartridgeMax": 2,
                 "subscribableInfo": {
-                    "alias": "mytomcat",
+                    "alias": "my-tomcat",
                     "autoscalingPolicy": "autoscaling-policy-1",
+                    "deploymentPolicy":"deployment-policy-3",
                     "artifactRepository":{
                        "privateRepo":false,
                        "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git",
@@ -61,7 +63,7 @@
         ],
         "dependencies": {
             "startupOrders": [
-                "group.group6,cartridge.tomcat"
+                "group.my-group6,cartridge.my-tomcat"
             ],
             "terminationBehaviour": "terminate-none"
         }

http://git-wip-us.apache.org/repos/asf/stratos/blob/e47c4811/samples/applications/single-group-v2/artifacts/ec2/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v2/artifacts/ec2/deployment-policy.json b/samples/applications/single-group-v2/artifacts/ec2/deployment-policy.json
deleted file mode 100644
index 94ce8cb..0000000
--- a/samples/applications/single-group-v2/artifacts/ec2/deployment-policy.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "ec2",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "ap-southeast-1"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mytomcat",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup6",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup8",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/e47c4811/samples/applications/single-group-v2/artifacts/kubernetes/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v2/artifacts/kubernetes/deployment-policy.json b/samples/applications/single-group-v2/artifacts/kubernetes/deployment-policy.json
deleted file mode 100644
index 3a6c693..0000000
--- a/samples/applications/single-group-v2/artifacts/kubernetes/deployment-policy.json
+++ /dev/null
@@ -1,71 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id":"network-partition-1",
-                "kubernetesClusterId":"kubernetes-cluster-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "mock",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "default"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mytomcat",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup6",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup8",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/e47c4811/samples/applications/single-group-v2/artifacts/kubernetes/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v2/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/single-group-v2/artifacts/kubernetes/kubernetes-cluster.json
deleted file mode 100644
index 2988ed1..0000000
--- a/samples/applications/single-group-v2/artifacts/kubernetes/kubernetes-cluster.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "clusterId": "kubernetes-cluster-1",
-    "description": "Kubernetes CoreOS cluster",
-    "kubernetesMaster": {
-        "hostId": "KubHostMaster1",
-        "hostname": "master.dev.kubernetes.example.org",
-        "privateIPAddress": "172.17.8.100",
-        "publicIPAddress": "172.17.8.100",
-        "property": [
-        ]
-    },
-    "portRange": {
-        "upper": "5000",
-        "lower": "4500"
-    },
-    "kubernetesHosts": [
-        {
-            "hostId": "KubHostSlave1",
-            "hostname": "slave1.dev.kubernetes.example.org",
-            "privateIPAddress": "172.17.8.101",
-            "publicIPAddress": "172.17.8.101",
-            "property": [
-            ]
-        },
-        {
-            "hostId": "KubHostSlave2",
-            "hostname": "slave2.dev.kubernetes.example.org",
-            "privateIPAddress": "172.17.8.102",
-            "publicIPAddress": "172.17.8.102",
-            "property": [
-            ]
-        }
-    ],
-    "property": [
-        {
-            "name": "payload_parameter.MB_IP",
-            "value": "172.17.8.1"
-        },
-        {
-            "name": "payload_parameter.MB_PORT",
-            "value": "1883"
-        },
-        {
-            "name": "payload_parameter.CEP_IP",
-            "value": "172.17.8.1"
-        },
-        {
-            "name": "payload_parameter.CEP_PORT",
-            "value": "7711"
-        },
-        {
-            "name": "payload_parameter.LOG_LEVEL",
-            "value": "DEBUG"
-        }
-    ]
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/e47c4811/samples/applications/single-group-v2/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v2/artifacts/mock/deployment-policy.json b/samples/applications/single-group-v2/artifacts/mock/deployment-policy.json
deleted file mode 100644
index 419fe2e..0000000
--- a/samples/applications/single-group-v2/artifacts/mock/deployment-policy.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "applicationId": "single_group_v2",
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "mock",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mytomcat",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup6",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/e47c4811/samples/applications/single-group-v2/artifacts/openstack/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v2/artifacts/openstack/deployment-policy.json b/samples/applications/single-group-v2/artifacts/openstack/deployment-policy.json
deleted file mode 100644
index 66a28a0..0000000
--- a/samples/applications/single-group-v2/artifacts/openstack/deployment-policy.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
-    "applicationPolicy": {
-        "networkPartition": [
-            {
-                "id": "network-partition-1",
-                "activeByDefault": "true",
-                "partitions": [
-                    {
-                        "id": "partition-1",
-                        "provider": "openstack",
-                        "property": [
-                            {
-                                "name": "region",
-                                "value": "RegionOne"
-                            }
-                        ]
-                    }
-                ]
-            }
-        ]
-    },
-    "childPolicies": [
-        {
-            "alias": "mytomcat",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup6",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        },
-        {
-            "alias": "mygroup8",
-            "networkPartition": [
-                {
-                    "id": "network-partition-1",
-                    "partitionAlgo": "one-after-another",
-                    "partitions": [
-                        {
-                            "id": "partition-1",
-                            "max": 5
-                        }
-                    ]
-                }
-            ]
-        }
-    ]
-}
-

http://git-wip-us.apache.org/repos/asf/stratos/blob/e47c4811/samples/applications/single-group-v2/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v2/scripts/common/deploy.sh b/samples/applications/single-group-v2/scripts/common/deploy.sh
index 98da9b4..7504859 100755
--- a/samples/applications/single-group-v2/scripts/common/deploy.sh
+++ b/samples/applications/single-group-v2/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,15 @@ 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-3.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-3.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
@@ -40,7 +49,5 @@ sleep 1
 echo "Creating application..."
 curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/application.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications
 
-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/single_group_v2/deploy
+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/single_group_v2/deploy
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/e47c4811/samples/applications/single-group-v2/scripts/common/undeploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-v2/scripts/common/undeploy.sh b/samples/applications/single-group-v2/scripts/common/undeploy.sh
index 5a28ce1..032d05e 100644
--- a/samples/applications/single-group-v2/scripts/common/undeploy.sh
+++ b/samples/applications/single-group-v2/scripts/common/undeploy.sh
@@ -14,7 +14,6 @@ echo "Deleting application..."
 curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single_group_v2
 
 echo "Removing groups..."
-curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/group8
 curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups/group6
 
 echo "Removing cartridges..."

http://git-wip-us.apache.org/repos/asf/stratos/blob/e47c4811/samples/cartridges-groups/group6c.json
----------------------------------------------------------------------
diff --git a/samples/cartridges-groups/group6c.json b/samples/cartridges-groups/group6c.json
index e7feca5..495b88b 100644
--- a/samples/cartridges-groups/group6c.json
+++ b/samples/cartridges-groups/group6c.json
@@ -4,17 +4,12 @@
         {
             "name": "group6-1",
             "cartridges": [
-                "tomcat1"
+                "tomcat1",
+		"tomcat2"
             ]
         }
     ],
-    "cartridges": [
-        "tomcat2"
-    ],
     "dependencies": {
-        "startupOrders": [
-            "group.tom1group6,cartridge.tom2group6"
-        ],
         "terminationBehaviour": "terminate-all"
     }
 }


[2/2] stratos git commit: This closes #250 on GitHub

Posted by im...@apache.org.
This closes #250 on GitHub


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

Branch: refs/heads/master
Commit: f5272cc4c926b711ee48ab0bf9157e6cf294a9e6
Parents: e47c481
Author: Imesh Gunaratne <im...@apache.org>
Authored: Tue Mar 3 10:27:13 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Tue Mar 3 10:27:13 2015 +0530

----------------------------------------------------------------------

----------------------------------------------------------------------