Cloud Foundry

Table of Contents

Table of Contents


Introduction

This tutorial covers deploying an ICEfaces application to Micro Cloud Foundry and Cloud Foundry. Cloud Foundry is described by VMware, Inc. as:

"Cloud Foundry is an open platform as a service, providing a choice of clouds, developer frameworks and application services. Initiated by VMware, with broad industry support, Cloud Foundry makes it faster and easier to build, test, deploy and scale applications. It is an open source project and is available through a variety of private cloud distributions and public cloud instances, including CloudFoundry.com."

Optionally, the developer can utilize Micro Cloud Foundry as well, which is described by VMware, Inc. as:

"Micro Cloud Foundry provides the VMware open platform as a service in a standalone environment running in a virtual machine. It is a self-contained local development environment as similar as possible to the Cloud Foundry cloud, making application development for the cloud and the transition from development to production much more seamless."



Legend

Terms Description
[micro-cloud-foundry-home] This is the user defined home directory in which the Micro Cloud Foundry VM is (to be) unpacked.
[icefaces-application-home] This is the user defined home directory in which the ICEfaces application is (to be) unpacked.

Requirements

This tutorial assumes the following requirements are met before continuing:

Note
Other VMware products can be used instead, like VMware Workstation or others, but this tutorial focuses on VMware Player.

Cloud Foundry

Creating a Domain

Using an Internet browser, in order create a domain follow these steps:

  • Log into https://my.cloudfoundry.com/micro using your credentials.
  • Enter the desired Domain Name and click on the Create button.
  • Save the configuration token for later use.
  • Click on the Download Micro Cloud Foundry VM button.
  • Select the desired location for "micro-1.x.x.zip" and download the VM.

Configuring the Micro Cloud Foundry VM

In order to configure the Mirco Cloud Foundry VM follow these steps:

  • Unpack the "micro-1.x.x.zip" into the [micro-cloud-foundry-home] directory.
  • Using VMware Player:
    • Navigate to File -> Open a Virtual Machine....
    • Navigate to the [micro-cloud-foundry-home] directory, select the "micro.vmx" file and click on the Open button.
    • Select the Micro Cloud Foundry v1.x.x virtual machine and click on the Play virtual machine link.
    • Enter "1" to configure and press [Enter] to continue.
    • Enter the desired Password and press [Enter] to continue.
    • Enter the desired Password again as the Confirmation and press [Enter] to continue.
    • Enter the desired network (e.g. "1" for DHCP) and press [Enter] to continue.
    • Enter the desired HTTP proxy and press [Enter] to continue.
    • Enter the _confirmation token (as saved earlier) and press [Enter] to continue.
    • Press [Enter] to continue.
    • Confirm that the status of Identity and Services is ok and that the status of IP Address is network up.

Deployment and Management

In order to deploy and manage ICEfaces applications VMware provides two Cloud Foundry tools:

Installing one or both is a requirement in order to deploy and manage ICEfaces applications using Cloud Foundry.

VMC (Command-Line Interface)

At the time this tutorial was written the requirements for installing VMC are:

  • Ruby (1.8.7 or 1.9.2)
  • RubyGems

The installation of Ruby and RubyGems is beyond the scope of this tutorial.

Installing VMC

Once the requirements are met the installation of VMC is simple. Using a command prompt or console, in order to install VMC use the following single-line command:

gem install vmc

Deployment using VMC

This section covers the deployment of an ICEfaces application to the Micro Cloud Foundry and the Cloud Foundry. The Micro Cloud Foundry can be used as a staging process during development before deploying to the public Cloud Foundry.

Micro Cloud Foundry
Configuring VMC for Micro Cloud Foundry
  • Target the Micro Cloud Foundry using the following single-line command where the {mycloud} placeholder needs to be replaced with the desired cloud name (e.g. "icesoft"):
    vmc target api.\{mycloud\}.cloudfoundry.me
  • Create a new account using the following single-line command:
    vmc register
  • Enter the desired Email and press [Enter] to continue.
  • Enter the desired Password and press [Enter] to continue.
  • Enter the desired Password again as the Verify Password and press [Enter] to continue.
Deploying an ICEfaces Application to Micro Cloud Foundry

In order to deploy an ICEfaces application using a command prompt or console follow these steps:

  • Navigate to the [icefaces-application-home] directory.
  • Deploy an ICEfaces application using the following single-line command:
    vmc push
  • Enter "Y" to the "Would you like to deploy from the current directory? [Yn]" question and press [Enter] to continue.
  • Enter the desired Application Name (e.g. "showcase") and press [Enter] to continue.
  • Enter "Y" to the "Detected a Java Web Application, is this correct? [Yn]" question and press [Enter] to continue.
  • Enter the desired Application Deployed URL (e.g. "showcase.icesoft.cloudfoundry.me") and press [Enter] to continue.
  • Enter the desired Memory reservation (e.g. "512M") and press [Enter] to continue.
  • Enter the desired number of instances (e.g. "1") and press [Enter] to continue.
  • Enter "N" to the "Create services to bind to '[application-name]'? [yN]" question and press [Enter] to continue.
  • Enter "N" to the "Would you like to save this configuration? [yN]" question and press [Enter] to continue.
  • Confirm the ICEfaces application is running correctly by going to http://[application-name].[hostname].cloudfoundry.me/ (e.g. http://showcase.icesoft.cloudfoundry.me/).
Cloud Foundry
Configuring VMC for Cloud Foundry
  • Target the Cloud Foundry using the following single-line command:
    vmc target api.cloudfoundry.com
  • Log into Cloud Foundry using the following single-line command:
    vmc login
  • Enter your Email and press [Enter] to continue.
  • Enter your Password and press [Enter] to continue.
