Code Climate
We are using Code Climate to check the quality of the Ruby code in our Cloud Foundry Java buildpack. It's an excellent tool, but some improvements would really help.
We are using Code Climate to check the quality of the Ruby code in our Cloud Foundry Java buildpack. It's an excellent tool, but some improvements would really help.
Posted by
Glyn
at
8:54 AM
1 comments
The recent Virgo community survey showed quite a bit of interest in running Virgo in the cloud. With CloudFoundry's forthcoming "buildpack" support, this was relatively easy to achieve.
A Virgo buildpack is available on github - see the README for detailed information. It currently supports two types of application: web applications or "overlays". A web application may be a standard WAR file or an OSGi Web Application Bundle. An overlay is a pair of directories -- pickup for the application(s) to be deployed and repository/usr for any additional dependencies not already provided by Virgo -- which are placed in an instance of Virgo Server for Apache Tomcat.
The support for buildpacks should ship later this month - see the CloudFoundry roadmap.
Posted by
Glyn
at
4:55 PM
0
comments
Labels: cloud, CloudFoundry, OSGi, Virgo
Thanks to the ninety-seven people who filled in the Virgo survey. The survey is now closed and the results are in. I'll summarise the results here, but the raw data (in Open Document Spreadsheet format) are available for anyone who wants more detail.
88% of respondents are on Virgo 3.5.0 or later while only 5% are still using SpringSource dm Server.
Posted by
Glyn
at
4:18 PM
0
comments
Neil Bartlett's blog of this title is shocking because it shows how slow to adopt proven technology the computing industry is.
David Parnas wrote his seminal paper "On the Criteria To Be Used in Decomposing Systems into Modules" (available here) in 1972. A large transaction processing monitor was modularised in the 1980's because the cost of servicing it was spiralling out of control. (Precise specifications were written for the new modules to clean up the interfaces and minimise dependencies on module internals, but that's another story.)
The OSGi module system for Java has been mature for at least five years, possibly longer depending on how you count it. Most of the major Java application servers are now constructed of OSGi modules and a number of them expose OSGi for applications to use. And yet we still see complaints such as the one Neil quotes. It seems application developers are stuck in their ways or stuck on systems which prevent them from using modularity.
Of course, modularity will eventually be adopted by all business critical software. There's really no rational alternative. But how long it will take is quite another matter.
Posted by
Glyn
at
1:50 PM
0
comments
Labels: OSGi
The recording of Dan North's recent talk on "Embracing Uncertainty" set me thinking again about what I like and dislike about agile methods such as scrum. As we end the 157th consecutive sprint of the Virgo project, I certainly appreciate the focus and sense of making progress that each sprint brings.
But what I really dislike are spikes.
The principle of a spike sounds fine: carve out some time to do some exploratory work. But I soon find myself too constrained by a spike. One definition of a spike is (emphasis added):
"a story that cannot be estimated until a development team runs a timeboxed investigation. The output of a spike story is an estimate for the original story."There are some assumptions buried in that definition which I think show some of the problems:
Posted by
Glyn
at
4:20 PM
4
comments
I kept seeing the following pop-up during Java based builds on Mac OS X:
Posted by
Glyn
at
1:56 PM
0
comments
IBM, Paremus, Rebaze, Red Hat, and VMware/SpringSource, with interested parties Peter Kriens and SAP, have submitted an Eclipse Bundle Recipes project proposal aiming to provide a repository of OSGi bundle templates for open source JARs. The intention is that this will supersede the SpringSource Enterprise Bundle Repository (EBR).
It's a couple of years since we ran the first Virgo survey and the project has moved on a lot since then. So we've just published a new Eclipse Virgo Community Survey. If you use Virgo, I'd really appreciate it if you could take a few minutes to complete the survey. If you are short of time, please just fill in the first six questions and skip the rest.
Question 12 is a fun quiz about the use of OSGi in application servers. You'll probably find it interesting even if you have no interest in Virgo. We'll provide the answers in a few weeks time along with the survey results.
Here's the survey if you want to get going right away.
Virgo 3.6.0 is available for download. Although the release includes many small enhancements and bug fixes, some major new features are worth highlighting and there is one smaller one I'd like to draw to the attention of Windows users.
Mike Milinkovich, the Executive Director of the Eclipse Foundation, spoke of Virgo 3.6.0 in his recent JAX interview:
"A third important milestone was SAP shipping its Netweaver Cloud offering based on the Eclipse Virgo project. Having a major vendor basing such a significant product on Eclipse runtime technologies is a great endorsement of the work that the Eclipse RT community has been doing for several years."So, let's look at the new features.
Congratulations to SAP on delivering Netweaver Cloud! The SAP committers have been a great asset to the Virgo team and it's good to see their hard work finally paying off for SAP.
Virgo is the core of SAP Netweaver Cloud or, less formally, Neo. More precisely, they are using the Virgo Nano Web deliverable which can be provisioned to their cloud VMs using p2 and which supports OSGi applications and applications written to the Java EE Web Profile. They've blogged about certifying Netweaver Cloud and now appear on the Java EE compatibility page.
Here's a short video where Harald Mueller, Chief Product Owner for SAP NetWeaver Cloud, mentions the use of Virgo and some of the benefits from his point of view - the section from 4:18 to 6:55 was of most interest to me: click here to watch.
Neo's business proposition is to encourage application developers to participate in the "SAP Store" by developing applications to run on Virgo in the cloud. They are emphasising open standards and open source to break out of SAP's proprietary image. Not only do they plan to attach a large number of application developers, they have a stretch goal of 1 billion users.
Neo's current architecture deploys each application to one or more virtual machines, each running one instance of Virgo Nano Web. AFAIK there is no support for multi-tenancy and popular applications will require load balancing across multiple Virgo instances, so the overall memory consumption looks pretty high. To scale up to large numbers of applications, not to speak of a billion users, multi-tenancy will be critical.
There are two clear options for multi-tenancy: multiple Virgo instances per virtual machine and multiple applications per Virgo instance. The former offers better failure isolation via operating system processes whereas the latter sacrifices strict isolation in order to share the overheads of JVM plus Virgo componentry. It will be interesting to see which approach they adopt. I'm particularly intrigued to see if they exploit the Virgo kernel's scoping mechanisms, regions, or OSGi subsystems to achieve multi-tenancy in a Virgo instance.
Posted by
Glyn
at
10:54 AM
0
comments
Labels: Java EE, Netweaver Cloud, Open Source, OSGi, SAP, Virgo
Following on from the nice write-up about the use of Virgo by Croatian Telecom, I'd like to encourage others who have not already done so to provide a brief summary of how they are using Virgo. If you can include a company or project name, so much the better. Numbers of servers, users, and applications are helpful if you have them to hand as are peak traffic rates. A frank summary of the pro's and con's of Virgo and OSGi will help others who are assessing the technology. Also, mentioning some of the specific 3rd party components you are successfully using gives others an idea whether what they'd like to do is feasible.
I can link helpful write-ups which include company or project names from the "Virgo Powered" list of the Virgo home page, so you get some free marketing out of this. If you can place your write-up on a personal or company blog, I can link to that too, thus helping to increase your inbound links and traffic.
This is a great, low-cost way to contribute something back to the Virgo community, even if you never answer a forum thread, raise a bug, or send in a patch. Please take a few minutes to do a write-up if you feel you can.
Posted by
Glyn
at
10:44 AM
3
comments
Apart from all those v's, what do VMware vSphere and Virgo have in common? Well you won't be surprised to learn that VMware, as well as contributing to the Virgo project, have shipped Virgo as part of their flagship virtualisation product vSphere 5.1. Virgo provides the web server for the vSphere Web Client.
VMware chose Virgo in order to make the Web Client UI extensible. Users can write plugins defining Web Client extension points and containing WAR files, OSGi bundles and extension point configurations in order to supply Adobe Flex UI components and custom data services used by the UI.
Plugins are registered with a vCenter Server and are automatically deployed to Virgo instances which connect to the vCenter Server. The result is a customisable UI and a customisable data layer that can serve up data either from the VMware Inventory Service or some other remote data source.
Virgo 3.6.0.M01 is released and features upgrades to Tomcat (bringing with it web sockets support), Spring, Gemini Web, and Gemini Management.
It includes a completely new admin console with an interesting, minimal architecture which enables it to run on the kernel as well as the Tomcat and Jetty based deliverable. See Christ Frost's blog for more details.
There is also improved Windows support by shortening some of the path names in Virgo's work directory. You can also deploy bundles and WAR files in packed form if you choose to.
The Nano hot deployer also has new support for initial bulk deployment of multiple bundles, particularly useful when they have dependencies between them.
Quite a fun set of features all in all, plus plenty of bug fixes and other improvements.
Please see the release notes for more details or just head over to the milestone download page to get going.
Posted by
Glyn
at
4:55 PM
0
comments
A colleague mentioned the Twelve-Factor App site which gives some design guidelines for building web apps. The Dependencies guideline has the following intriguing paragraph:
"A twelve-factor app never relies on implicit existence of system-wide packages. It declares all dependencies, completely and exactly, via a dependency declaration manifest. Furthermore, it uses a dependency isolation tool during execution to ensure that no implicit dependencies “leak in” from the surrounding system. The full and explicit dependency specification is applied uniformly to both production and development."
Posted by
Glyn
at
9:53 AM
0
comments
Virgo 3.5.0.RELEASE is available for download.
Although the deliverables are mostly backward compatible with Virgo 3.0.x, we decided to indicate the importance of the release by bumping the version from 3.0 to 3.5.
All Virgo deliverables are now launched using the Equinox launcher and have a corresponding directory structure which is slightly different from that of 3.0.x. All the deliverables can all be initially provisioned using p2, which is useful, for instance, when setting up remote nodes or automating installation.
There are two new deliverables which the team is pretty excited about. Virgo nano is a cut-down subset of the kernel. It supports hot deployment of bundles via the pickup directory, the Gogo shell, a single (kernel) region, and the medic component which provides Virgo's basic diagnostic capabilities.
The second new deliverable is Nano Web which is essentially Gemini Web -- the Apache Tomcat based reference implementation of the OSGi Web Applications specification -- running on Nano. In addition to Nano's features, Nano Web supports hot deployment of Web Application Bundles and WAR files.
Compared to the kernel-based deliverables, which are already pretty small and fast, Nano starts much faster and has a much smaller footprint as the following charts indicate.1
Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.vertx.core Bundle-Version: 1.0.0.final Bundle-Name: vert.x Core Import-Template: org.jboss.netty.*;version="[3.4.2.Final,4.0)", org.codehaus.jackson.*;version="[1.9.4,2.0)", com.hazelcast.*;version="[2.0.2,3.0)";resolution:=optional, groovy.*;resolution:=optional;version=0, org.codehaus.groovy.*;resolution:=optional;version=0, javax.net.ssl;resolution:=optional;version=0, org.apache.log4j;resolution:=optional;version=0, org.slf4j;resolution:=optional;version=0 Export-Template: *;version="1.0.0.final"
<hd0001i> Hot deployer processing 'INITIAL' event for file 'vert.x-core-1.0.0.final.jar'. <de0000i> Installing bundle 'org.vertx.core' version '1.0.0.final'. <de0001i> Installed bundle 'org.vertx.core' version '1.0.0.final'. <de0004i> Starting bundle 'org.vertx.core' version '1.0.0.final'. <de0005i> Started bundle 'org.vertx.core' version '1.0.0.final'.Using the Virgo shell, I then checked the wiring of the bundles:
osgi> ss
"Framework is launched."
id State Bundle
0 ACTIVE org.eclipse.osgi_3.7.1.R37x_v20110808-1106
...
89 ACTIVE org.vertx.core_1.0.0.final
90 ACTIVE jackson-core-asl_1.9.4
91 ACTIVE jackson-mapper-asl_1.9.4
92 ACTIVE org.jboss.netty_3.4.2.Final
osgi> bundle 89
org.vertx.core_1.0.0.final [89]
...
Exported packages
...
org.vertx.java.core; version="1.0.0.final"[exported]
org.vertx.java.core.buffer; version="1.0.0.final"[exported]
...
Imported packages
org.jboss.netty.util; version="3.4.2.Final"<org.jboss.netty_3.4.2.final [92]>
...
org.codehaus.jackson.map; version="1.9.4"<jackson-mapper-asl_1.9.4 [91]>
...
I also converted the vert.x platform JAR to an OSGi bundle in
similar fashion as it was needed later.public class ServerExample extends Verticle {
public void start() {
vertx.createHttpServer().requestHandler(new Handler<httpserverrequest>() {
public void handle(HttpServerRequest req) {
...
}
}).listen(8080);
}
}
public final class HttpServerRequestHandler implements Handler<httpserverrequest> {
public void handle(HttpServerRequest req) {
...
}
}
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<service interface="org.vertx.java.core.Handler" ref="handler">
<service-properties>
<entry key="type" value="HttpServerRequestHandler">
<entry key="port" value="8090">
</service-properties>
</service>
<bean class="org.vertx.osgi.sample.basic.HttpServerRequestHandler"
id="handler"/>
</blueprint>
This metadata declares that a HTTP server should be created (via
the
type service property), the handler registered with it, and
the server set listening on port 8090 (via the
port service property). This all happens courtesy of
the whiteboard pattern when the org.vertx.osgi bundle is running as
we'll see below.public class MongoPersistor extends BusModBase implements Handler<message<jsonobject>> {
private String address;
private String host;
private int port;
private String dbName;
private Mongo mongo;
private DB db;
public void start() {
super.start();
address = getOptionalStringConfig("address", "vertx.mongopersistor");
host = getOptionalStringConfig("host", "localhost");
port = getOptionalIntConfig("port", 27017);
dbName = getOptionalStringConfig("db_name", "default_db");
try {
mongo = new Mongo(host, port);
db = mongo.getDB(dbName);
eb.registerHandler(address, this);
} catch (UnknownHostException e) {
logger.error("Failed to connect to mongo server", e);
}
}
public void stop() {
mongo.close();
}
public void handle(Message<jsonobject> message) {
...
}
}
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<service ref="handler" interface="org.vertx.java.core.Handler">
<service-properties>
<entry key="type" value="EventBusHandler"/>
<entry key="address" value="vertx.mongopersistor"/>
</service-properties>
</service>
<bean id="handler" class="org.vertx.osgi.mod.mongo.MongoPersistor"
destroy-method="stop">
<argument type="java.lang.String"><value>localhost</value></argument>
<argument type="int"><value>27017</value></argument>
<argument type="java.lang.String"><value>default_db</value></argument>
</bean>
</blueprint>
Notice
that the boilerplate configuration consists of the handler type and
event bus address. The other configuration (host, port, and
database name) is specific to the MongoDB persistor.public class MongoPersistor extends BusModBase
implements Handler<Message<JsonObject>> {
private final String host;
private final int port;
private final String dbName;
private final Mongo mongo;
private final DB db;
public MongoPersistor(String host, int port, String dbName)
throws UnknownHostException, MongoException {
this.host = host;
this.port = port;
this.dbName = dbName;
this.mongo = new Mongo(host, port);
this.db = this.mongo.getDB(dbName);
}
public void stop() {
mongo.close();
}
public void handle(Message<JsonObject> message) {
...
}
}
The
code still extends
BusModBase simply
because
BusModBase provides several
convenient helper methods. Again the resultant code is simpler and
easier to unit test than the non-modular equivalent.<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<reference id="eventBus" interface="org.vertx.java.core.eventbus.EventBus"/>
<bean class="org.vertx.osgi.sample.mongo.MongoClient">
<argument ref="eventBus"/>
<argument type="java.lang.String">
<value>vertx.mongopersistor</value>
</argument>
</bean>
</blueprint>
Then the
modular event bus client code is straightforward:public final class MongoClient {
public MongoClient(EventBus eventBus, String address) {
JsonObject msg = ...
eventBus.send(address, msg,
new Handler<Message<JsonObject>>(){...});
}
}
... 89 ACTIVE org.vertx.osgi_0.0.1 90 ACTIVE jackson-core-asl_1.9.4 91 ACTIVE jackson-mapper-asl_1.9.4 92 ACTIVE org.jboss.netty_3.4.2.Final 93 ACTIVE org.vertx.core_1.0.0.final 94 ACTIVE org.vertx.osgi.mods.mongo_1.0.0 95 ACTIVE com.mongodb_2.7.2 96 ACTIVE org.vertx.platform_1.0.0.final 97 ACTIVE org.vertx.osgi.sample.basic_1.0.0 98 ACTIVE org.vertx.osgi.sample.sockjs_1.0.0and of the lb command (which includes the more descriptive Bundle-Name headers):
... 89|Active | 4|vert.x OSGi Integration (0.0.1) 90|Active | 4|Jackson JSON processor (1.9.4) 91|Active | 4|Data mapper for Jackson JSON processor (1.9.4) 92|Active | 4|The Netty Project (3.4.2.Final) 93|Active | 4|vert.x Core (1.0.0.final) 94|Active | 4|MongoDB BusMod (1.0.0) 95|Active | 4|MongoDB (2.7.2) 96|Active | 4|vert.x Platform (1.0.0.final) 97|Active | 4|Sample Basic HTTP Verticle (1.0.0) 98|Active | 4|Sample SockJS Verticle (1.0.0)
System.out Sending message: {action=save, document={x=y}, collection=vertx.osgi}
...
System.out Message sent
...
System.out Message response {_id=95..., status=ok}
Posted by
Glyn
at
3:21 PM
10
comments
New software projects or products are often introduced which take an existing, successful piece of software and offer similar function, but in a much simpler way.
Sometimes there is a genuine improvement by capturing the gist of the requirements in a much more general way. Take git for example. If you've used certain older version control systems, git seems like a dream come true. This is because git's underlying design cracks the version control problem really neatly. Branching and merging is no longer a sweat. It just works.
But other times a new piece of software only appears simpler than an established alternative because it hasn't yet had time to meet all the requirements. I've noticed this mostly in applications. Newer versions of Apple mail have (useful) features deleted. Google appear to be systematically ruining their applications in the search for simplicity. This kind of temporary simplification where, as important features are added back over time, the result ends up being no simpler than the original, seems like a bit of a con to me.
I'd be interested in other people's views on this phenomenon. Is temporary simplification a good way of appealing to a new group of users or is it a failure to make a genuine design improvement?
Posted by
Glyn
at
9:21 AM
5
comments
Labels: Apple mail, design, git, google apps, simplicity
Gemini Blueprint 1.0.1.M01 is available for download. The main highlight is the support for Spring 3.1.x. A full list of bugs in the milestone is here.
Kudos to Aaron Whiteside for providing the vast majority of the changes for this milestone. He is in the process of becoming a committer for Gemini Blueprint.
Posted by
Glyn
at
10:57 AM
0
comments