Repository: stratos Updated Branches: refs/heads/master 48b99b852 -> 327e1c37c
adding sample with dbgroup, appgroup and esb to simulate startup dependents Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/9a4251c2 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/9a4251c2 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/9a4251c2 Branch: refs/heads/master Commit: 9a4251c2ae041ed308fb23364ddd7e10d755be69 Parents: 8ee0c53 Author: reka <[email protected]> Authored: Wed Apr 29 14:58:26 2015 +0530 Committer: reka <[email protected]> Committed: Wed Apr 29 16:14:02 2015 +0530 ---------------------------------------------------------------------- .../README.md | 10 ++ .../artifacts/application-signup.json | 18 +++ .../artifacts/application.json | 121 +++++++++++++++++++ .../artifacts/domain-mappings.json | 9 ++ .../scripts/common/add-domain-mappings.sh | 9 ++ .../scripts/common/add-network-partition.sh | 9 ++ .../scripts/common/deploy.sh | 65 ++++++++++ .../scripts/common/get-application-runtime.sh | 10 ++ .../scripts/common/list-domain-mappings.sh | 4 + .../scripts/common/list-network-partition.sh | 4 + .../scripts/common/undeploy.sh | 31 +++++ .../scripts/common/update-deployment-policy.sh | 12 ++ .../scripts/ec2/deploy.sh | 9 ++ .../scripts/ec2/undeploy.sh | 7 ++ .../scripts/kubernetes/deploy.sh | 16 +++ .../scripts/kubernetes/undeploy.sh | 13 ++ .../scripts/mock/deploy.sh | 9 ++ .../scripts/mock/undeploy.sh | 7 ++ .../scripts/openstack/deploy.sh | 9 ++ .../scripts/openstack/undeploy.sh | 7 ++ .../artifacts/application-up.json | 38 ++++++ samples/cartridges-groups/app-group.json | 15 +++ samples/cartridges-groups/db-group.json | 14 +++ samples/cartridges/mock/esb.json | 13 +- samples/cartridges/mock/postgres | 47 +++++++ samples/cartridges/mock/postgres.json | 47 +++++++ 26 files changed, 547 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/README.md ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/README.md b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/README.md new file mode 100644 index 0000000..6cb7cdc --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/README.md @@ -0,0 +1,10 @@ +single_cartridge +================ +i) In this artifact sample you can find we have listed them as mock and openstack. + +ii) In this sample artifact, it deployes simple application with a php cartridge and start it. + +iii) You can choose the IaaS and navigate to it and simply run the single_cartridge.sh file. It'll deploy the relevant artifacts and start the application. + + +This sample can be used to test the startup order pattern. As defined, the application is using dbgroup(mysql, postgres), app-group(tomcat, php) and esb. In this case, appgroup and esb are depending on dbgroup. So, dbgroup should start first. Other two can come up in parallel after dbgroup started. When starting of appgroup, tomcat depends on php. In that case, tomcat will have to come up first and then php. By running this sample, this particular scenario can be simulated. http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/artifacts/application-signup.json ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/artifacts/application-signup.json b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/artifacts/application-signup.json new file mode 100644 index 0000000..138648e --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/artifacts/application-signup.json @@ -0,0 +1,18 @@ +{ + "artifactRepositories":[ + { + "alias":"php", + "privateRepo":false, + "repoUrl":"https://github.com/imesh/stratos-php-applications.git", + "repoUsername":"", + "repoPassword":"" + }, + { + "alias":"tomcat", + "privateRepo":false, + "repoUrl":"https://github.com/imesh/stratos-tomcat-applications.git", + "repoUsername":"", + "repoPassword":"" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/artifacts/application.json ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/artifacts/application.json b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/artifacts/application.json new file mode 100644 index 0000000..10f8c83 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/artifacts/application.json @@ -0,0 +1,121 @@ +{ + "alias": "mycompositeapp", + "applicationId": "my-compositeapp", + "components": { + "groups": [ + { + "name": "app-group", + "alias": "my-appgroup", + "cartridges": [ + { + "type": "tomcat", + "cartridgeMax": 2, + "cartridgeMin": 1, + "subscribableInfo": { + "alias": "my-tomcat", + "artifactRepository": { + "alias": "my-tomcat", + "privateRepo": true, + "repoPassword": "password", + "repoUrl": "http://xxx:10080/git/default.git", + "repoUsername": "user" + }, + "autoscalingPolicy": "autoscaling-policy-1", + "deploymentPolicy": "deployment-policy-2" + } + }, + { + "type": "php", + "cartridgeMax": 2, + "cartridgeMin": 1, + "subscribableInfo": { + "alias": "my-php", + "artifactRepository": { + + "privateRepo": true, + "repoPassword": "password", + "repoUrl": "http://xxx:10080/git/default.git", + "repoUsername": "user" + }, + "autoscalingPolicy": "autoscaling-policy-1", + "deploymentPolicy": "deployment-policy-2" + } + } + ], + "groupMaxInstances": 2, + "groupMinInstances": 1, + "groupScalingEnabled": true + }, + { + "name": "db-group", + "alias": "my-dbgroup", + "cartridges": [ + { + "type": "postgres", + "cartridgeMax": 2, + "cartridgeMin": 1, + "subscribableInfo": { + "alias": "my-postgres", + "artifactRepository": { + "alias": "my-postgres", + "privateRepo": false, + "repoPassword": "password", + "repoUrl": "http://xxx:10080/git/default.git", + "repoUsername": "user" + }, + "autoscalingPolicy": "autoscaling-policy-1", + "deploymentPolicy": "deployment-policy-2" + } + }, + { + "type": "mysql", + "cartridgeMax": 2, + "cartridgeMin": 1, + "subscribableInfo": { + "alias": "my-mysql", + "artifactRepository": { + "alias": "my-mysql", + "privateRepo": true, + "repoPassword": "password", + "repoUrl": "http://xxx:10080/git/default.git", + "repoUsername": "user" + }, + "autoscalingPolicy": "autoscaling-policy-1", + "deploymentPolicy": "deployment-policy-2" + } + } + ], + "groupMaxInstances": 2, + "groupMinInstances": 1, + "groupScalingEnabled": true + } + ], + "cartridges": [ + { + "type": "esb", + "cartridgeMax": 2, + "cartridgeMin": 1, + "subscribableInfo": { + "alias": "my-esb", + "artifactRepository": { + "privateRepo": true, + "repoPassword": "password", + "repoUrl": "http://xxx:10080/git/default.git", + "repoUsername": "user" + }, + "autoscalingPolicy": "autoscaling-policy-1", + "deploymentPolicy": "deployment-policy-2" + } + } + ], + "dependencies": { + "scalingDependants": { + "@xsi.nil": "true" + }, + "startupOrders": [ + "group.my-dbgroup,group.my-appgroup","group.my-dbgroup,cartridge.my-esb" + ], + "terminationBehaviour": "terminate-none" + } + } + } http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/artifacts/domain-mappings.json ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/artifacts/domain-mappings.json b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/artifacts/domain-mappings.json new file mode 100644 index 0000000..78e6008 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/artifacts/domain-mappings.json @@ -0,0 +1,9 @@ +{ + "domainMappings": [ + { + "cartridgeAlias":"my-php", + "domainName":"abc.com", + "contextPath":"/abc/app" + } + ] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-domain-mappings.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-domain-mappings.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-domain-mappings.sh new file mode 100755 index 0000000..74c6ed7 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-domain-mappings.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +export host_ip="localhost" +export artifacts_path="../../artifacts" + +pushd ${artifacts_path} +echo "Adding domain mappings..." +curl -X POST -H "Content-Type: application/json" -d @'domain-mappings.json' -k -u admin:admin https://${host_ip}:9443/api/applications/single-cartridge-app/domainMappings +popd \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-network-partition.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-network-partition.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-network-partition.sh new file mode 100644 index 0000000..56c7c6c --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/add-network-partition.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +export host_ip="localhost" +export artifacts_path="../../artifacts" + +pushd ${artifacts_path} +echo "Adding network partition..." +curl -X POST -H "Content-Type: application/json" -d "@${artifacts_path}/network-partition.json" -k -v -u admin:admin https://${host_ip}:9443/api/networkPartitions +popd http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/deploy.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/deploy.sh new file mode 100755 index 0000000..07d84e8 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/deploy.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +iaas=$1 +host_ip="localhost" +host_port=9443 + +prgdir=`dirname "$0"` +script_path=`cd "$prgdir"; pwd` + +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` +application_policies_path=`cd "${script_path}/../../../../application-policies"; pwd` + +set -e + +if [[ -z "${iaas}" ]]; then + echo "Usage: deploy.sh [iaas]" + exit +fi + +echo ${autoscaling_policies_path}/autoscaling-policy-1.json +echo "Adding autoscale policy..." +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}:${host_port}/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}:${host_port}/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 +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 mysql cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/mysql.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/postgres.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/esb.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges +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 + +echo "Adding php cartridge..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_path}/php.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges + +echo "Adding mysql-php-group group..." +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/app-group.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups +curl -X POST -H "Content-Type: application/json" -d "@${cartridges_groups_path}/db-group.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridgeGroups + +sleep 1 + +echo "Adding application policy..." +curl -X POST -H "Content-Type: application/json" -d "@${application_policies_path}/application-policy-1.json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies + +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" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/my-compositeapp/deploy/application-policy-1 + http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/get-application-runtime.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/get-application-runtime.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/get-application-runtime.sh new file mode 100755 index 0000000..ed80688 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/get-application-runtime.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +iaas=$1 +host_ip="localhost" +host_port=9443 + +set -e + +echo "Getting application runtime..." +curl -X GET -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single-cartridge-app/runtime http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-domain-mappings.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-domain-mappings.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-domain-mappings.sh new file mode 100755 index 0000000..0b49f6f --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-domain-mappings.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "Listing domain mappings..." +curl -X GET -H "Content-Type: application/json" -k -u admin:admin https://localhost:9443/api/applications/single-cartridge-app/domainMappings \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-network-partition.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-network-partition.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-network-partition.sh new file mode 100755 index 0000000..6e3812d --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/list-network-partition.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "Listing network partitions..." +curl -X GET -H "Content-Type: application/json" -k -u admin:admin https://localhost:9443/api/networkPartitions \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/undeploy.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/undeploy.sh new file mode 100644 index 0000000..b0174b8 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/undeploy.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +host_ip="localhost" +host_port=9443 + +set -e + +echo "Undeploying application..." +curl -X POST -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single-cartridge-app/undeploy + +sleep 10 + +echo "Deleting application..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applications/single-cartridge-app + +echo "Removing cartridges..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/cartridges/php + +echo "Removing autoscale policies..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/autoscalingPolicies/autoscaling-policy-1 + +echo "Removing deployment policies..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/deploymentPolicies/deployment-policy-1 + +echo "Removing network partitions..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-1 +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/networkPartitions/network-partition-2 + +echo "Removing application policies..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/applicationPolicies/application-policy-1 + http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/update-deployment-policy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/update-deployment-policy.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/update-deployment-policy.sh new file mode 100755 index 0000000..f0bd8fb --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/common/update-deployment-policy.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +iaas=$1 +host_ip="localhost" +host_port=9443 + +script_path=`cd "$prgdir"; pwd` + +deployment_policies_path=`cd "${script_path}/../../../../deployment-policies"; pwd` + +curl -X PUT -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 + http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/ec2/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/ec2/deploy.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/ec2/deploy.sh new file mode 100755 index 0000000..1370667 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/ec2/deploy.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +iaas="ec2" + +prgdir=`dirname "$0"` +script_path=`cd "$prgdir"; pwd` +common_folder=`cd "${script_path}/../common"; pwd` + +bash ${common_folder}/deploy.sh ${iaas} http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/ec2/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/ec2/undeploy.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/ec2/undeploy.sh new file mode 100644 index 0000000..17d8c71 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/ec2/undeploy.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +prgdir=`dirname "$0"` +script_path=`cd "$prgdir"; pwd` +common_folder=`cd "${script_path}/../common"; pwd` + +bash ${common_folder}/undeploy.sh http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/kubernetes/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/kubernetes/deploy.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/kubernetes/deploy.sh new file mode 100755 index 0000000..d6c47c1 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/kubernetes/deploy.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +host_ip="localhost" +host_port=9443 +iaas="kubernetes" + +prgdir=`dirname "$0"` +script_path=`cd "$prgdir"; pwd` +common_folder=`cd "${script_path}/../common"; pwd` +kubernetes_clusters_path=`cd "${script_path}/../../../../kubernetes-clusters"; pwd` + + +echo "Adding kubernetes cluster..." +curl -X POST -H "Content-Type: application/json" -d "@${kubernetes_clusters_path}/kubernetes-cluster-1.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters + +bash ${common_folder}/deploy.sh ${iaas} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/kubernetes/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/kubernetes/undeploy.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/kubernetes/undeploy.sh new file mode 100755 index 0000000..0054670 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/kubernetes/undeploy.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +host_ip="localhost" +host_port=9443 + +prgdir=`dirname "$0"` +script_path=`cd "$prgdir"; pwd` +common_folder=`cd "${script_path}/../common"; pwd` + +bash ${common_folder}/undeploy.sh + +echo "Removing kubernetes cluster..." +curl -X DELETE -H "Content-Type: application/json" -k -v -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters/kubernetes-cluster-1 http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/deploy.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/deploy.sh new file mode 100755 index 0000000..93f8517 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/deploy.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +iaas="mock" + +prgdir=`dirname "$0"` +script_path=`cd "$prgdir"; pwd` +common_folder=`cd "${script_path}/../common"; pwd` + +bash ${common_folder}/deploy.sh ${iaas} http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/undeploy.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/undeploy.sh new file mode 100755 index 0000000..17d8c71 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/mock/undeploy.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +prgdir=`dirname "$0"` +script_path=`cd "$prgdir"; pwd` +common_folder=`cd "${script_path}/../common"; pwd` + +bash ${common_folder}/undeploy.sh http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/openstack/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/openstack/deploy.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/openstack/deploy.sh new file mode 100755 index 0000000..4c39959 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/openstack/deploy.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +iaas="openstack" + +prgdir=`dirname "$0"` +script_path=`cd "$prgdir"; pwd` +common_folder=`cd "${script_path}/../common"; pwd` + +bash ${common_folder}/deploy.sh ${iaas} http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/openstack/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/openstack/undeploy.sh b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/openstack/undeploy.sh new file mode 100644 index 0000000..17d8c71 --- /dev/null +++ b/samples/applications/php-tomcat-group-postgres-mysql-group-esb/scripts/openstack/undeploy.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +prgdir=`dirname "$0"` +script_path=`cd "$prgdir"; pwd` +common_folder=`cd "${script_path}/../common"; pwd` + +bash ${common_folder}/undeploy.sh http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/applications/single-group-v1/artifacts/application-up.json ---------------------------------------------------------------------- diff --git a/samples/applications/single-group-v1/artifacts/application-up.json b/samples/applications/single-group-v1/artifacts/application-up.json new file mode 100644 index 0000000..d4a4a54 --- /dev/null +++ b/samples/applications/single-group-v1/artifacts/application-up.json @@ -0,0 +1,38 @@ +{ + "applicationId": "single-group-v1", + "alias": "my-single-group-v1", + "components": { + "groups": [ + { + "name": "group6", + "alias": "my-group6", + "groupMinInstances": 1, + "groupMaxInstances": 6, + "deploymentPolicy":"deployment-policy-1", + "cartridges": [ + { + "type": "tomcat1", + "cartridgeMin": 2, + "cartridgeMax": 10, + "subscribableInfo": { + "alias": "my-tomcat1", + "autoscalingPolicy": "autoscaling-policy-1", + "artifactRepository":{ + "privateRepo":false, + "repoUrl":"https://github.com/imesh/stratos-tomcat2-applications.git", + "repoUsername":"", + "repoPassword":"" + } + } + } + ] + } + ], + "cartridges": [ + ], + "dependencies": { + "terminationBehaviour": "terminate-none" + } + } +} + http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/cartridges-groups/app-group.json ---------------------------------------------------------------------- diff --git a/samples/cartridges-groups/app-group.json b/samples/cartridges-groups/app-group.json new file mode 100644 index 0000000..91332c0 --- /dev/null +++ b/samples/cartridges-groups/app-group.json @@ -0,0 +1,15 @@ +{ + "name": "app-group", + "cartridges": [ + "tomcat", + "php" + ], + "dependencies": { + "terminationBehaviour": "terminate-all", + "startupOrders": [ + "cartridge.my-php,cartridge.my-tomcat" + ] + }, + "groupScalingEnabled": true +} + http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/cartridges-groups/db-group.json ---------------------------------------------------------------------- diff --git a/samples/cartridges-groups/db-group.json b/samples/cartridges-groups/db-group.json new file mode 100644 index 0000000..e07f40a --- /dev/null +++ b/samples/cartridges-groups/db-group.json @@ -0,0 +1,14 @@ +{ + "name": "db-group", + "cartridges": [ + "mysql", + "postgres" + ], + "dependencies": { + "terminationBehaviour": "terminate-all" + ] + }, + "groupScalingEnabled": true + } + + http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/cartridges/mock/esb.json ---------------------------------------------------------------------- diff --git a/samples/cartridges/mock/esb.json b/samples/cartridges/mock/esb.json index db6fe5b..54a7152 100755 --- a/samples/cartridges/mock/esb.json +++ b/samples/cartridges/mock/esb.json @@ -1,10 +1,10 @@ { "type": "esb", - "provider": "wso2", + "provider": "apache", + "host": "stratos.apache.org", "category": "data", - "host": "esb.stratos.org", - "displayName": "esb", - "description": "esb Cartridge", + "displayName": "c4", + "description": "mysql Cartridge", "version": "7", "multiTenant": "false", "portMapping": [ @@ -34,7 +34,7 @@ }, { "name": "keyPair", - "value": "reka" + "value": "vishanth-key" }, { "name": "securityGroups", @@ -42,5 +42,6 @@ } ] } - ] + ], + "metadataKeys":["server_ip","username","password"] } http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/cartridges/mock/postgres ---------------------------------------------------------------------- diff --git a/samples/cartridges/mock/postgres b/samples/cartridges/mock/postgres new file mode 100755 index 0000000..2afdf3c --- /dev/null +++ b/samples/cartridges/mock/postgres @@ -0,0 +1,47 @@ +{ + "type": "mysql", + "provider": "apache", + "host": "stratos.apache.org", + "category": "data", + "displayName": "c4", + "description": "mysql Cartridge", + "version": "7", + "multiTenant": "false", + "portMapping": [ + { + "protocol": "http", + "port": "22", + "proxyPort": "8280" + } + ], + "deployment": { + }, + "iaasProvider": [ + { + "type": "mock", + "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e", + "networkInterfaces": [ + { + "name": "network-non-routable", + "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e" + } + ], + + "property": [ + { + "name": "instanceType", + "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594" + }, + { + "name": "keyPair", + "value": "vishanth-key" + }, + { + "name": "securityGroups", + "value": "default" + } + ] + } + ], + "metadataKeys":["server_ip","username","password"] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/9a4251c2/samples/cartridges/mock/postgres.json ---------------------------------------------------------------------- diff --git a/samples/cartridges/mock/postgres.json b/samples/cartridges/mock/postgres.json new file mode 100755 index 0000000..788fbce --- /dev/null +++ b/samples/cartridges/mock/postgres.json @@ -0,0 +1,47 @@ +{ + "type": "postgres", + "provider": "apache", + "host": "stratos.apache.org", + "category": "data", + "displayName": "c4", + "description": "mysql Cartridge", + "version": "7", + "multiTenant": "false", + "portMapping": [ + { + "protocol": "http", + "port": "22", + "proxyPort": "8280" + } + ], + "deployment": { + }, + "iaasProvider": [ + { + "type": "mock", + "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e", + "networkInterfaces": [ + { + "name": "network-non-routable", + "networkUuid": "b55f009a-1cc6-4b17-924f-4ae0ee18db5e" + } + ], + + "property": [ + { + "name": "instanceType", + "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594" + }, + { + "name": "keyPair", + "value": "vishanth-key" + }, + { + "name": "securityGroups", + "value": "default" + } + ] + } + ], + "metadataKeys":["server_ip","username","password"] +}
