INACTIVE - Cloud Foundry - the open platform as a service project
Перейти к файлу
Michael 6d3b5e1fb5 Neo4j vcap support
Squashed commit of the following:

commit 04b11c8c6dff36c00b1b7a51c6d8801fdda48c86
Merge: a104078 5ed899a
Author: Patrick Bozeman <pbozeman@vmware.com>
Date:   Tue Aug 2 12:00:23 2011 -0700

    Merge remote-tracking branch 'jexp/master'

    Conflicts:
    	.gitmodules
    	cloud_controller/config/cloud_controller.yml

    Change-Id: I69c7cafd87e52eab2e941d4a993f03b879f0d194

commit 5ed899a6bdf12d75139b540b161212592419de99
Author: Michael <github@jexp.de>
Date:   Tue Aug 2 14:40:28 2011 +0200

    update to neo4j 1.4.1

commit c5f4c1d37c99e93f6e5d601cb0d7359dd99356b6
Author: Michael <github@jexp.de>
Date:   Wed May 25 23:17:25 2011 +0200

    updated gitmodules to public http url

commit 10a5d3f374355f435bff325b7b1267424edbca75
Author: Michael <github@jexp.de>
Date:   Mon May 23 11:46:31 2011 +0200

    updated setup to extract neo4j startup script

commit 44a0a923f21f747519daf6bba50d54bff26ef70f
Author: Michael <github@jexp.de>
Date:   Fri May 6 02:44:39 2011 +0200

    updated vcap_setup to use neo4j-hosting-extension

commit a662ff04429813ec70901a2227b7d1113d2b8a78
Merge: f4f43f1 e984187
Author: Michael <github@jexp.de>
Date:   Tue May 3 14:09:49 2011 +0200

    merge vcap_setup

commit f4f43f1129ce76ea4ff9e5c009c7a52d3ea94c92
Author: Michael <github@jexp.de>
Date:   Tue May 3 14:05:34 2011 +0200

    neo4j services git repo for submodule

commit a732e0716060750de72869a140278398aaa80d3f
Author: Michael Hunger <github@jexp.de>
Date:   Tue May 3 14:03:14 2011 +0200

    xadded neo4j server provisioning

commit e9841870c9a9b4f2e06e2be246ad8eaa733d0b41
Author: Michael Hunger <github@jexp.de>
Date:   Thu Apr 21 12:45:25 2011 +0200

    added neo4j setup

commit ef3d720fe621e9764fa0a956586c22b95e5c5f2a
Author: Michael Hunger <github@jexp.de>
Date:   Thu Apr 21 10:59:52 2011 +0200

    added neo4j services

Change-Id: I6ca4cb1fb4e793c1eda9936787ce16d3837cf3ec
2011-09-08 11:35:53 -07:00
bin Neo4j vcap support 2011-09-08 11:35:53 -07:00
cloud_controller Neo4j vcap support 2011-09-08 11:35:53 -07:00
common Fix check for subprocess exit status 2011-08-22 16:44:26 -07:00
dea Squashed commit of the DEA::Agent#cleaup_droplet rechown addition 2011-09-02 17:39:25 -07:00
dev_setup Merge changes Ia7b7fd5f,I3f73e4e2 2011-09-07 18:45:56 +00:00
docs Squashed merge of the final phpfog pull request 2011-08-24 20:18:05 -07:00
git Added tracked hooks to vcap repo 2011-08-29 18:05:24 -07:00
health_manager Merge "HealthManager varz changes - Fixed varz stats keeping frameworks/runtimes around that are no longer in the DB - Added started apps and instances - Aggregated queries to reduce number of requests" 2011-08-12 18:23:07 +00:00
java@c51b28e90b bump java submodule ptr 2011-08-12 10:54:16 -07:00
lib Update stager to use new staging gem. 2011-09-02 10:32:41 -07:00
rakelib Neo4j vcap support 2011-09-08 11:35:53 -07:00
router Fix for zero length responses being returned 2011-08-12 13:15:25 -07:00
services@d87e58d695 bump services submodule ptr 2011-08-12 10:58:20 -07:00
setup Neo4j vcap support 2011-09-08 11:35:53 -07:00
stager Update stager to use new staging gem. 2011-09-02 10:32:41 -07:00
staging Update stager to use new staging gem. 2011-09-02 10:32:41 -07:00
tests@842d3bff9c bump test submodule ptr 2011-08-24 23:53:54 -07:00
.gitignore Add pid files to gitignore 2011-05-23 14:21:48 -07:00
.gitmodules keep gitmodules pointing to the staging repo 2011-05-23 10:36:58 -07:00
.rvmrc lock ruby 1.9.2 at p180 2011-07-18 16:38:10 -07:00
AUTHORS Merge branch 'phpfog' 2011-08-23 13:29:16 -07:00
LICENSE Initial commit 2011-04-11 20:18:41 -07:00
NOTICE Initial commit 2011-04-11 20:18:41 -07:00
README.md bump recommended vm memory size 2011-08-24 15:39:48 -07:00
Rakefile Simplify git submodule helpers 2011-04-13 18:24:03 -04:00

README.md

VMware's Cloud Application Platform

