Cloud Foundry

Cloud Foundry Welcomes .NET Framework Community Contributions

This week two Seattle-based companies, Tier3 and Uhuru Software, contributed .NET Framework support to the Cloud Foundry community.  Cloud Foundry was designed from the outset to support multiple developer frameworks and the new .NET supports adds to community created support for Erlang, Haskell, PHP, Python and other developer frameworks.  We are excited to welcome these contributors to the Cloud Foundry open source community and look forward to .NET developers joining the open platform as a service movement.  
 
As with previous framework contributions, developers will now be able to use the familiar Cloud Foundry semantics to deploy and scale their .NET applications, just as they would with any other supported framework.
 
How It Works
 
Unlike other frameworks supported by Cloud Foundry, .NET requires a Windows based Cloud Foundry “Execution Agents” (DEA) running an IIS web server. An important part of the newly available open source code is support for Windows-based DEAs.  Note that this implementation requires customers to bring their own Windows licenses for each Windows-based DEA.  Cloud Foundry itself continues to run on Linux and does not require Windows licenses, but manages the Windows-based DEAs as it does with any other DEA.  
 
.NET developers can access any application service or data store within the Cloud Foundry system, and support for Windows-based DEAs also opens the door for Windows-based applications services such as Microsoft’s SQL Server database.  The end result is enterprise customers will have a common model for deploying and scaling both Java and .NET applications, as well as the newer frameworks supported by Cloud Foundry.
 
The contributors are also working on Visual Studio add-ons and MMC snap-ins that allow .NET developers and Windows administrators to harness Cloud Foundry using the tools they already know.
 
The Contributors
 
Tier3 is a VMware-partnered hybrid and private cloud service provider to enterprises and the mid-market, with a special focus on .NET and Windows solutions . They currently have a free hosted trial of their .NET support for Cloud Foundry available.
 
Uhuru Software is a Redmond-based software start-up founded by former Microsoft executives and engineers. They are coming out of stealth mode today and are focused on building .NET solutions for enterprises and will offer support to enterprise customers for .NET on Cloud Foundry.
 
Integration into Cloud Foundry
 
We encourage everyone to try out the newly contributed .NET support and provide feedback. Over the coming weeks we will embark on a testing and integration cycle to bring the best of the submitted code into the main Cloud Foundry project so the community can work together to deliver outstanding .NET support for Cloud Foundry.  
 
Additional information
Tier3:
Uhuru:

- The Cloud Foundry Team

Don’t have a Cloud Foundry account yet? Signup for free today

Cloud Foundry Ready for Spring 3.1 and Grails 2.0

The Spring and Grails engineers have been hard at work creating major updates to their frameworks: Spring 3.1 and Grails 2.0. Working closely with each team, Cloud Foundry™ is happy to announce support for both frameworks in CloudFoundry.com and Micro Cloud Foundry™ as soon as they become generally available.

In its new Spring 3.1 release, the Spring Framework provides a versatile open source platform for Java-based applications. The key features in Spring 3.1 include environment profiles (including cloud profiles used by Cloud Foundry), Java-based application configuration, declarative caching and Servlet 3.0 support. The announcement by Juergen Hoeller gives all the details of Spring 3.1’s capabilities and a new webinar on January 19th (Europe, North America) will discuss how to use Spring for cloud computing, HTML 5 applications, and the future of enterprise Java application architecture.

The forthcoming Grails 2.0 provides an important evolution of the popular Groovy- based productivity framework. The new release will provide an interactive command line, new unit testing capabilities covering in-memory GORM and full REST testing, an updated resource plug-in to improve web content modularity, database migration tools, and substantial GORM improvements. The Grails plugin for Cloud Foundry makes it easy to put your applications into the cloud and developers can learn all the details in the Better Productivity: Grails 2.0 video.

So congratulations to the Spring and Grails engineers on the important updates to their immensely popular projects. The Cloud Foundry team will continue to work hard to ensure that CloudFoundry.com and Micro Cloud Foundry provide first class support and the best developer experience to these two incredibly productive application frameworks.

