Skip to content

Documentation and file cleanup; enhance simple blueprint #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 80 additions & 94 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,153 +1,139 @@
# Cloudify Nodecellar Example
Cloudify Node Cellar Example
============================

* Master [![Circle CI](https://circleci.com/gh/cloudify-cosmo/cloudify-nodecellar-example/tree/master.svg?&style=shield)](https://circleci.com/gh/cloudify-cosmo/cloudify-nodecellar-example/tree/master)
[![Circle CI status](https://circleci.com/gh/cloudify-cosmo/cloudify-nodecellar-example/tree/master.svg?&style=shield)](https://circleci.com/gh/cloudify-cosmo/cloudify-nodecellar-example/tree/master)
![Node Cellar local tested](http://img.shields.io/badge/nodecellar--local-tested-green.svg)
![Node Cellar simple manually tested](http://img.shields.io/badge/nodecellar--simple-manually--tested-yellow.svg)
![Node Cellar host pool tested](http://img.shields.io/badge/nodecellar--host--pool-tested-green.svg)
![Node Cellar OpenStack tested](http://img.shields.io/badge/nodecellar--openstack-tested-green.svg)
![Node Cellar OpenStack HAProxy tested](http://img.shields.io/badge/nodecellar--openstack--haproxy--net-tested-green.svg)
![Node Cellar OpenStack Nova tested](http://img.shields.io/badge/nodecellar--openstack--nova--net-tested-green.svg)
![Node Cellar CloudStack manually tested](http://img.shields.io/badge/nodecellar--cloudstack-manually--tested-yellow.svg)
![Node Cellar EC2 tested](http://img.shields.io/badge/nodecellar--aws--ec2-tested-green.svg)
![Node Cellar vCloud tested](http://img.shields.io/badge/nodecellar--vcloud-tested-green.svg)
![Node Cellar vSphere tested](http://img.shields.io/badge/nodecellar--vcloud-tested-green.svg)
![Node Cellar SoftLayer tested](http://img.shields.io/badge/nodecellar--softlayer-tested-green.svg)

![alt text](http://img.shields.io/badge/nodecellar--local-tested-green.svg)
![alt text](http://img.shields.io/badge/nodecellar--aws--ec2-tested-green.svg)
![alt text](http://img.shields.io/badge/nodecellar--openstack-tested-green.svg)
![alt text](http://img.shields.io/badge/nodecellar--openstack--nova--net-tested-green.svg)
![alt text](http://img.shields.io/badge/nodecellar--openstack--haproxy--net-tested-green.svg)
![alt text](http://img.shields.io/badge/nodecellar--singlehost-manually--tested-yellow.svg)
![alt text](http://img.shields.io/badge/nodecellar--softlayer-tested-green.svg)
![alt text](http://img.shields.io/badge/nodecellar--cloudstack-manually--tested-yellow.svg)
![alt text](http://img.shields.io/badge/nodecellar--cloudstack--vpc-manually--tested-yellow.svg)
![alt text](http://img.shields.io/badge/nodecellar--host--pool-tested-green.svg)
This repository contains blueprints for installing
[Node Cellar](http://coenraets.org/blog/2012/10/nodecellar-sample-application-with-backbone-js-twitter-bootstrap-node-js-express-and-mongodb/)
on several cloud and other environments. It is a simple two-node deployment that is useful for learning how to use [Cloudify](http://docs.getcloudify.org/3.4.0/intro/what-is-cloudify/) and how to write blueprints, for testing Cloudify installations, and for testing cloud environments.

This repository contains several blueprints for installing the
[nodecellar](http://coenraets.org/blog/2012/10/nodecellar-sample-application-with-backbone-js-twitter-bootstrap-node-js-express-and-mongodb/)
application.<br>
Nodecellar example consists of:
In addition to installing the application's resources and dependencies, the blueprints will also install a Cloudify agent that reports statistics and allows a Cloudify Manager to better control the hosts. (The exception is the local blueprint, which does not install the agent.)

- A Mongo Database
- A NodeJS Server
- A Javascript Application
## Quick start using the local blueprint

Before you begin its recommended you familiarize yourself with
[Cloudify Terminology](http://getcloudify.org/guide/3.1/reference-terminology.html).
First [install the Cloudify CLI](http://docs.getcloudify.org/3.4.0/intro/installation/).

The first thing you'll need to do is
[install the Cloudify CLI](http://getcloudify.org/guide/3.1/installation-cli.html).
<br>
This will let you run the various blueprints.
[The local blueprint](local-blueprint.yaml) allows you to install Node Cellar on your local host. (Note that it does _not_ require nor use a Cloudify Manager.)

**Note: <br>Documentation about the blueprints content is located inside the blueprint files themselves.
<br>Presented here are only instructions on how to RUN the blueprints using the Cloudify CLI.**
<br><br>
**From now on, all commands will assume that the working directory is the root of this repository.**
### Step 1: Initialize

## Local Blueprint
First, let's initialize your working directory to work with the given blueprint.

[This blueprint](local-blueprint.yaml) allows you to install the nodecellar application on your local machine. <br>
Let see how this is done:
cfy local init -p local-blueprint.yaml

### Step 1: Initialize
Now, you can run any type of workflow using this blueprint.

`cfy local init -p local-blueprint.yaml` <br>
### Step 2: Install

This command (as the name suggests) initializes your working directory to work with the given blueprint.
Now, you can run any type of workflows on this blueprint. <br>
Let's run the `install` workflow:

### Step 2: Install
cfy local execute -w install

Lets run the `install` workflow: <br>
This command will install all the application components on you local machine. (Everything will be safely installed installed under the `tmp` directory.) Once it's done, you should be able to browse to [http://localhost:8080](http://localhost:8080) and see the application.

`cfy local execute -w install`
### Step 3: Uninstall

This command will install all the application components on you local machine.
(don't worry, its all installed under the `tmp` directory)<br>
Once its done, you should be able to browse to [http://localhost:8080](http://localhost:8080) and see the application.
<br>
To uninstall the application we run the `uninstall` workflow:

cfy local execute -w uninstall

### Step 3: Uninstall
## Cloud blueprints

To uninstall the application we run the `uninstall` workflow: <br>
For pre-provisioned hosts:

`cfy local execute -w uninstall`
- [Simple](simple-blueprint.yaml) - deploy on arbitrary hosts with known IP addresses
- [Host pool](host-pool-blueprint.yaml) - deploy on arbitrary hosts with IP addresses managed by a [Host Pool Service](https://github.com/cloudify-cosmo/cloudify-host-pool-service); see also the [the plugin documentation](http://docs.getcloudify.org/3.4.0/plugins/host-pool/)

## All other blueprints
With provisioning of hosts:

- [EC2 Blueprint](aws-ec2-blueprint.yaml)
- [Openstack Blueprint](openstack-blueprint.yaml)
- [Openstack Nova Net Blueprint](openstack-nova-net-blueprint.yaml)
- [Openstack HAProxy Blueprint](openstack-haproxy-blueprint.yaml)
- [Singlehost Blueprint](singlehost-blueprint.yaml)
- [Softlayer Blueprint](softlayer-blueprint.yaml)
- [CloudStack Blueprint](cloudstack-blueprint.yaml)
- [CloudStack VPC Blueprint](cloudstack-vpc-blueprint.yaml)
- [Host Pool Blueprint](host-pool-blueprint.yaml) - To install this
blueprint, you must have a running [Host Pool Service](https://github.com/cloudify-cosmo/cloudify-host-pool-service) available. More
information can be found [Here](http://getcloudify.org/guide/3.2/plugin-host-pool.html#host-pool-service)
- [OpenStack](openstack-blueprint.yaml)
- [OpenStack HAProxy](openstack-haproxy-blueprint.yaml)
- [OpenStack Nova](openstack-nova-net-blueprint.yaml)
- [Apache CloudStack](cloudstack-blueprint.yaml)
- [Amazon EC2](aws-ec2-blueprint.yaml)
- [VMWare vCloud](vcloud-blueprint.yaml)
- [VMWare vSphere](vsphere-blueprint.yaml)
- [IBM SoftLayer](softlayer-blueprint.yaml)

All of these blueprints allow you to install the nodecellar application on different cloud environments.
Doing this requires first to bootstrap a Cloudify Manager.<br>
The cloud blueprints require access to a [Cloudify Manager](http://docs.getcloudify.org/3.4.0/intro/cloudify-manager/) instance. You can get one by deploying one of the [ready-to-run images](http://docs.getcloudify.org/3.4.0/manager/manager-images/) or [bootstrapping your own](http://docs.getcloudify.org/3.4.0/manager/bootstrapping/), including on a [local virtual machine](http://docs.getcloudify.org/3.4.0/manager/getting-started/).

### Step 1: Bootstrapping
These blueprints assume a topology of two hosts:

Please refer to [Bootstrapping Cloudify](http://getcloudify.org/guide/3.1/installation-bootstrapping.html) to setup your own Cloudify Manager.
<br><br>
- A Node.js server, running the JavaScript application
- A MongoDB instance

Great, now that you have your very own Cloudify Manager, we can work with these blueprints.
<br>
(The exception is the OpenStack HAProxy blueprint, which adds a third host for HAProxy.)

### Step 1: Connect to the Cloudify Manager

Tell the CLI to use the Manager:

cfy use -t <Manager IP address>

### Step 2: Upload the blueprint

`cfy blueprints upload -b <choose_blueprint_id> -p <blueprint_filename>` <br>
cfy blueprints upload -b <choose a blueprint ID> -p <blueprint filename.yaml>

### Step 3: Create a deployment

Every one of these blueprints have inputs, which can be populated for a deployment using input files. <br>
Example input files are located inside the *inputs* directory. <br>
Note that these files only contain the **mandatory** inputs, i.e, one's that the blueprint does not define a default value for.
Every one of these blueprints has inputs, which can be populated for a deployment using input files. Templates for such input files are located inside the `inputs` directory. Note that these templates only contain the _mandatory_ inputs, those for which the blueprint does not define a default value. Look inside the blueprints for documentation about additional inputs.

After you filled the input file corresponding to your blueprint, run: <br>
cp inputs/<inputs filename.yaml.template> <inputs filename.yaml>

`cfy deployments create -b <blueprint_id> -d <choose_deployment_id> -i inputs/<inputs_filename>`
After you filled the input file corresponding to your blueprint, create the deployment:

### Step 4: Install
cfy deployments create -b <blueprint ID used above> -d <choose a deployment ID> -i <inputs filename.yaml>

Once the deployment is created, we can start running workflows: <br>
### Step 4: Install

`cfy executions start -w install -d <deployment_id>`
Once the deployment is created, we can start running workflows:

This process will create all the cloud resources needed for the application: <br>
cfy executions start -w install -d <deployment ID used above>

- VM's
- Floating IP's
- Security Groups
This `install` workflow will create all the resources and run all the lifecycles tasks needed for deployment in the environment, including:

and everything else that is needed and declared in the blueprint.<br>
- Virtual machines
- Floating IP addresses
- Security groups

### Step 5: Verify installation

Once the workflow execution is complete, we can view the application endpoint by running: <br>
Once the workflow execution is complete, we can view the application endpoint by running:

`cfy deployments outputs -d <deployment_id>`
cfy deployments outputs -d <deployment ID>

Hit that URL to see the application running.
One of the outputs should be the application's URL. Browse it to see Node Cellar in action!

### Step 6: Uninstall

Now lets run the `uninstall` workflow. This will uninstall the application,
as well as delete all related resources. <br>
Now lets run the `uninstall` workflow, which will uninstall the application as well as the resources:

`cfy executions start -w uninstall -d <deployment_id>`
cfy executions start -w uninstall -d <deployment ID>

### Step 7: Delete the deployment

Its best to delete deployments we are no longer using, since they take up memory on the management machine.
We do this by running:
It's best to delete deployments we are no longer using, since they take up space on the management machine:

`cfy deployments delete -d <deployment_id>`
cfy deployments delete -d <deployment_id>

### Step 8: Tearing down the manager
### Step 8: Tear down the manager

If you have no further use for your Cloudify Manager, you can tear it (and all resources created by the bootstrap process)
by running:
If you have no further use for your Cloudify Manager, you can tear it down (together with the resources created by the bootstrap process) by running:

`cfy teardown -f`
cfy teardown -f

## What's Next
## What's next?

Visit us on the Cloudify community website at [getcloudify.org](http://getcloudify.org) for more guides and tutorials.
Visit the Cloudify community website at [getcloudify.org](http://getcloudify.org) for more guides and tutorials.

Loading