Copyright (c) 2009-2011 VMware, Inc.

What is Cloud Foundry?

Cloud Foundry is an open platform-as-a-service (PaaS). The system supports multiple frameworks, multiple application infrastructure services and deployment to multiple clouds.

License

Cloud Foundry uses the Apache 2 license. See LICENSE for details.

Installation Notes

Cloud Foundry is made up of a number of system components (cloud controller, health manager, dea, router, etc.). These components can run co-located in a single vm/single os or can be spread across several machines/vm's.

For development purposes, the preferred environment is to run all of the core components within a single vm and then interact with the system from outside of the vm via an ssh tunnel. The pre-defined domain *.vcap.me maps to local host, so when you use this setup, the end result is that your development environment is available at http://api.vcap.me.

For large scale or multi-vm deployments, the system is flexible enough to allow you to place system components on multiple vm's, run multiple nodes of a given type (e.g., 8 routers, 4 cloud controllers, etc.)

The detailed install instructions below walk you through the install process for a single vm installation.

Versions of these instructions have been used for production deployments, and for our own development purposes. many of us develop on mac laptops, so some additional instructions for this environment have been included.

Detailed Install/Run Instructions:

There are two methods for installing VCAP. One is a manual process, which you might choose to do if you want to understand the details of what goes into a bringing up a VCAP instance. The other is an automated process contributed by the community. In both cases, you need to start with a stock Ubuntu server VM.

Step 1: create a pristine VM with ssh

  • setup a VM with a pristine Ubuntu 10.04.2 server 64bit image, download here
  • you may wish to snapshot your VM now in case things go pear shaped.
  • setup your VM with 1G or more of memory
  • great snapshot spots are here and after step 4
  • to enable remote access (more fun than using the console), install ssh.

To install ssh:

sudo apt-get install openssh-server

Step 2: run the automated setup process

Run the install script. It'll ask for your sudo password at the beginning and towards the end. The entire process takes ~1 hour, so just keep a loose eye on it.

 sudo apt-get install curl
 bash < <(curl -s -k -B https://raw.github.com/cloudfoundry/vcap/master/setup/install)

NOTE: The automated setup does not auto-start the system. Once you are done with the setup, exit your current shell, restart a new shell and continue the following steps

Step 3: start the system

cd ~/cloudfoundry/vcap
bin/vcap start
bin/vcap tail  # see aggregate logs

Step 4: Optional, mac/linux users only, create a local ssh tunnel

From your VM, run ifconfig and note your eth0 IP address, which will look something like: 192.168.252.130

Now go to your mac terminal window and verify that you can connect with SSH:

ssh <your VM user>@<VM IP address>

If this works, create a local port 80 tunnel:

sudo ssh -L <local-port>:<VM IP address>:80 <your VM user>@<VM IP address> -N

If you are not already running a local web server, use port 80 as your local port, otherwise you may want to use 8080 or another common http port.

Once you do this, from both your mac, and from within the vm, api.vcap.me and *.vcap.me will map to localhost which will map to your running Cloud Foundry instance.

Trying your setup

Step 5: validate that you can connect and tests pass

From the console of your vm, or from your mac (thanks to local tunnel)

vmc target api.vcap.me
vmc info

Note: If you are using a tunnel and selected a local port other than 80 you will need to modify the target to include it here, like api.vcap.me:8080.

This should produce roughly the following:

VMware's Cloud Application Platform
For support visit support@cloudfoundry.com

Target:   http://api.vcap.me (v0.999)
Client:   v0.3.10

Play around as a user, start with:

vmc register --email foo@bar.com --passwd password
vmc login --email foo@bar.com --passwd password

To see what else you can do try:

vmc help

Testing your setup

Once the system is installed, you can run the following command Basic System Validation Tests (BVT) to ensure that major functionality is working.

cd cloudfoundry/vcap
cd tests && bundle package; bundle install && cd ..
rake tests

Unit tests can also be run using the following.

cd cloud_controller
rake spec
cd ../dea
rake spec
cd ../router
rake spec
cd ../health_manager
rake spec

Step 6: you are done, make sure you can run a simple hello world app.

Create an empty directory for your test app (lets call it env), and enter it.

mkdir env && cd env

Cut and paste the following app into a ruby file (lets say env.rb):

require 'rubygems'
require 'sinatra'

get '/' do
  host = ENV['VMC_APP_HOST']
  port = ENV['VMC_APP_PORT']
  "<h1>XXXXX Hello from the Cloud! via: #{host}:#{port}</h1>"
end

get '/env' do
  res = ''
  ENV.each do |k, v|
    res << "#{k}: #{v}<br/>"
  end
  res
end

Create & push a 4 instance version of the test app, like so:

vmc push env --instances 4 --mem 64M --url env.vcap.me -n

Test it in the browser:

http://env.vcap.me

Note that hitting refresh will show a different port in each refresh reflecting the different active instances

Check the status of your app by running:

vmc apps

Which should yield the following output:

+-------------+----+---------+-------------+----------+
| Application | #  | Health  | URLS        | Services |
+-------------+----+---------+-------------+----------+
| env         | 1  | RUNNING | env.vcap.me |          |
+-------------+----+---------+-------------+----------+