- The Cloud Foundry Team

Don’t have a Cloud Foundry account yet? Signup for free today


Deploy to any Cloud Foundry target with eXo Cloud IDE

The free eXo Cloud IDE now supports Cloud Foundry deployments including Cloudfoundry.com, Micro Cloud Foundry, and any other VMC compatible instance. It is now faster and easier for developers to deploy applications to any Cloud Foundry deployment target—all directly within the eXo IDE. eXo is a hosted development environment where teams can collaboratively build HTML5/JavaScript apps or Java, PHP, and Ruby web apps. 

How Does It Work?

First let’s look at a sample Spring project. A very simple Hello World app which can be found on the Cloud Foundry GitHub repository is an easy sample app to start with (https://github.com/cloudfoundry-samples/spring-hello-env). To begin, create a new folder and clone the GitHub project (Git > Clone Repository…).

Alternatively, you can start from the sample Spring project from the IDE (File > New > Sample Spring Project…).

Then, in the PaaS menu, you can go to Cloud Foundry > Create Application. This is where you configure your deployment options for your application. Start by choosing your Cloud Foundry target by specifying the API endpoint.

You can leave the application type as Autodetect and click the Create button. Enter your Cloud Foundry credentials and your Spring application will start building in the cloud. Since the apps are built on a public Jenkins server, you might have to wait for your turn and this might take a few minutes. Once your application is deployed you can easily manage it from the Application panel (PaaS > Cloud Foundry > Applications) and browse between your different servers.

And that’s it! Check out the demo video to learn more. You can let us know what you think about this new service by Tweeting us at @cloudfoundry.

- The Cloud Foundry Team

Don’t have a Cloud Foundry account yet? Signup for free today

Now You Can Tunnel into Any Cloud Foundry Data Service

Cloud Foundry now enables developers to open a tunnel to any Cloud Foundry data service via a local port. Now you can use familiar client applications to directly analyze, manipulate, or port the data contained in the data services that are bound to your Cloud Foundry applications. This solution is ideal for importing and exporting data when moving application between different clouds running Cloud Foundry (e.g. CloudFoundry.com and Micro Cloud Foundry), for debugging during development, as well as ad-hoc queries and modification to data in a deployed application.

This new feature is made available with a preview release of Cloud Foundry command line tool (‘VMC’). Underlying it is a simple Ruby application, named Caldecott (after the Caldecott Tunnel in California), that gets deployed to your CloudFoundry.com account to connect to services in your account. Caldecott is currently being provided as a preview, as the team is working on making it more robust and performant in the coming weeks. Caldecott provides an HTTP endpoint that facilitate a port forward on your local box. VMC contains built in scripts to run some of the popular client software in the local environment and automatically connect to specified services, or simply create the connection to the service for you to connect using any client software of your choice. Let’s take a look at how this works.

First, install or update your Cloud Foundry command line tool (‘VMC’) to the latest preview version using the following command:

gem install vmc --pre

You can verify that you got the right version using:

vmc -v

which should show the version to be 0.3.14.beta.4 or higher.

You also need the caldecott gem, which you can install using:

gem install caldecott

Note that currently the caldecott gem requires the ‘eventmachine’ gem, which in turn requires native compilation. We are working to simplify this.

The first step is to make sure that you are targeting the Cloud Foundry instance that you want to connect to and log in.  See “Getting Started Guide - Command Line (VMC) users” if you are unfamiliar with VMC.

Next, review all of the services that you have:

vmc services

Under the Provisioned Services section, you will see all of the services that you have created.  For example, here’s an output of my services:

=========== Provisioned Services ============
 
    +------------------+------------+
    | Name             | Service    |
    +------------------+------------+
    | mongodb-12345    | mongodb    |
    | mysql-12345      | mysql      |
    | postgresql-12345 | postgresql |
    | redis-12345      | redis      |
    +------------------+------------+

Now, you can connect to any service listed through a simple command:

vmc tunnel <servicename> [--port]

The port is an optional parameter that allows you to define a specific port number that you want. By default, VMC will automatically select an available port in the 10000 range. The service name parameter is also optional, you can interactively select the service from a list to establish the connection by using the command without any parameters.

vmc tunnel

As an example, let’s connect to the PostgreSQL service in the list above by typing the following command:

 vmc tunnel postgresql-12345

VMC will first determine if an existing Caldecott application instance has been deployed, if not, it will deploy a new one.

Trying to deploy Application: 'caldecott'.
    Create a password: 

Whenever you create a tunnel, you will be prompted for a password. You will need to furnish a new password initially for the first time the application is deployed, so that VMC can secure future connections to the Caldecott application instance. For additional service connections, you will have to supply the same password that was originally created for security. Following the password creation, you should see the following progress output.

Uploading Application:
 Checking for available resources: OK
 Processing resources: OK
 Packing application: OK
 Uploading (1K): OK
Push Status: OK
Binding Service [postgresql-12345]: OK
Staging Application: OK
Starting Application: OK
Getting tunnel connection info: .OK

You can see that VMC is uploading and starting the Caldecott application and binding the specified service to that application instance. In successive VMC tunnel command calls, it will not be necessary to create a new application instance. Instead, the existing instance will be stopped, the specified service will be bound to the application, and then the same Caldecott application will get restarted.

The next section of the output will display the credentials necessary to connect to the service. These credentials were originally automatically generated by the Cloud Controller when provisioning the service for you. These are the credentials that Cloud Foundry’s staging code will automatically insert into your application’s configurations to connect to the service.

Service connection info:
 username : ua76003139485469989d57b22f9cb83xx
 password : p8214ebd2a7254698913e01c86a4432xx
 name : da281fa2162f947028876d0500ae31cxx

In the case of a database service, the username and password are displayed, along with the database name. Lastly, when the tunnel is established, VMC will offer to start a known client that exists in your execution path or allow you to connect to the local port with your choice of client application.

For the Postgres example, the following prompt is displayed:

Starting tunnel to postgresql-12345 on port 10000.
1: none
2: psql
What client would you like to start?: 

Enter 1 to connect with your own client application and the previously displayed credentials, or 2 to automatically start the client application and pass in the credentials. If you choose the latter, VMC will start the client automatically (in this case psql).

What client would you like to start?: 2
Launching 'PGPASSWORD='p8214ebd2a7254698913e01c86a4432xx' psql -h localhost -p 10001 -d da281fa2162f947028876d0500ae31cxx -U ua76003139485469989d57b22f9cb83xx -w'
  
psql (9.0.4)
Type "help" for help.
da281fa2162f947028876d0500ae31cxx=> \d
                     List of relations
 Schema | Name  | Type  |               Owner               
--------+-------+-------+-----------------------------------
 public | hotel | table | ua76003139485469989d57b22f9cb83xx

da281fa2162f947028876d0500ae31cxx> select * from hotel; 
  1 | 3555 S. Ocean Drive                    | Hollywood           | USA           | Westin Diplomat                | 199.00 | FL        | 33019
  2 | 890 Palm Bay Rd NE                     | Palm Bay            | USA           | Jameson Inn                    |  60.00 | FL        | 32905
  3 | The Cottage, Southampton Business Park | Southampton         | UK            | Chilworth Manor                | 199.00 | Hants     | SO16 7JF 
...

Alternatively, you can supply the desired client to execute at the invocation of the tunnel command to bypass the prompt:

vmc tunnel postgresql-12345 psql

That’s it, at this point, you can choose to view, modify, or export the data from your service. 

Caldecott is currently a preview software, and we are working hard to improve it. Please feel free to send us any feedback via the Cloud Foundry Support Forums

- The Cloud Foundry Team

Don’t have a Cloud Foundry account yet? Signup for free today

Cloud Foundry Welcomes Joyent as Community Lead for Node.js

Cloud Foundry has supported Node.js from day one.  Today we are delighted to announce Joyent will become the Cloud Foundry Community Lead for Node.js.  Community Leads bring deep experience and passion for specific technologies to Cloud Foundry.  Joyent will contribute and maintain Node.js support for Cloud Foundry, providing ongoing updates, direction and community engagement.

As the open source project owner and home to Node’s core team, Joyent has invested heavily in making Node the leading runtime for data-intensive real-time mobile and web applications for the individual developer and the enterprise. Node is also interwoven throughout Joyent’s own operating system (SmartOS) and SmartDataCenter cloud orchestration software to enable powerful real-time tools such as Cloud Analytics.  

Joyent has already offered some preliminary plans for improving and expanding Node.js support on Cloud Foundry in their blog.

We’re excited about what this means for Node.js support on Cloud Foundry going forward.  

If you haven’t signed up for Cloud Foundry and want an easy way to try out Node.js, you can register here.

- The Cloud Foundry Team


Cloud Foundry previews new features at SpringOne 2GX

The Cloud Foundry team has been interacting with hundreds of Spring, Groovy, and Grails developers and architects at SpringOne 2GX.  At the show we previewed and introduced several new technologies on top of our Open Platform as a Service offering and have been getting great feedback.  For those of you that don’t know, SpringOne 2GX is the premier event for Spring, Groovy, and Grails application development and runtime technologies with tons of deep technical content delivered by the top experts in the industry, including some of our very own.

Cloud Foundry presented its own track at SpringOne 2GX this year, and we have been busy showing off some of the latest developments with Cloud Foundry.  Some of these developments include introductions and previews of these exciting new technologies:

  • Spring features: auto-reconfiguration mechanism that allows applications to automatically bind to Cloud Foundry Services without any modifications. The use of the “cloud” namespace and profiles gives applications explicit control over consuming Cloud Foundry Services and requires no modification to run locally. 
  • VCC/”Caldecott” : Allows users to attach to Cloud Foundry Services and control them as if they are running locally.  An example that was demoed was exporting a vFabric Postgres Table and importing it into another vFabric Postgres instance.
  • Java Remote Debugging : Giving Java Developers the ability to debug applications running in a local instance of Cloud Foundry through the Spring STS IDE.  This included setting breakpoint in live code, making changes to variables, and then continuing the application while it was running in their local Cloud Foundry instance.  This is available in the open source repository and can be enabled for local instances of Cloud Foundry (VCAP).
  • Spring Insight : Providing real-time application runtime performance and behavior information for Java Spring applications running on CloudFoundry.com.

Some of the conference attendees really impressed us by showing some really cool applications that were developed and deployed to Micro Cloud Foundry and CloudFoundry.com in just minutes.  In addition to the great technology previews, there has been a lot of excitement around being able to deploy applications on Micro Cloud Foundry and then to CloudFoundy.com with no coding changes.  Combined with the upcoming effort to allow for provisioning of private Cloud Foundry instances behind the firewall, developers are recognizing Cloud Foundry as their de facto PaaS deployment solution.

Build and Extend Custom SuccessFactors Applications on Cloud Foundry

SuccessFactors has selected Cloud Foundry as the platform to empower its customers to build and extend custom applications around SuccessFactors.  A leading SaaS company that provides business execution capabilities for over 3,500 organizations with around 15 million employees, SuccessFactors chose Cloud Foundry for the flexibility and choice it provides their customers in development frameworks, applications services and clouds for deployment.

The need to customize, extend and integrate enterprise applications is a common one.  Doing this for SaaS applications brings particular challenges, as those applications run remotely and historically have been limited in terms of programmability.  By bringing together Cloud Foundry’s robust runtime capabilities with SuccessFactor’ business processes and data, developers get the best of both worlds.

SuccessFactors has deployed a simple sample application (http://sfsf.cloudfoundry.com) that gives a sense of what is possible. The application integrates SuccessFactors’ employee location data with Google Maps to calculate the impact of a facilities move.  If you are a SuccessFactors customer or partner, you can use the SFAPI to do your own integration.  Over time, you can expect the two companies to deepen the integration and in particular make it even easier for enterprises to extend SuccessFactors from both public and private clouds.  To find out more about this partnership, please visit http://www.successfactors.com/info/en/vmware-cloud-foundry.

Micro Cloud Foundry™ — Now With PostgreSQL and RabbitMQ

We just released an update for Micro Cloud Foundry with PostgreSQL and RabbitMQ.  Micro Cloud Foundry  is a complete version of Cloud Foundry that runs in a virtual machine on a developer’s Mac or PC.  Today, vFabric Postgres, a version of PostgresSQL database optimized for the virtualized cloud environment, and RabbitMQ, a reliable, scalable and portable messaging system, are both available with Micro Cloud Foundry.

Developers can now quickly develop and test applications with RabbitMQ as its messaging solution and/or PostgresSQL as its data store solution, on their local machine before deploying and scaling to the cloud.

vFabric Postgres and RabbitMQ are available as part of a new update for Micro Cloud Foundry, available for download today at http://micro.cloudfoundry.com

In the following blog post, we will walk through two simple examples of how to run a Java Spring application using Postgres and a Spring AMQP calculation demo using RabbitMQ on your Micro Cloud Foundry.

First, you will need a CloudFoundry.com account, if you don’t have one yet, please signup here.

Next, you will need to download the new update for Micro Cloud Foundry (version “1.1”)

Login to Micro Cloud Foundry (using your CloudFoundry.com credentials) and download the new “micro-1.1.0” VM.  

You will also need to create/ regenerate your domain token.

Please note that you cannot upgrade from the previous version of Micro Cloud Foundry to the new one. For more information on getting started with Micro Cloud Foundry, please read the following blog post.

 

Postgres and  Micro Cloud Foundry

Postgres on Micro Cloud Foundry enables developers to build, test and deploy applications on their laptop while leveraging a robust and reliable PostgreSQL relational database. As Micro Cloud Foundry and CloudFoundry.com both include the vFabric Postgres service, the same application can be deployed on CloudFoundry.com without any code changes while leveraging  increased database capacity.

Once you have the updated Micro Cloud Foundry installed, you can check the status of Postgres using option 7 in the menu.


 

Steps to create a Java Spring App using Postgres

Now lets look at steps to create and run a Guestbook application on Micro Cloud Foundry, then deploy to Cloud Foundry. For detailed instructions and code for writing the Spring app (steps 1-8), please see the support article

1. Create a Maven Web Project

2. Add dependency on the Spring framework and automatically download all required java package from Maven repository using pom.xml

3. Define entity class to store objects in a database using JPA

4. Configure JPA by setting a META-INF/persistence.xml file

5. Define a Spring DAO Component: Operations on the database will be performed by an instance of a Data Access Object (DAO) that we will define in this step as a Spring MVC

6. Add a Spring Controller Class to manage guestbook web requests

7. Add a JSP page

8. Integrate the Spring Framework into the web application by adding the definition of the Spring dispatcher servlet to the web.xml configuration file and configuring that servlet using another xml configuration file.

The settings above guides Spring to support annotations (for components, controllers and transactions), to inject a JPA EntityManager, to manage transactions and to look for JSP pages in the WEB-INF directory.

9. Build the project and deploy to Micro Cloud Foundry

Open a command prompt (Windows) or terminal (Linux) and “cd” to the location of the Guest project in the Eclipse workspace. Type command “mvn package” to generate war file Guestbook.war

$mvn package

[...]

[INFO] ---------------------------

[INFO] BUILD SUCCESSFUL

[INFO] ---------------------------

[INFO] Total time: 3 seconds

[INFO] Finished at: Mon Aug 08 23:59:32 GMT-08:00 2011

[INFO] Final Memory: 31M/428M

[INFO] ---------------------------

Now we are ready to push the application to Micro Cloud Foundry. Change to the target directory before doing vmc push. Here, we will call the application “‘guestbook”

$vmc push

Would you like to deploy from the current directory? [Yn]: y

Application Name: guestbook

Application Deployed URL: 'guestbook.yourcloud.cloudfoundry.me'?

Detected a Java SpringSource Spring Application, is this correct? [Yn]: y

Memory Reservation [Default:512M] (64M, 128M, 256M or 512M)

Creating Application: OK

Would you like to bind any services to 'guestbook'? [yN]: y

Would you like to use an existing provisioned service [yN]? n

The following system services are available::

1. mongodb

2. mysql

3. postgresql

4. redis

Please select one you wish to provision: 3

Specify the name of the service [postgresql-9a305]: guestbook

Creating Service: OK

Binding Service: OK

Uploading Application:

  Checking for available resources: OK

  Processing resources: OK

  Packing application: OK

  Uploading (9M): OK  

Push Status: OK

Staging Application: OK                                                        

Starting Application: OK

Now your application is running inside the Micro Cloud Foundry! Use “vmc services”, “vmc apps” commands to retrieve service and application information.

Go to http://guestbook.yourcloud.cloudfoundry.me and see the web page:

Type anything you want and click on “Add’, what you just type will appear in the page, stored in your local PostgreSQL database.

Deploy to CloudFoundry.com with zero change

Now it’s time to deploy this application to CloudFoundry.com public PaaS service and see how the application works without any change in code and configuration!

First, use vmc target command to point to Cloud Foundry:

$vmc target api.cloudfoundry.com

Successfully targeted to [http://api.cloudfoundry.com]

$vmc login

Email: [Your Cloud Foundry email]

Password: [Your Cloud Foundry password]

Successfully logged into [http://api.cloudfoundry.com]

Use the same vmc push command used above to deploy the application:

$vmc push

Would you like to deploy from the current directory? [Yn]: y

Application Name: guestbook-mycloud

Application Deployed URL: 'guestbook-mycloud.cloudfoundry.com'?

Detected a Java SpringSource Spring Application, is this correct? [Yn]: y

Memory Reservation [Default:512M] (64M, 128M, 256M or 512M)

Creating Application: OK

Would you like to bind any services to 'guestbook-postgresql'? [yN]: y

Would you like to use an existing provisioned service [yN]? n

The following system services are available::

1. mongodb

2. mysql

3. postgresql

4. rabbitmq

5. redis

Please select one you wish to provision: 3

Specify the name of the service [postgresql-a9x55]: guestbook

Creating Service: OK

Binding Service: OK

Uploading Application:

  Checking for available resources: OK

  Processing resources: OK

  Packing application: OK

  Uploading (9M): OK  

Push Status: OK

Staging Application: OK                                                        

Starting Application: OK

The application behaves exactly the same as in Micro Cloud Foundry, and stores input data into the Postgres database instance running on CloudFoundry.com.

To learn more on Postgres and Cloud Foundry, please read the following blog post, tutorials and FAQ.

RabbitMQ and Micro Cloud Foundry

RabbitMQ on Micro Cloud Foundry enables developers to build, test and deploy applications on their laptop while leveraging a reliable, scalable and portable RabbitMQ messaging system, without the need to set up Rabbit locally.

As Micro Cloud Foundry and CloudFoundry.com both include  RabbitMQ, the same application can be scaled up on CloudFoundry.com without any code changes: just use the vmc command line to add workers.

See above for how to download and configure Micro Cloud Foundry 1.1. Once you have done that, if you press 7 in the Micro Cloud Foundry console, to get the service status, you will see the RabbitMQ services listed.


The Spring AMQP π Calculation Demo for CloudFoundry sample works out of the box on your local machine: it is an adaptation of Jonas Bonér’s excellent  Akka Getting Started Tutorial that calculates the value of π but using RabbitMQ worker queues instead of Actors.

It relies on the Leibniz formula for π, which has the advantage of lending itself to easy parallelization:

In the sample, you use a picalc-master application that creates n tasks in Rabbit, and p instances of the picalc-worker application that pull the calculations tasks from a Rabbit queue and push results there, to be accumulated by the master.

This is what it looks like on a recent MacBook Pro with n=5000 and p=3.


Simply follow the instructions in the README, targeting vmc and your browser to yourcloud.cloudfoundry.com, if you are using DynDNS, or vcap.me if you have configured Micro Cloud Foundry to work offline.

One aspect that is different when working locally vs in the cloud is that the local VM has a limited amount of RAM, so the number of worker instances you can launch locally is limited. You may want to try out the sample with 2 or 3 workers instead of 4, because currently Micro Cloud Foundry does not use more than 1Gb RAM, even if you configure the VM with more capacity.


With the new release of Micro Cloud Foundry, you can try out your Cloud Foundry applications on your laptop, without having to install your Postgres or RabbitMQ Cloud Foundry services.  

If you have any questions or problems, please contact us at http://support.cloudfoundry.com

- The Cloud Foundry Team

Don’t have a Cloud Foundry account yet? Signup for free today

Using Chef to Customize Multi-Node Cloud Foundry Deployments

A key aspect of Cloud Foundry open PaaS is the ability to run everywhere using open-source tools that developers and operations can review and modify to suit their needs.  Today we are releasing a simplified scheme for provisioning Cloud Foundry multi-node environments.  By combing the ease-of-use of Chef recipes and the open architecture of Cloud Foundry, developers,  admins and “DevOps” are now able to easily and consistently provision a customized multi-node Cloud Foundry environment that will suit their particular requirements.

Chef is a well-known open-source configuration manager that is used to install and configure software packages in a repeatable way.

By rewriting much of the open source Cloud Foundry’s (VCAP) provisioning scripts in Chef recipes, we can leverage the instant familiarity of the tooling with a large community of users and contributors to make customizing Cloud Foundry deployments more accessible.  Being able to customize the Cloud Foundry environment is necessary if you are trying to design a multiple node or host environment to suit your particular requirements.

The set of deployment tools released today, are in “alpha” stage.  We wanted to get them out to the community as quickly as possible to invite users to experiment, validate, and contribute to this effort.  Everything you need is located in the Git hub repository under vcap/dev_setup (https://github.com/cloudfoundry/vcap/tree/master/dev_setup).  The tools assume that they are running a clean Ubuntu 10.04 server, which means that they will work no matter if your servers are running in a cloud, virtualized environment, or physical datacenter.  They also allow you to deploy and setup Cloud Foundry in single or multiple node environments.

In this blog post we will walk through some of the steps involved in this deployment process.  Please note that we are only highlighting the major steps.  To get detailed instructions and a step-by-step guide, you should read the KB article located on our support site: Single/Multi Node VCAP Deployment using Chef.  Additionally, the source code repository also has a README that has some quick start steps.  

To get started, you will need a copy of the setup tools from the source repository: https://github.com/cloudfoundry/vcap/tree/master/dev_setup.  We currently only support the Chef Solo scheme, so you will need to have a copy of these scripts on every server used in your Cloud Foundry environment.  One important note here is that since you are only starting with the cookbooks, part of the process will involve an automatic downloading of the full Cloud Foundry source code repository and that certain components will be compiled during this time.  The benefit of this model is that you are guaranteed to be up-to-date on the latest Cloud Foundry source.  There are options to deploy existing source code that you have previously downloaded or modified.

The installer executable is vcap_dev_setup in the bin directory.  By running the script with default values, it will provision everything on the current server, creating a single node installation.  To see this in action, simply run the script:

$ bin/vcap_dev_setup

However, vcap_dev_setup has a number of options, you can type ‘-h’ as a parameter and see the following help text:

OPTIONS:
 -h Show this message
 -a Answer yes to all questions
 -p http proxy i.e. -p http://username:password@host:port
 -c deployment config
 -d cloudfoundry home
 -r cloud foundry repo

The most interesting option is the deployment config, which allows you to specify a config file to pass into vcap_dev_setup.  The config files are written in yml, so they are simple to decipher.  For example, the default config, deployments/devbox.yml, to install everything is as follows:

---
deployment:
  name: "devbox"
jobs:
  install:
    - all

The content is fairly obvious.  This config file names the node, devbox, and specifies an installation job that installs all components.  This creates a single node installation of Cloud Foundry.  To specify this installation, type the following:

$ bin/vcap_dev_setup -c deployments/devbox.yml

Once Cloud Foundry has finished installing, then you can start this node with the vcap_dev script using the node name.

$ bin/vcap_dev -n devbox start

The script supports start, stop, and other commands.  Again, please reference the KB article for details on the specific commands you can run.

There are other sample config files that can be found in the repository under deployments/sample directory.  Each directory has a set of config files that comprise of the environment named, such as customized runtimes or multi-node services.  For example, in the multihost_redis directory, there are four config files:

  • dea.yml
  • redis0.yml
  • redis1.yml
  • rest.yml

In a multi-node setup, there should be a unique config file to be deployed on a host.  In this case, we are setting up a multi-node environment with two dedicated Redis nodes.  Two of these files are named redisN.yml.  Each of these files is expected to be used on a node intended to be a redundant Redis service provider for the Cloud Foundry environment.  Here is the content of redis0.yml. 

---
deployment:
  name: "redis0"
jobs:
  install:
    - redis:
        index: "0"
  installed:
    - nats_server:
        host: "172.31.4.13"

Under ‘install’, you can see that the config file specifies Redis as the only component to be installed.  The ‘installed’ section is specifying a previously installed component, the NATS server in this case, which allows the nodes to communicate via a message bus.  Compare this with rest.yml, which is the main host in the environment running the Cloud Controller and NATS server. 

---
deployment:
  name: "rest"
jobs:
  install:
    - nats_server
    - cloud_controller:
        builtin_services:
          - redis
          - mongodb
          - mysql
    - router
    - health_manager
    - redis_gateway
    - ccdb
    - mysql:
        index: "0"
    - mysql_gateway
    - mongodb_gateway
    - mongodb:
        index: "0"

As we can see here, many more components are being installed on the node named ‘rest’.  This config file shows a majority of the available install jobs.  However, to see more details regarding what to specify in a config file, take a look at the README file at deployments/README.

There are some caveats here.  The following components must run on the same node and limited to only a single instance:

  •  Cloud Controller
  • Health Manager
  • Service Gateways

However, the following components support multiple instances: 

  •  DEA
  •  Service Nodes (i.e. MySQL, Redis and MongoDB)

To learn more about the functionality of the above Cloud Foundry components, please refer to the following blog post: How Cloud Foundry works when a new Application is Deployed.

Once the nodes have been provisioned, then you can start the Cloud Foundry services on each of the nodes using vcap_dev.  There are other examples.  The easiest way to get started on your multi-host setup is to start customizing the various example config files that exist in the samples directory.

While the Chef cookbooks are incomplete with respect to complete support for all Cloud Foundry components (Rabbit and Postgres services are not currently available), we would like to encourage you to put the deployment scheme through its paces and provide us with feedback.  Over time, we intend on standardizing on the Chef cookbooks as the default scheme for customizing Cloud Foundry instances for single and multiple hosts.

- The Cloud Foundry Team

Rapid Cloud Foundry Deployments with Maven

Apache Maven is a very popular choice in the Java community for building and deploying applications. 

Today, we announce the release of the Cloud Foundry Maven Plugin.

Developers can now easily integrate cloud deployments into their Maven projects’ lifecycle,  manage application pushes and updates to any Cloud Foundry instance.

Further, this plugin provides an easier way to deploy applications from continuous integration servers such as Hudson and Jenkins.

Cloud Foundry Maven Plugin highlights:

   Deploy (Push) Maven based projects to Cloud Foundry

   Undeploy Maven based projects from Cloud Foundry

   Redeploy (Update) Maven based Cloud Foundry projects

More details are available in the Spring Source Blog.

Don’t have a Cloud Foundry account yet? Signup for free today

- The Cloud Foundry Team