From ce820d2ee53fb25e1e24548437125b498c707330 Mon Sep 17 00:00:00 2001 From: earthmant Date: Mon, 6 Apr 2015 21:30:32 +0300 Subject: [PATCH 1/3] changing the names to be consistent with agreed convention --- ec2-blueprint.yaml | 228 --------------------------------------- inputs/ec2.yaml.template | 3 - 2 files changed, 231 deletions(-) delete mode 100644 ec2-blueprint.yaml delete mode 100644 inputs/ec2.yaml.template diff --git a/ec2-blueprint.yaml b/ec2-blueprint.yaml deleted file mode 100644 index 2bae973..0000000 --- a/ec2-blueprint.yaml +++ /dev/null @@ -1,228 +0,0 @@ -########################################################### -# This Blueprint installs the nodecellar application -# on an amazon ec2 cloud environment. -########################################################### - -tosca_definitions_version: cloudify_dsl_1_1 - -imports: - - http://www.getcloudify.org/spec/cloudify/3.2m8/types.yaml - - http://www.getcloudify.org/spec/aws-plugin/1.2m8/plugin.yaml - - http://www.getcloudify.org/spec/diamond-plugin/1.2m8/plugin.yaml - - types/nodecellar.yaml - -##################################################################################### -# inputs section allows the user to use same -# blueprint for creating different deployments, each one -# with its own parameters. -# to specify deployment inputs run: -# - cfy deployments create -b -d -i inputs.json -##################################################################################### - -inputs: - - image: - description: > - Image to be used when launching agent VM's - - size: - description: > - Flavor of the agent VM's - - agent_user: - description: > - User for connecting to agent VM's - -node_types: - - ########################################################### - # We define a type that inherits ec2's default - # server, and adds monitoring capabillities on top of it. - ########################################################### - - nodecellar.nodes.MonitoredServer: - derived_from: cloudify.aws.nodes.Instance - properties: - cloudify_agent: - default: - user: { get_input: agent_user } - interfaces: - - ########################################################### - # We are infact telling cloudify to install a diamond - # monitoring agent on the server. - # - # (see https://github.com/BrightcoveOS/Diamond) - ########################################################### - - cloudify.interfaces.monitoring_agent: - install: - implementation: diamond.diamond_agent.tasks.install - inputs: - diamond_config: - default: - interval: 1 - start: diamond.diamond_agent.tasks.start - stop: diamond.diamond_agent.tasks.stop - uninstall: diamond.diamond_agent.tasks.uninstall - - ########################################################### - # Adding some collectors. These collectors are necessary - # for the Cloudify UI to display the deafult metrics. - ########################################################### - - cloudify.interfaces.monitoring: - start: - implementation: diamond.diamond_agent.tasks.add_collectors - inputs: - collectors_config: - default: - CPUCollector: {} - MemoryCollector: {} - LoadAverageCollector: {} - DiskUsageCollector: - config: - devices: x?vd[a-z]+[0-9]*$ - NetworkCollector: {} - -node_templates: - - mongod_host: - type: nodecellar.nodes.MonitoredServer - properties: - image_id: { get_input: image } - instance_type: { get_input: size } - relationships: - - type: cloudify.aws.relationships.instance_connected_to_security_group - target: mongod_security_group - - nodejs_host: - type: nodecellar.nodes.MonitoredServer - properties: - image_id: { get_input: image } - instance_type: { get_input: size } - relationships: - - type: cloudify.aws.relationships.instance_connected_to_security_group - target: nodecellar_security_group - - type: cloudify.aws.relationships.instance_connected_to_elastic_ip - target: nodecellar_elasticip - - mongod: - type: nodecellar.nodes.MongoDatabase - properties: - port: 27017 - interfaces: - cloudify.interfaces.lifecycle: - - ########################################################### - # The MongoDBCollector depends on a python library called - # pymongo. We install this library in the 'configure' - # lifecycle hook of this node. - ########################################################### - - configure: scripts/mongo/install-pymongo.sh - - ########################################################### - # Notice that this node defines an additional collector - # to collect data on the MongoDB. - ########################################################### - - cloudify.interfaces.monitoring: - start: - implementation: diamond.diamond_agent.tasks.add_collectors - inputs: - collectors_config: - MongoDBCollector: - config: - hosts: "localhost:27017" - relationships: - - type: cloudify.relationships.contained_in - target: mongod_host - - nodejs: - type: nodecellar.nodes.NodeJSServer - relationships: - - type: cloudify.relationships.contained_in - target: nodejs_host - - nodecellar: - type: nodecellar.nodes.NodecellarApplicationModule - properties: - port: 8080 - relationships: - - ################################ - # Setting the mongo connection - ################################ - - - type: node_connected_to_mongo - target: mongod - - ################################ - # Setting the nodejs connection - ################################ - - - type: node_contained_in_nodejs - target: nodejs - - ########################################################### - # A security group to enable access to the nodejs host - # using the port of the nodecellar application. - # - # This security group will be attached to the nodejs_host - ########################################################### - - nodecellar_security_group: - type: cloudify.aws.nodes.SecurityGroup - properties: - description: Security Group for Nodecellar VMs - rules: - - ip_protocol: tcp - from_port: { get_property: [ nodecellar, port ] } - to_port: { get_property: [ nodecellar, port ] } - cidr_ip: 0.0.0.0/0 - - ########################################################### - # A security group to enable access to the mongo host - # using the port of the mongo node. - # - # We need this so that the nodecellar application can - # comminicate with MongoDB, since they are running on - # different hosts. - ########################################################### - - mongod_security_group: - type: cloudify.aws.nodes.SecurityGroup - properties: - description: Security Group for Mongo VMs - rules: - - ip_protocol: tcp - from_port: { get_property: [ mongod, port ] } - to_port: { get_property: [ mongod, port ] } - cidr_ip: 0.0.0.0/0 - - ip_protocol: tcp - from_port: 28017 - to_port: 28017 - cidr_ip: 0.0.0.0/0 - - ########################################################### - # A floating ip to be attached to the nodejs host, since - # eventually we want to be able to access it - # from any machine, on any network. - ########################################################### - - nodecellar_elasticip: - type: cloudify.aws.nodes.ElasticIP - -########################################################### -# This outputs section exposes the application endpoint. -# You can access it by running: -# - cfy deployments -d outputs -########################################################### - -outputs: - endpoint: - description: Web application endpoint - value: - ip_address: { get_attribute: [ nodecellar_elasticip, floating_ip_address ] } - port: { get_property: [ nodecellar, port ] } diff --git a/inputs/ec2.yaml.template b/inputs/ec2.yaml.template deleted file mode 100644 index cc88f0e..0000000 --- a/inputs/ec2.yaml.template +++ /dev/null @@ -1,3 +0,0 @@ -image: '' -size: '' -agent_user: '' From acccbc54734f7250a855b921aa1cfb7d5a89b42d Mon Sep 17 00:00:00 2001 From: earthmant Date: Mon, 6 Apr 2015 21:32:04 +0300 Subject: [PATCH 2/3] changing the names of the ec2 files to aws as agreed --- .travis.yml | 2 +- aws-blueprint.yaml | 228 +++++++++++++++++++++++++++++++++++++++ inputs/aws.yaml.template | 3 + 3 files changed, 232 insertions(+), 1 deletion(-) create mode 100644 aws-blueprint.yaml create mode 100644 inputs/aws.yaml.template diff --git a/.travis.yml b/.travis.yml index 4e38501..1cfdd89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ install: script: - cfy init - cfy blueprints validate -p local-blueprint.yaml - - cfy blueprints validate -p ec2-blueprint.yaml + - cfy blueprints validate -p aws-blueprint.yaml - cfy blueprints validate -p openstack-blueprint.yaml - cfy blueprints validate -p openstack-nova-net-blueprint.yaml - cfy blueprints validate -p openstack-haproxy-blueprint.yaml diff --git a/aws-blueprint.yaml b/aws-blueprint.yaml new file mode 100644 index 0000000..2bae973 --- /dev/null +++ b/aws-blueprint.yaml @@ -0,0 +1,228 @@ +########################################################### +# This Blueprint installs the nodecellar application +# on an amazon ec2 cloud environment. +########################################################### + +tosca_definitions_version: cloudify_dsl_1_1 + +imports: + - http://www.getcloudify.org/spec/cloudify/3.2m8/types.yaml + - http://www.getcloudify.org/spec/aws-plugin/1.2m8/plugin.yaml + - http://www.getcloudify.org/spec/diamond-plugin/1.2m8/plugin.yaml + - types/nodecellar.yaml + +##################################################################################### +# inputs section allows the user to use same +# blueprint for creating different deployments, each one +# with its own parameters. +# to specify deployment inputs run: +# - cfy deployments create -b -d -i inputs.json +##################################################################################### + +inputs: + + image: + description: > + Image to be used when launching agent VM's + + size: + description: > + Flavor of the agent VM's + + agent_user: + description: > + User for connecting to agent VM's + +node_types: + + ########################################################### + # We define a type that inherits ec2's default + # server, and adds monitoring capabillities on top of it. + ########################################################### + + nodecellar.nodes.MonitoredServer: + derived_from: cloudify.aws.nodes.Instance + properties: + cloudify_agent: + default: + user: { get_input: agent_user } + interfaces: + + ########################################################### + # We are infact telling cloudify to install a diamond + # monitoring agent on the server. + # + # (see https://github.com/BrightcoveOS/Diamond) + ########################################################### + + cloudify.interfaces.monitoring_agent: + install: + implementation: diamond.diamond_agent.tasks.install + inputs: + diamond_config: + default: + interval: 1 + start: diamond.diamond_agent.tasks.start + stop: diamond.diamond_agent.tasks.stop + uninstall: diamond.diamond_agent.tasks.uninstall + + ########################################################### + # Adding some collectors. These collectors are necessary + # for the Cloudify UI to display the deafult metrics. + ########################################################### + + cloudify.interfaces.monitoring: + start: + implementation: diamond.diamond_agent.tasks.add_collectors + inputs: + collectors_config: + default: + CPUCollector: {} + MemoryCollector: {} + LoadAverageCollector: {} + DiskUsageCollector: + config: + devices: x?vd[a-z]+[0-9]*$ + NetworkCollector: {} + +node_templates: + + mongod_host: + type: nodecellar.nodes.MonitoredServer + properties: + image_id: { get_input: image } + instance_type: { get_input: size } + relationships: + - type: cloudify.aws.relationships.instance_connected_to_security_group + target: mongod_security_group + + nodejs_host: + type: nodecellar.nodes.MonitoredServer + properties: + image_id: { get_input: image } + instance_type: { get_input: size } + relationships: + - type: cloudify.aws.relationships.instance_connected_to_security_group + target: nodecellar_security_group + - type: cloudify.aws.relationships.instance_connected_to_elastic_ip + target: nodecellar_elasticip + + mongod: + type: nodecellar.nodes.MongoDatabase + properties: + port: 27017 + interfaces: + cloudify.interfaces.lifecycle: + + ########################################################### + # The MongoDBCollector depends on a python library called + # pymongo. We install this library in the 'configure' + # lifecycle hook of this node. + ########################################################### + + configure: scripts/mongo/install-pymongo.sh + + ########################################################### + # Notice that this node defines an additional collector + # to collect data on the MongoDB. + ########################################################### + + cloudify.interfaces.monitoring: + start: + implementation: diamond.diamond_agent.tasks.add_collectors + inputs: + collectors_config: + MongoDBCollector: + config: + hosts: "localhost:27017" + relationships: + - type: cloudify.relationships.contained_in + target: mongod_host + + nodejs: + type: nodecellar.nodes.NodeJSServer + relationships: + - type: cloudify.relationships.contained_in + target: nodejs_host + + nodecellar: + type: nodecellar.nodes.NodecellarApplicationModule + properties: + port: 8080 + relationships: + + ################################ + # Setting the mongo connection + ################################ + + - type: node_connected_to_mongo + target: mongod + + ################################ + # Setting the nodejs connection + ################################ + + - type: node_contained_in_nodejs + target: nodejs + + ########################################################### + # A security group to enable access to the nodejs host + # using the port of the nodecellar application. + # + # This security group will be attached to the nodejs_host + ########################################################### + + nodecellar_security_group: + type: cloudify.aws.nodes.SecurityGroup + properties: + description: Security Group for Nodecellar VMs + rules: + - ip_protocol: tcp + from_port: { get_property: [ nodecellar, port ] } + to_port: { get_property: [ nodecellar, port ] } + cidr_ip: 0.0.0.0/0 + + ########################################################### + # A security group to enable access to the mongo host + # using the port of the mongo node. + # + # We need this so that the nodecellar application can + # comminicate with MongoDB, since they are running on + # different hosts. + ########################################################### + + mongod_security_group: + type: cloudify.aws.nodes.SecurityGroup + properties: + description: Security Group for Mongo VMs + rules: + - ip_protocol: tcp + from_port: { get_property: [ mongod, port ] } + to_port: { get_property: [ mongod, port ] } + cidr_ip: 0.0.0.0/0 + - ip_protocol: tcp + from_port: 28017 + to_port: 28017 + cidr_ip: 0.0.0.0/0 + + ########################################################### + # A floating ip to be attached to the nodejs host, since + # eventually we want to be able to access it + # from any machine, on any network. + ########################################################### + + nodecellar_elasticip: + type: cloudify.aws.nodes.ElasticIP + +########################################################### +# This outputs section exposes the application endpoint. +# You can access it by running: +# - cfy deployments -d outputs +########################################################### + +outputs: + endpoint: + description: Web application endpoint + value: + ip_address: { get_attribute: [ nodecellar_elasticip, floating_ip_address ] } + port: { get_property: [ nodecellar, port ] } diff --git a/inputs/aws.yaml.template b/inputs/aws.yaml.template new file mode 100644 index 0000000..cc88f0e --- /dev/null +++ b/inputs/aws.yaml.template @@ -0,0 +1,3 @@ +image: '' +size: '' +agent_user: '' From c5da3fbd311b6304ea4d7e526b249e0fa637bdd3 Mon Sep 17 00:00:00 2001 From: earthmant Date: Tue, 7 Apr 2015 15:43:50 +0300 Subject: [PATCH 3/3] changing these from aws to aws-ec2 --- .travis.yml | 2 +- aws-blueprint.yaml => aws-ec2-blueprint.yaml | 0 inputs/{aws.yaml.template => aws-ec2.yaml.template} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename aws-blueprint.yaml => aws-ec2-blueprint.yaml (100%) rename inputs/{aws.yaml.template => aws-ec2.yaml.template} (100%) diff --git a/.travis.yml b/.travis.yml index 1cfdd89..252feb9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ install: script: - cfy init - cfy blueprints validate -p local-blueprint.yaml - - cfy blueprints validate -p aws-blueprint.yaml + - cfy blueprints validate -p aws-ec2-blueprint.yaml - cfy blueprints validate -p openstack-blueprint.yaml - cfy blueprints validate -p openstack-nova-net-blueprint.yaml - cfy blueprints validate -p openstack-haproxy-blueprint.yaml diff --git a/aws-blueprint.yaml b/aws-ec2-blueprint.yaml similarity index 100% rename from aws-blueprint.yaml rename to aws-ec2-blueprint.yaml diff --git a/inputs/aws.yaml.template b/inputs/aws-ec2.yaml.template similarity index 100% rename from inputs/aws.yaml.template rename to inputs/aws-ec2.yaml.template