If you wanted to try your OSGi based applications in the cloud you can now do so with Eclipse Virgo and CloudFoundry using a VM image.
What you will need:
- Oracle VirtualBox 4
- Computer with at least 4GB RAM
- Virgo & CloudFoundry image
- 7Zip (LZMA) un-archiver
The image comes with pre-installed Ubuntu 11.04 and has:
- User / Password: virgo / cloudfoundry
- installation: /home/virgo/cloudfoundry
- version/date: 28 July 2011
- Virgo 3.0.0.RC1
- Applications (Splash screen & Admin Console): /home/virgo/apps
To start CloudFoundry you have to start a Terminal and issue:
cd ~/cloudfoundry/vcapTo check if the start was successful:
bin/vcap statusMore information and examples can be found in the CloudFoundry VCAP Readme.
To push (deploy) the Virgo default applications you can use the VMC client:
vmc push virgo
where "virgo" is the name of the application we want to have running on CloudFoundry. You will have to confirm the name, URL, memory reservation and that the default applications do not use services.
As next step you can request the application at http://virgo.vcap.me. This should bring the default splash screen of Virgo with a link to the Admin Console.
Your own applications
Perhaps you will want to try your own application as well. To do this you will have to:
- create a directory
- copy your stuff inside
- push the content with "vmc push"
There are some extras here. If you create "repository" directory inside your application's directory then the content of this repository will be copied in Virgo's repository.
|Virgo on CloudFoundry|
Currently supported artefacts:
- WAR file (defaults to Tomcat, so you'll have to change the framework to Virgo)
- Bundle (JAR)
- Combination of the mentioned artefacts
The last option provides you with the ability to have more than one artefact in your solution. All these are pushed to CloudFoundry and used in Virgo.
As an example you may have several interconnected but relatively independent applications: PAR representing some back-end, WAR that provides the end-user UI and some more artefacts (as much as you need) that can represent editors or administration logic.
Everything can run on one Virgo server for testing/development, but you may decide to create several instances of a certain component to scale out that part of your solution. All that provided that your applications are written with scalability and cloud computing in mind of course.
Where's the source code?
At the time of this writing the changes made to CloudFoundry are not final and therefore no pull request is created, but I'm up to this.
You can find the source in GitHub if you want to play with it or just check how/if it works in your case :)