Repository: stratos Updated Branches: refs/heads/master bcb386975 -> 9cb1b34a2
Adding multi cloud php cartrdige sample Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/9cb1b34a Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/9cb1b34a Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/9cb1b34a Branch: refs/heads/master Commit: 9cb1b34a2f476b23a52ed7a7c40005b75b45a143 Parents: bcb3869 Author: Lahiru Sandaruwan <[email protected]> Authored: Wed Jun 10 15:10:11 2015 +0530 Committer: Lahiru Sandaruwan <[email protected]> Committed: Wed Jun 10 15:10:11 2015 +0530 ---------------------------------------------------------------------- .../multi-cloud-application-policy.json | 10 +++ .../single-cartridge-app-multi-cloud/README.md | 25 +++++++ .../artifacts/application.json | 25 +++++++ .../scripts/multi/deploy.sh | 29 ++++++++ .../scripts/multi/undeploy.sh | 27 +++++++ samples/cartridges/multi/php.json | 75 ++++++++++++++++++++ .../multi-cloud-deployment-policy.json | 35 +++++++++ .../multi/ap-southeast-1-nw-partition.json | 19 +++++ .../multi/ap-southeast-2-nw-partition.json | 25 +++++++ .../multi/openstack-nw-partition.json | 21 ++++++ 10 files changed, 291 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/9cb1b34a/samples/application-policies/multi-cloud-application-policy.json ---------------------------------------------------------------------- diff --git a/samples/application-policies/multi-cloud-application-policy.json b/samples/application-policies/multi-cloud-application-policy.json new file mode 100644 index 0000000..15d8f39 --- /dev/null +++ b/samples/application-policies/multi-cloud-application-policy.json @@ -0,0 +1,10 @@ +{ + "id": "multi-cloud-application-policy", + "algorithm": "one-after-another", + "networkPartitions": [ + "ap-southeast-1-nw-partition", + "ap-southeast-2-nw-partition", + "openstack-nw-partition" + ], + "properties": [] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/9cb1b34a/samples/applications/simple/single-cartridge-app-multi-cloud/README.md ---------------------------------------------------------------------- diff --git a/samples/applications/simple/single-cartridge-app-multi-cloud/README.md b/samples/applications/simple/single-cartridge-app-multi-cloud/README.md new file mode 100644 index 0000000..9701a82 --- /dev/null +++ b/samples/applications/simple/single-cartridge-app-multi-cloud/README.md @@ -0,0 +1,25 @@ +Single Cartridge Application in a multi cloud environment +========================================================= +A simple application with a php cartridge. + +Application view +---------------- +single-cartridge-app <br /> +-- single-cartridge-app-1 <br /> +-- -- my-php <br /> + +Application folder structure +---------------------------- +-- artifacts/multi/ IaaS specific artifacts <br /> +-- scripts/common/ Common scripts for all iaases <br /> +-- scripts/multi IaaS specific scripts <br /> + +How to run +---------- +cd scripts/multi/ <br /> +./deploy.sh <br /> + +How to undeploy +--------------- +cd scripts/multi/ <br /> +./undeploy.sh <br /> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/9cb1b34a/samples/applications/simple/single-cartridge-app-multi-cloud/artifacts/application.json ---------------------------------------------------------------------- diff --git a/samples/applications/simple/single-cartridge-app-multi-cloud/artifacts/application.json b/samples/applications/simple/single-cartridge-app-multi-cloud/artifacts/application.json new file mode 100644 index 0000000..cbe785c --- /dev/null +++ b/samples/applications/simple/single-cartridge-app-multi-cloud/artifacts/application.json @@ -0,0 +1,25 @@ +{ + "applicationId": "single-cartridge-multi-cloud-app", + "alias": "single-cartridge-multi-cloud-app", + "multiTenant": false, + "components": { + "cartridges": [ + { + "type": "php", + "cartridgeMin": 1, + "cartridgeMax": 10, + "subscribableInfo": { + "alias": "my-php", + "autoscalingPolicy": "autoscaling-policy-1", + "deploymentPolicy": "multi-cloud-deployment-policy", + "artifactRepository": { + "privateRepo": false, + "repoUrl": "https://github.com/lakwarus/single-cartridge.git", + "repoUsername": "", + "repoPassword": "" + } + } + } + ] + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/9cb1b34a/samples/applications/simple/single-cartridge-app-multi-cloud/scripts/multi/deploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/simple/single-cartridge-app-multi-cloud/scripts/multi/deploy.sh b/samples/applications/simple/single-cartridge-app-multi-cloud/scripts/multi/deploy.sh new file mode 100755 index 0000000..3a194ce --- /dev/null +++ b/samples/applications/simple/single-cartridge-app-multi-cloud/scripts/multi/deploy.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# -------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# -------------------------------------------------------------- +# +iaas="multi" + +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/9cb1b34a/samples/applications/simple/single-cartridge-app-multi-cloud/scripts/multi/undeploy.sh ---------------------------------------------------------------------- diff --git a/samples/applications/simple/single-cartridge-app-multi-cloud/scripts/multi/undeploy.sh b/samples/applications/simple/single-cartridge-app-multi-cloud/scripts/multi/undeploy.sh new file mode 100755 index 0000000..aa246e6 --- /dev/null +++ b/samples/applications/simple/single-cartridge-app-multi-cloud/scripts/multi/undeploy.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# -------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# -------------------------------------------------------------- +# +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/9cb1b34a/samples/cartridges/multi/php.json ---------------------------------------------------------------------- diff --git a/samples/cartridges/multi/php.json b/samples/cartridges/multi/php.json new file mode 100755 index 0000000..eddf5a8 --- /dev/null +++ b/samples/cartridges/multi/php.json @@ -0,0 +1,75 @@ +{ + "type": "php", + "provider": "apache", + "category": "framework", + "host": "php.stratos.org", + "displayName": "php", + "description": "php Cartridge", + "version": "7", + "multiTenant": "false", + "portMapping": [ + { + "protocol": "http", + "port": "80", + "proxyPort": "8280" + } + ], + "deployment": { + }, + "iaasProvider": [ + { + "type": "ec2-singapore", + "imageId": "ap-southeast-1/ami-eeert6bc", + "property": [ + { + "name": "instanceType", + "value": "m3.medium" + }, + { + "name": "keyPair", + "value": "key-demo" + }, + { + "name": "securityGroups", + "value": "stratos-demo" + } + ] + }, + { + "type": "ec2-sydney", + "imageId": "ap-southeast-2/ami-259ok3a1f", + "property": [ + { + "name": "instanceType", + "value": "m3.medium" + }, + { + "name": "keyPair", + "value": "key-demo-sydney" + }, + { + "name": "securityGroups", + "value": "stratos-demo" + } + ] + }, + { + "type": "openstack", + "imageId": "RegionOne/b4ca55e3-58ab-4937-82ce-817ebd10240e", + "property": [ + { + "name": "instanceType", + "value": "RegionOne/aa5f45a2-c6d6-419d-917a-9dd2e3888594" + }, + { + "name": "keyPair", + "value": "key-demo" + }, + { + "name": "securityGroups", + "value": "default" + } + ] + } + ] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/9cb1b34a/samples/deployment-policies/multi-cloud-deployment-policy.json ---------------------------------------------------------------------- diff --git a/samples/deployment-policies/multi-cloud-deployment-policy.json b/samples/deployment-policies/multi-cloud-deployment-policy.json new file mode 100644 index 0000000..05d28c7 --- /dev/null +++ b/samples/deployment-policies/multi-cloud-deployment-policy.json @@ -0,0 +1,35 @@ +{ + "id": "multi-cloud-deployment-policy", + "networkPartitions": [ + { + "id": "ap-southeast-1-nw-partition", + "partitionAlgo": "one-after-another", + "partitions": [ + { + "id": "ap-southeast-1a-partition", + "partitionMax": 4 + } + ] + }, + { + "id": "ap-southeast-2-nw-partition", + "partitionAlgo": "one-after-another", + "partitions": [ + { + "id": "ap-southeast-2b-partition", + "partitionMax": 4 + } + ] + }, + { + "id": "openstack-nw-partition", + "partitionAlgo": "one-after-another", + "partitions": [ + { + "id": "partition-1", + "partitionMax": 2 + } + ] + } + ] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/9cb1b34a/samples/network-partitions/multi/ap-southeast-1-nw-partition.json ---------------------------------------------------------------------- diff --git a/samples/network-partitions/multi/ap-southeast-1-nw-partition.json b/samples/network-partitions/multi/ap-southeast-1-nw-partition.json new file mode 100644 index 0000000..061fc73 --- /dev/null +++ b/samples/network-partitions/multi/ap-southeast-1-nw-partition.json @@ -0,0 +1,19 @@ +{ + "id": "ap-southeast-1-nw-partition", + "provider": "ec2-singapore", + "partitions": [ + { + "id": "ap-southeast-1a-partition", + "property": [ + { + "name": "region", + "value": "ap-southeast-1" + }, + { + "name": "zone", + "value": "ap-southeast-1a" + } + ] + } + ] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/9cb1b34a/samples/network-partitions/multi/ap-southeast-2-nw-partition.json ---------------------------------------------------------------------- diff --git a/samples/network-partitions/multi/ap-southeast-2-nw-partition.json b/samples/network-partitions/multi/ap-southeast-2-nw-partition.json new file mode 100644 index 0000000..435d2f0 --- /dev/null +++ b/samples/network-partitions/multi/ap-southeast-2-nw-partition.json @@ -0,0 +1,25 @@ +{ + "id": "ap-southeast-2-nw-partition", + "provider": "ec2-sydney", + "partitions": [ + { + "id": "ap-southeast-2b-partition", + "property": [ + { + "name": "region", + "value": "ap-southeast-2" + }, + { + "name": "zone", + "value": "ap-southeast-2b" + } + ] + } + ], + "properties": [ + { + "name": "payload_parameter.PUPPET_IP", + "value": "172.31.9.64" + } + ] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/9cb1b34a/samples/network-partitions/multi/openstack-nw-partition.json ---------------------------------------------------------------------- diff --git a/samples/network-partitions/multi/openstack-nw-partition.json b/samples/network-partitions/multi/openstack-nw-partition.json new file mode 100644 index 0000000..c95a987 --- /dev/null +++ b/samples/network-partitions/multi/openstack-nw-partition.json @@ -0,0 +1,21 @@ +{ + "id": "openstack-nw-partition", + "provider": "openstack", + "partitions": [ + { + "id": "partition-1", + "property": [ + { + "name": "region", + "value": "RegionOne" + } + ] + } + ], + "properties": [ + { + "name": "payload_parameter.PUPPET_IP", + "value": "192.168.60.16" + } + ] +}