Deploying an ICEfaces Application to Cloud Foundry

In order to deploy an ICEfaces application using a command prompt or console follow these steps:

  • Navigate to the [icefaces-application-home] directory.
  • Deploy an ICEfaces application using the following single-line command:
    vmc push
  • Enter "Y" to the "Would you like to deploy from the current directory? [Yn]" question and press [Enter] to continue.
  • Enter the desired Application Name (e.g. "showcase") and press [Enter] to continue.
  • Enter "Y" to the "Detected a Java Web Application, is this correct? [Yn]" question and press [Enter] to continue.
  • Enter the desired Application Deployed URL (e.g. "showcase.cloudfoundry.com") and press [Enter] to continue.
  • Enter the desired Memory reservation (e.g. "512M") and press [Enter] to continue.
  • Enter the desired number of instances (e.g. "1") and press [Enter] to continue.
  • Enter "N" to the "Create services to bind to '[application-name]'? [yN]" question and press [Enter] to continue.
  • Enter "N" to the "Would you like to save this configuration? [yN]" question and press [Enter] to continue.
  • Confirm the ICEfaces application is running correctly by going to http://[application-name].cloudfoundry.com/ (e.g. http://showcase.cloudfoundry.com/).

Cloud Foundry Extension to Eclipse (Graphical IDE)

At the time this tutorial was written the requirements for installing Cloud Foundry Integration are:

  • Eclipse

The installation of Eclipse is beyond the scope of this tutorial.

Installing Cloud Foundry Integration

  • Using the menu bar at the top, navigate to Help -> Eclipse Marketplace....
  • Using the Eclipse Marketplace pop-up window:
    • Enter "Cloud Foundry" as the Find and click on the Go button.
    • Click on the Install button of the Cloud Foundry Integration for Eclipse.
    • Confirm the selected features and click on the Next button.
    • Select the I accept the terms of the license agreements radio button and click on the Finish button.
  • Using the Software Updates pop-up window, click on the Restart Now button.

Deployment using Eclipse

This section covers the deployment of an ICEfaces application to the Micro Cloud Foundry and the Cloud Foundry. The Micro Cloud Foundry can be used as a staging process during development before deploying to the public Cloud Foundry.

Micro Cloud Foundry
Configuring Eclipse for Micro Cloud Foundry

In order to configure Eclipse for Micro Cloud Foundry follow these steps:

  • Using the menu bar at the top, navigate to Window -> Show View -> Servers.
  • Using the Servers tab at the bottom, right click and navigate to New -> Server.
  • Using the New Server pop-up window:
    • Select VMware -> Cloud Foundry as the server type, leave the Server's host name as "localhost", enter the desired Server name (e.g. "ICEsoft Micro Cloud Foundry"), and click on the Next button.
    • Enter your Email, enter your Password, select Microcloud - [http://api.]{mycloud}.cloudfoundry.me as the URL,
      • Using the Create Microcloud Target pop-up window, enter the desired {mycloud} replacement (e.g. "icesoft"), enter the desired name (e.g. "Microcloud (icesoft)"), and click on the OK button.
    • Click on the Validate Account button, verify the message at the top displays Account information is valid., and click on the Next button.
    • Click on the Finish button.
Deploying an ICEfaces Application to Micro Cloud Foundry

In order to deploy an ICEfaces application to Micro Cloud Foundry follow these steps:

  • Using the menu bar at the top, navigate to Window -> Show View -> Servers.
  • Drag an ICEfaces application from the Project Explorer panel on the left to the desired Micro Cloud Foundry (e.g. "ICEsoft Micro Cloud Foundry") on the Servers tab at the bottom.
  • Using the Application pop-up window:
    • Enter the desired Name (e.g. "showcase"), select Java Web as the Application Type, and click on the Next button.
    • Enter the desired Deployed URL (e.g. "showcase.icesoft.cloudfoundry.me"), select the desired Memory Reservation (e.g. 512M (Default)), and click on the Next button.
    • Click on the Finish button.
Cloud Foundry
Configuring Eclipse for Cloud Foundry

In order to configure Eclipse for Cloud Foundry follow these steps:

  • Using the menu bar at the top, navigate to Window -> Show View -> Servers.
  • Using the Servers tab at the bottom, right click and navigate to New -> Server.
  • Using the New Server pop-up window:
    • Select VMware -> Cloud Foundry as the server type, leave the Server's host name as "localhost", enter the desired Server name (e.g. "VMware Cloud Foundry"), and click on the Next button.
    • Enter your Email, enter your Password, select VMware Cloud Foundry - https://api.cloudfoundry.com_ as the _URL, click on the Validate Account button, verify the message at the top displays Account information is valid., and click on the Next button.
    • Click on the Finish button.
Deploying an ICEfaces Application to Cloud Foundry

In order to deploy an ICEfaces application to Cloud Foundry follow these steps:

  • Using the menu bar at the top, navigate to Window -> Show View -> Servers.
  • Drag an ICEfaces application from the Project Explorer panel on the left to the desired Cloud Foundry (e.g. "VMware Cloud Foundry") on the Servers tab at the bottom.
  • Using the Application pop-up window:
    • Enter the desired Name (e.g. "showcase"), select Java Web as the Application Type, and click on the Next button.
    • Enter the desired Deployed URL (e.g. "showcase.cloudfoundry.com"), select the desired Memory Reservation (e.g. 512M (Default)), and click on the Next button.
    • Click on the Finish button.

External Links

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2018 ICEsoft Technologies Canada Corp.