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/04 15:49:40 UTC
[3/5] stratos git commit: Fixed single-group-group-scaling-v1 sample
application.
Fixed single-group-group-scaling-v1 sample application.
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/6470b00a
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/6470b00a
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/6470b00a
Branch: refs/heads/master
Commit: 6470b00a46653e6c4a996671fc2118674348984e
Parents: 64bd01d
Author: Dinithi <di...@wso2.com>
Authored: Wed Mar 4 15:45:41 2015 +0530
Committer: Dinithi <di...@wso2.com>
Committed: Wed Mar 4 15:45:41 2015 +0530
----------------------------------------------------------------------
.../artifacts/application-policy.json | 8 +++
.../artifacts/application.json | 7 +--
.../artifacts/deployment-policy.json | 2 +-
.../artifacts/ec2/deployment-policy.json | 41 --------------
.../artifacts/kubernetes/deployment-policy.json | 42 ---------------
.../kubernetes/kubernetes-cluster.json | 56 --------------------
.../artifacts/mock/deployment-policy.json | 41 --------------
.../artifacts/openstack/deployment-policy.json | 41 --------------
.../scripts/common/deploy.sh | 15 ++++--
9 files changed, 25 insertions(+), 228 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/6470b00a/samples/applications/single-group-group-scaling/artifacts/application-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/application-policy.json b/samples/applications/single-group-group-scaling/artifacts/application-policy.json
new file mode 100644
index 0000000..9d2c6a1
--- /dev/null
+++ b/samples/applications/single-group-group-scaling/artifacts/application-policy.json
@@ -0,0 +1,8 @@
+{
+ "networkPartition":[
+ {
+ "id":"network-partition-1",
+ "activeByDefault":"true"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/stratos/blob/6470b00a/samples/applications/single-group-group-scaling/artifacts/application.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/application.json b/samples/applications/single-group-group-scaling/artifacts/application.json
index 2b4142c..08c7ede 100644
--- a/samples/applications/single-group-group-scaling/artifacts/application.json
+++ b/samples/applications/single-group-group-scaling/artifacts/application.json
@@ -1,20 +1,21 @@
{
"applicationId": "single-group-group-scaling",
- "alias": "single-group-group-scaling-v1",
+ "alias": "my-single-group-group-scaling",
"components": {
"groups": [
{
"name": "group6",
- "alias": "mygroup6",
+ "alias": "my-group6",
"groupMinInstances": 1,
"groupMaxInstances": 3,
+ "deploymentPolicy":"deployment-policy-1",
"cartridges": [
{
"type": "tomcat",
"cartridgeMin": 1,
"cartridgeMax": 4,
"subscribableInfo": {
- "alias": "tom1group6",
+ "alias": "my-tomcat",
"autoscalingPolicy": "autoscaling-policy-1",
"artifactRepository":{
"privateRepo":false,
http://git-wip-us.apache.org/repos/asf/stratos/blob/6470b00a/samples/applications/single-group-group-scaling/artifacts/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/deployment-policy.json b/samples/applications/single-group-group-scaling/artifacts/deployment-policy.json
index d858aed..666c299 100644
--- a/samples/applications/single-group-group-scaling/artifacts/deployment-policy.json
+++ b/samples/applications/single-group-group-scaling/artifacts/deployment-policy.json
@@ -1,5 +1,5 @@
{
- "id": "deployment-policy-2",
+ "id": "deployment-policy-1",
"networkPartition": [
{
"id": "network-partition-1",
http://git-wip-us.apache.org/repos/asf/stratos/blob/6470b00a/samples/applications/single-group-group-scaling/artifacts/ec2/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/ec2/deployment-policy.json b/samples/applications/single-group-group-scaling/artifacts/ec2/deployment-policy.json
deleted file mode 100644
index d99cd34..0000000
--- a/samples/applications/single-group-group-scaling/artifacts/ec2/deployment-policy.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "applicationId": "single-group-group-scaling",
- "applicationPolicy": {
- "networkPartition": [
- {
- "id": "network-partition-1",
- "activeByDefault": "true",
- "partitions": [
- {
- "id": "partition-1",
- "provider": "ec2",
- "property": [
- {
- "name": "region",
- "value": "ap-southeast-1"
- }
- ]
- }
- ]
- }
- ]
- },
- "childPolicies": [
- {
- "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/6470b00a/samples/applications/single-group-group-scaling/artifacts/kubernetes/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/kubernetes/deployment-policy.json b/samples/applications/single-group-group-scaling/artifacts/kubernetes/deployment-policy.json
deleted file mode 100644
index c347514..0000000
--- a/samples/applications/single-group-group-scaling/artifacts/kubernetes/deployment-policy.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "applicationId": "single-group-group-scaling",
- "applicationPolicy": {
- "networkPartition": [
- {
- "id":"network-partition-1",
- "kubernetesClusterId":"kubernetes-cluster-1",
- "activeByDefault": "true",
- "partitions": [
- {
- "id": "partition-1",
- "provider": "kubernetes",
- "property": [
- {
- "name": "region",
- "value": "default"
- }
- ]
- }
- ]
- }
- ]
- },
- "childPolicies": [
- {
- "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/6470b00a/samples/applications/single-group-group-scaling/artifacts/kubernetes/kubernetes-cluster.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/kubernetes/kubernetes-cluster.json b/samples/applications/single-group-group-scaling/artifacts/kubernetes/kubernetes-cluster.json
deleted file mode 100644
index 2988ed1..0000000
--- a/samples/applications/single-group-group-scaling/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/6470b00a/samples/applications/single-group-group-scaling/artifacts/mock/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/mock/deployment-policy.json b/samples/applications/single-group-group-scaling/artifacts/mock/deployment-policy.json
deleted file mode 100644
index 382e0ad..0000000
--- a/samples/applications/single-group-group-scaling/artifacts/mock/deployment-policy.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "applicationId": "single-group-group-scaling",
- "applicationPolicy": {
- "networkPartition": [
- {
- "id": "network-partition-1",
- "activeByDefault": "true",
- "partitions": [
- {
- "id": "partition-1",
- "provider": "mock",
- "property": [
- {
- "name": "region",
- "value": "RegionOne"
- }
- ]
- }
- ]
- }
- ]
- },
- "childPolicies": [
- {
- "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/6470b00a/samples/applications/single-group-group-scaling/artifacts/openstack/deployment-policy.json
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/artifacts/openstack/deployment-policy.json b/samples/applications/single-group-group-scaling/artifacts/openstack/deployment-policy.json
deleted file mode 100644
index 79771b3..0000000
--- a/samples/applications/single-group-group-scaling/artifacts/openstack/deployment-policy.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "applicationId": "single-group-group-scaling",
- "applicationPolicy": {
- "networkPartition": [
- {
- "id": "network-partition-1",
- "activeByDefault": "true",
- "partitions": [
- {
- "id": "partition-1",
- "provider": "openstack",
- "property": [
- {
- "name": "region",
- "value": "RegionOne"
- }
- ]
- }
- ]
- }
- ]
- },
- "childPolicies": [
- {
- "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/6470b00a/samples/applications/single-group-group-scaling/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-group-group-scaling/scripts/common/deploy.sh b/samples/applications/single-group-group-scaling/scripts/common/deploy.sh
index 0e35412..4fcd9b7 100755
--- a/samples/applications/single-group-group-scaling/scripts/common/deploy.sh
+++ b/samples/applications/single-group-group-scaling/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-1.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-1.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
@@ -37,4 +46,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/single-group-group-scaling/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/single-group-group-scaling/deploy
\ No newline at end of file