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
- CloudFoundry
- installation: /home/virgo/cloudfoundry
- version/date: 28 July 2011
- Virgo 3.0.0.RC1
- Applications (Splash screen & Admin Console): /home/virgo/apps
Starting CloudFoundry
To start CloudFoundry you have to start a Terminal and issue:
cd ~/cloudfoundry/vcapTo check if the start was successful:
bin/vcap start
bin/vcap statusMore information and examples can be found in the CloudFoundry VCAP Readme.
Sample applications
To push (deploy) the Virgo default applications you can use the VMC client:
cd ~/apps
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 |
Supported artefacts
Currently supported artefacts:
- WAR file (defaults to Tomcat, so you'll have to change the framework to Virgo)
- PAR
- Plan
- Bundle (JAR)
- Combination of the mentioned artefacts
Multi-application solutions
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 :)
6 comments:
Hi,
Awesome tutorial. Will there be a tutorial explaining how the VM was set up?
cheers,
Muki
Thanks for this article. OSGi is a must-have for CF. Keep up the good work. Thank you.
How did you replace Tomcat? Any tutorial for that?
The new blog contains a link to the tutorial from EclipseCon
Thanks!!!! It is exactly what im looking for!
Do you have some updated VM?
How can I update Virgo?
You can use the virgo-setup from vcap-java project (https://github.com/hsiliev/vcap-java).
You'll have to modify the virgo_manifest.yml file.
Post a Comment