Author: jawi
Date: Wed Aug 22 10:35:57 2012
New Revision: 1375974
URL: http://svn.apache.org/viewvc?rev=1375974&view=rev
Log:
Added initial version of the user guide.
Added:
ace/site/trunk/content/user-doc/ace_server_ui.png (with props)
ace/site/trunk/content/user-doc/user-guide.mdtext (with props)
Added: ace/site/trunk/content/user-doc/ace_server_ui.png
URL:
http://svn.apache.org/viewvc/ace/site/trunk/content/user-doc/ace_server_ui.png?rev=1375974&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ace/site/trunk/content/user-doc/ace_server_ui.png
------------------------------------------------------------------------------
svn:mime-type = image/png
Added: ace/site/trunk/content/user-doc/user-guide.mdtext
URL:
http://svn.apache.org/viewvc/ace/site/trunk/content/user-doc/user-guide.mdtext?rev=1375974&view=auto
==============================================================================
--- ace/site/trunk/content/user-doc/user-guide.mdtext (added)
+++ ace/site/trunk/content/user-doc/user-guide.mdtext Wed Aug 22 10:35:57 2012
@@ -0,0 +1,142 @@
+Title: ACE Users guide
+
+This article describes how to use ACE and should be a good starting point for
new users of Apache ACE. The remainder of this article assumes you've read and
followed the "[Getting Started](/user-doc/getting-started.html)" guide, meaning
that you have an ACE server successfully up and running.
+
+
+## Introduction
+
+Apache ACE is a framework that enables you to provision OSGi
software(components) in a controlled manner. What this means is that you have a
central server to which clients, or "targets" in ACE terminology, connect and
fetch their software from. This allows one to control which target gets which
software.
+
+The software that is deployed to a target, is composed of one or more
distributions. A distribution is roughly similar to a piece of self-contained
software. For example, think of a distribution as C/C++ Development Tooling
that you can install on the Eclipse platform. On its own, distributions
consists of one or more features, that provide pieces of functionality to your
software. The difference between a feature and distribution is that the former
is not necessarily fully self-contained: it might need other features in order
to work. Each feature groups one or more artifacts. An artifact is anything
from an OSGi bundle, configuration file or any other kind of artifact that is
needed for the software to work.
+
+The artifacts themselves reside on an OBR, which can be either the default one
supplied by ACE, or an external one. Think of an OBR as a kind of Maven
repository, storing read-only versions of artifacts[^1]. As the OBR is the
single source for all artifacts, and therefore the software that is deployed on
a target, ACE is able to calculate how to upgrade a target from one version to
another version. This is possible because all changes made to (the metadata of)
ACE are stored in an internal versioned database.
+
+
+## Workflow
+
+The typical use case for using ACE is where you want to control and manage
which software runs on what target. So, how does one use ACE in practice? To
explain the typical workflow of ACE, let's take the following example.
+Assume you are working on a large OSGi-based system that provides some kind of
service to your customers (the exact details on what it does isn't relevant for
this example). Since you're trying to make real money out of it, and take
development seriously, you want to set up a DTAP environment. Your developers
are working on their development machines, using the bleeding edge software.
They are smart guys that can set up their own environments, so ACE won't be of
much help here.
+
+There is also have a tester on your team, responsible for testing all the new
features and bug fixes made by your developers. This tester does not want to
have to set up its own environment and fiddle around with configuration files
and such. Instead, he simply wants a working test environment that runs a
recent version of your software. This is were ACE can help you out. All you
need to do is create a testing target, on which a recent software version gets
deployed. That "recent version", can, for example, be a nightly build that
comes out of your CI server that automatically gets pushed to ACE after the
nightly build is finished. Alternatively, the tester also can deploy an older
version to its testing target through the ACE server UI, for example, to do
some regression testing.
+
+Before a new version of your software is put into production, your customers
want to do some acceptance testing to see whether this new version does not
break anything. The acceptance environment should only be updated when a new
version is released and after that remains as-is. In practice, this is most
often not the case, as the acceptance environment is, when not used by any
customer, confiscated by your tester for its daily testing purposes, simply,
because ACE allows him to easily deploy other versions to the acceptance
environment. When a customer asks for an acceptance test, he simply deploys the
latest greatest official release to the acceptance environment, and lets the
customer do its testing. After that, he can repurpose it again.
+
+When all acceptance tests are successful, the new version of your software
needs to be deployed on several production environments, which is done by you,
the release manager. As most production environments only differ in a few
details, such as IP addresses and database credentials, you use the template
engine of ACE to make specific configuration files for each production target.
This way, you can easily scale up your production environment by defining new
targets and provide them with the necessary configuration values.
+
+
+## Working with ACE Server
+
+The server UI might look a bit daunting at first, but once you become more
familiar with it, you'll see that it is rather easy to work with.
+After logging in, the main window consists of two main areas:
+
+1. The control area at the top of the screen, where you can perform actions
like, retrieving the latest repository changes, revert the changes you've made
locally, add new artifacts, and so on;
+2. The resource area, consisting of (up to) four columns showing the current
artifacts, features, distributions and targets that are known to ACE.
+
+
+
+
+### Uploading artifacts
+
+To upload one or more artifacts, you click on the "Add artifactâ¦" button. An
"Add artifact" dialogs opened, showing both the artifacts currently in the OBR
and a list of uploaded artifacts. There are two possibilities to upload a file:
+
+1. Upload the individual artifacts by pressing the "Upload" button and
selecting the artifact from the file chooser dialog, or;
+2. by using drag-and-drop: select all artifacts in an Explorer or Finder and
drag them onto the "Upload artifact" area. This way, you can upload multiple
artifacts in one go.
+
+Once artifacts are uploaded, they appear in the Artifacts listing. For each
artifact, you can edit its properties by double clicking on it. In addition,
you can unlink an artifact from a feature, which will be discussed later on,
and remove an artifact. **Note**: removing an artifact will only remove it from
the server's metadata, *not* from the OBR.
+
+If you try to upload an artifact that is not recognized by ACE, an error is
displayed noting that that particular artifact is not uploaded. Adding support
for particular artifacts in ACE is discussed in [this
article](/dev-doc/adding-artifact-recognizers.html).
+
+**NOTE**: All changes made through the Web UI need to be stored explicitly by
pressing the "Store" button, otherwise they will not be visible to the ACE
server. In case you want to revert all changes, you can use the "Revert"
button. This will ignore all changes and retrieve the latest state from the
server. In case there are no local changes, you can still retrieve the latest
state from the server using the "Retrieve" button.
+
+### Creating a new feature, distribution and/or target
+
+Adding features and distributions are very similar. You either click the "Add
Featureâ¦" or "Add Distributionâ¦" buttons. In both cases, you are presented
with a dialog that allows you to enter the (mandatory) name of feature (or
distribution) and an optional description.
+There are two ways of adding a target to ACE: either you click the "Add
Targetâ¦" button and enter the name of the new target, or let a running target
register itself to ACE. The details on this will be discussed later on.
+
+After a feature, distribution or target is created, you can edit its
properties by double clicking it. For features and distributions, this means
you can alter their description, while for targets, there are more
possibilities to view and alter:
+
+* On the Management tab, you can change whether or not the target should be
automatically updated to the latest software. If selected, all updates will
automatically be approved and distributed to that target. If not, any update
must be explicitly approved prior to being distributed to the target;
+* On the Info tab, you can view the current state of the target, such as the
currently installed version, or the latest available software version;
+* On the LogViewer tab, you can view the installation log of the target. This
allows you to review the installation of updates on that target;
+* The Tag Editor tab allows you to define tags and their replacement values
that will be replaced in any artifacts that contain those tags. This is useful,
for example, to have a single configuration file that can be used for multiple
targets.
+
+### Creating associations
+
+To link artifacts to features, you simply select the artifact and drag it on
top of the feature to which it should be associated. The same principle also
apply to associate features to distributions and distributions to targets.
+To delete an association once is created, you can click either the left- or
the right side of the association (viz. either the artifact or the feature),
and click the "-" on the opposite side of the association. For example, to
delete an association between an feature and distribution, you can select the
feature first, and hit the "-" on the distribution. Alternatively, you can
select the distribution first and hit the "-" on the feature to delete the
association.
+
+Associations can be parameterized, allowing it to be dynamic in what it
matches on left-side and/or right-side of the association. For example, by
default an association between a bundle artifact and a feature will be made to
match the *latest* version of the bundle. This way, if you upload a new version
of a bundle, the feature will automatically link to that version. While this is
certainly handy in many situations, there are also situations in which you do
not always want to link to the latest greatest version of a bundle. An example
might be the bundles that should run on your production environment, which
should only get an update in controlled upgrades, not when you upload a new
artifact to ACE. To disable the "dynamic" associations between, uncheck the
"Dynamic Links" option in the UI *before* you create the association. This will
create an association that is explicitly bound to the symbolic name and version
of a bundle.
+
+
+## Running a target
+
+As mentioned, a target represents a client on which software can be deployed
by ACE. Actually, a target consists of a small OSGi runtime that runs an
management agent that periodically checks with the ACE server whether or not it
is has new software for it. In case new software is available for a target, it
will automatically download it and install it.
+
+ACE provides a fully self-contained management agent, that can be run as plain
Java JAR, named <tt>org.apache.ace.launcher.jar</tt>. This management agent
wrapper accepts the following command line arguments:
+
+`agents`
+: configures the target to act as multiple management agents:
`agent-id,identification,discovery[;agent-id,identification,discovery]*`;
+
+`auth`
+: point to the properties file containing the authentication credentials for a
certain subsystem. Can be either a directory, file or URL;
+
+`discovery`
+: sets the ACE server to connect to, should be an URL. Defaults to
`http://localhost:8080`;
+
+`id` or `identification`
+: defines the name to identify the target on in the ACE server. Defaults to
`defaultTargetID`;
+
+`bundle`
+: adds an additional bundle to be started with this management agent:
`bundle=my.fully.qualified.BundleActivator`;
+
+`fwOption`
+: sets framework options for the OSGi framework to be created. This argument
may be repeated. For example:
`fwOption=org.osgi.framework.system.packages.extra=sun.misc,com.sun.management`.
+
+An example on how to run the launcher is:
+
+ :::sh
+ $ java -jar org.apache.ace.launcher.jar id=MyTarget
discovery=http://192.168.1.1:8080
+ Adding additional bundle activator:
org.apache.ace.managementagent.Activator
+ Started management agent.
+ Target ID : MyTarget
+ Server : http://192.168.1.1:8080
+ Sync interval: 2000 ms
+ Unaffected bundles will not be stopped during deployment.
+
+After the management agent is started, a new target should appear in the ACE
server after you "Retrieve" the latest changes or "Revert" the current changes.
If a target is added this way to the ACE server (instead of adding it through
the "Add targetâ¦" button), it initially will be *unregistered*. This means
that no metadata is present in the ACE server yet and will not be created. To
register a target, you can double click the target to edit its properties. On
the "Management" tab, you can select the "Registered?" (and optionally the
"Auto approve?" option as well) and close the dialog by pressing "Ok"[^2].
+
+### Using the template engine for targets
+
+If you want to provision software to multiple targets, those targets probably
need to have their own specific configuration. For example, the IP address on
which it should listen for web requests, or the credentials to access a
database. One could create specific configuration files for each target,
however, this can become quite tedious is you have lots of targets. Aside that,
ACE requires that each artifact has an unique name, so you need to create
unique file names for your configuration files for each change you make.
Fortunately, ACE provides an easier way to solve this problem: an template
engine.
+
+All configuration files[^3] can be regarded as templates, in which variables
are replaced with values supplied by ACE. In fact, the values are definable per
target, distribution, feature or artifact. To define variables and their
replacement values (or "tags") for, for example, a distribution, open up its
properties dialog by double clicking on it, and selecting the "Tag Editor" tab.
Each line in this editor represents a tag. The key of a tag defines that (part
of) the variable name to be replaced in configuration files, and the value of a
tag the actual replacement value.
+
+For example, consider the following configuration file:
+
+ :::xml
+ <properties>
+ <key>ipAddress</key>
+ <value>${context.address}</value>
+ </properties>
+
+The <tt>${context.address}</tt> represent the variable that will be replaced.
The "context." part is mandatory, and everything after that is user definable.
Suppose we want to deploy this configuration file to two targets, "Target1",
which is supposed to listen on address 192.168.2.1 and "Target2", which is
supposed to listen on address 192.168.2.2. To make the configuration file
specific for both targets, we simply need to define a tag on "Target1", like:
`address` -> `192.168.2.1`, and a similar tag on "Target2", like `address` ->
`192.168.2.2`.
+
+**NOTE**: In case a configuration file consists of a variable that cannot be
resolved, it will simply not be replaced, but left as-is. This way, you can
still include Velocity-like templates in your distribution without having them
garbled by ACE.
+
+ACE will scan all configuration files and replace all known variables as soon
as a new deployment is created. This means that for our example, both "Target1"
and "Target2" will get their own copy of the configuration file with their
specific content. ACE also automatically versions these generated files, to aid
downgrading software.
+
+
+
+
+[^1]: Once an artifact is uploaded to the OBR, it cannot be modified anymore.
This is necessary in order to allow both software upgrades as downgrades
possible.
+
+[^2]: Do not forget to store your changes!
+
+[^3]: In fact any artifact can be considered as an template, but by default
ACE only considers configuration files.
+
+
+*[OBR]: OSGi Bundle Repository
+
+*[DTAP]: Development, Testing, Acceptance and Production
+
+*[CI]: Continuous Integration
Propchange: ace/site/trunk/content/user-doc/user-guide.mdtext
------------------------------------------------------------------------------
svn:eol-style = native