Developing and Deploying Java on Middleware and in the Cloud: Rise of the Virtual Appliance?
Join the DZone community and get the full member experience.
Join For Free
from
java ee
to
google app engine
to
gigaspaces
, the idea of developing against a middleware or "infrastructure" api is well established in the java world.
but these are
fixed
environments. with the (re-)advent of virtualization, it is now becoming feasible to package and rapidly provision your
own
environment, custom-designed to meet your application's needs.
as the big middleware vendors are realizing, it is not just possible to create such virtual appliances, but
necessary
: a production app's setup inevitably includes
more than just a couple of ears
.
here, we'll look at the current state of cloud and middleware
deployment tooling, examine possible future developments and draw
parallels between deployment and related processes.
cloud: the end of the beginning
the initial wave of
iaas
cloud providers resulted in a bunch of infrastructure services with
deceptively similar specs but frustratingly different, proprietary
apis, parameters, concepts and formats. the first wave of cloud tooling
has aimed to tackle this portability nightmare by attempting to
introduce common apis and terminologies.
at the same time, there have been proposals for
open virtual image
and
hypervisor api
formats, but there is as yet no sign of widespread adoption in the short term.
one difficulty for the current "meta api" approaches
1
is the fact that generic support, i.e. providing features supported by
all
providers, leads to a lowest common denominator that is too small to be of much practical use.
jclouds'
templatebuilder
is an interesting attempt to tackle this problem, but ultimately only
the adoption of an iaas standard will makes this one go away.
from a developer's perspective, a more fundamental issue is that a "raw" machine such as is represented by a virtual image profile is just too low-level to be useful. iaas vendors then to come from the provisioning world which deals in servers, racks and cores. but developers are used to developing against "environment services" 2 , be that a java ee cluster, a lamp stack or a hadoop installation 3 .
middleware: java ee and then some
after the large initial effort of putting together "corporate" java
ee implementations, the large enterprise vendors quickly moved to
expanding the feature set of resources available to applications, such
as persistent queues or clustered datasources.
as developers discovered and made use of these features, applications
became progressively more tied to specific, often proprietary,
middleware platforms. as a result, the development "deliverable"
quickly grew to include not just the ears envisaged by java ee, but a
variety of configuration options and resource definitions for the
middleware container.
keeping track of and deploying these loose packages, whilst remembering to apply appropriate modifications specific to the target environment, has proven to be a difficult, time-consuming and error prone task. indeed, users regard the automatic management of these packages as a major benefit of xebialabs' deployment automation product deployit.
slowly, though, the big vendors are also realizing that an effective
"management unit" for today's java applications contains goes beyond
java ee artifacts, and also needs to contain information about the
middleware configuration: a "virtual appliance", you might say. both
ibm's
websphere cloudburst
and oracle's upcoming
assembly builder
attempt to address this issue by making it possible to capture
websphere and weblogic configurations, modify them and apply them to
different installation.
both tools run only in the context of virtualized environments - in
fact, they are largely built on top of the vendors' virtualization
offerings - and still appear to be limited to the ibm and weblogic
stacks, respectively
4
.
towards configurable virtual appliances
current virtual image formats are essentially a long list of bits
and bytes of memory and disk storage. i might be able to get some
low-level infrastructure details such as ip addresses or number of
cores from the api, but beyond that the best source of information
about what this image actually
contains
is a free-text
"description" field, intended mainly for human readability. so even if
i have configured a websphere nd 7.1 installation with a database and a
cluster, all according to company policy, most of the details of the
installation are lost.
certainly, it is very hard to programmatically check dependencies,
enforce policies or even find an image matching certain software
requirements (java installed, version >1.5, latest os patches etc.).
one interesting possibility is to define an image as a base os together with a list of
yum
,
rpm
or
conary
packages
5
.
this gives a much more developer-level view of what is in the image and
avoids reinventing this particular packaging and installation wheel.
unfortunately, though, these package managers are all os-specific and
don't leave much room for customization of package installation and
configuration.
templates, not clones
bit-for-bit descriptions of virtual appliances make it easy to
instantiate many clones of a machine. most of the time, though, we need
to instantiate and appliance that is just
slightly
different from the original - think data source credentials, naming conventions ot port numbers.
in fact, most of the time our "image" is more of a
template
to be instantiated than a
master
that just needs to be cloned. unfortunately
6
, the current virtual machine formats don't support this.
cloudlets are an interesting approach in this direction, allowing you to specify the file system tree of the image, using template files where appropriate. this can get you a long way in unix environments, but still doesn't solve all the problems: parameterizing a weblogic domain by modifying the xml configuration files in tricky and, incidentally, not supported. or think binary configurations, tablespaces in a database installation or the windows registry.
furthermore, from a developer's perspective, it's usually the service delivered by the virtual appliance that is interesting; whether your gigaspaces xap grid needs one or 100 images to run doesn't really matter. jclouds' nodeset , which makes it possible to transparently manage and scale mutliple images, looks like an important conceptual advance here.
virtual appliances: a feature wishlist
using the current generation of tools, we can put together a
catalogue of possibly related images that are portable enough not to be
tied to a vendor. with some trickery and a a bit of blood, sweat and
tears we can even wire up some kind of dynamic configuration, even if
that's usually specific to the contents of the image.
at the developer level, there are already a handful of projects out that focus on deploying platforms, such as
crane
, or that add a "platform slice" on top of the infrastructure, such as
webappvm
7
. again, though, they tend to be tailored to one or a limited number of specific services.
what next? here a few items from my "wishlist" of features for the next generation of virtual appliances:
round-trip templates
you've taken the company-approved base os image and spent a lot of
time installing your middleware, getting the configuration just right
and even making it parameterizable. a few months later a new base image
is released, and your old one is no longer supported in production.
currently, we treat images as an atomic unit, so there is no way to
separate the "base" part, which presumably comes from the operations
team, from the "platform" part, which has probably been installed and
configured by a developer.
8
structured metadata
you're trying to reproduce a problem you've come across in
production and would quickly like to spin up a websphere cluster on
your production operating system to investigate.
today, you'll probably end up browsing through various image libraries
looking for suitable templates. "websphere as 6.1. on ubuntu" looks
promising, but is it the right version of the os? what's the patch
level of websphere? which version of java is it running?
hopefully, it'll soon be possible to formulate these kind of
requirements accurately (and plenty of other interesting ones, such as
maximum spend or required sla) and have the correct images chosen,
provisioned and configured automatically, perhaps even across multiple
clouds.
service-based provisioning
you've read interesting things about
terracotta
and want to see if it might help with session sharing. so you'd quickly
like to spin up a java ee container and wire in terracotta.
how many images are involved, and what the exact version of the operating system is, isn't even interesting - it's the
configured service
you're after as a developer. you can already ask crane to give you a
certain type of hadoop installation, and websphere cloudburst supports
this at limited level for certain ibm products. i'd hope that soon
this'll be possible for many more types of service.
haven't we been here before..?
structured metadata, dependencies between images, management of composites, parameterizable configuration...all these themes sound terribly familiar to most developers. in fact, these are precisely the issues tools like maven were designed to tackle during the build process.
certainly, the spectrum of possible dependencies, features and configuration options is far greater when instantiating and growing a multi-image platform than during a software build, but there are plenty of wheels here that hopefully don't need to be reinvented.
perhaps the realization that sticking to certain conventions, and foregoing the opportunity of applying all manner of arbitrary changes (or, at least, not worrying about making it easy ), will be a key lesson to learn.
it's worth noting that a lot of the complexity of current
provisioning lies in the fact that both platforms and deployment
packages still need to be tailored to their target environment.
indeed, these are often the most error-prone aspects of typical
deployment scenarios, and one of the main reasons why people are
looking towards deployment automation products such as
deployit
, which are designed to tackle these issues.
however...in a virtualized setup where a new machine doesn't
immediately mean lots of expensive hardware, is there really any need
for the development environment to run on a single server and the test
environment on a cluster?
in the days when all machines were connected to the same network,
environment-specific naming conventions, port ranges and credentials
formed an important safety net. but now that environments can be
effectively isolated at the hypervisor level, is this still necessary?
certainly, looking at the errors caused and general overhead imposed by the current practice of maintaining similar but different development, test, acceptance and production 9 environments, the benefits of moving to a "single image" approach are self-evident. and even if, in many industries, we may never see fully virtualized production environments, we can certainly have clones of this environment running in the clouds.
- which, indeed, are also proprietary in the sense that all the "common" apis are, for the most part, incompatible with each other.
-
i would have used "middleware" but that term is taken
- i'm curious as to what the spring/vmware combo will come up with in this space.
- based on my knowledge of these products - corrections welcome!
- optionally wired up by puppet , chef , cfengine , smartfrog or any of the like.
- i say "unfortunately", but i should be grateful: automating these environment-specific settings and making sure you can deploy the same application package to all your environments is what deployit , our deployment automation product, is all about.
- now "makara".
- well, clever things can be done by taking and merging snapshots, but that's essentially a scary hack.
- we could throw in qa, uat and a bunch of others, for good measure.
Opinions expressed by DZone contributors are their own.
Comments