Building, Packaging, and Deploying a Fabric Application
Introduction
This tutorial walks through the basic steps required to build, package and deploy a fabric application.
You may create your own fabric application and client application, or you may use the files and projects provided in tutorial_samples.zip and tutorial_samples.tgz archives. These files and projects are not included in the Fabric Software Development Kit (SDK) installation, but will be available for later versions. The fabric APIs are not dependent on a particular build tool or development environment (IDE), so you may use your preferred build tools. For your convenience, we have included project files for several platforms. These can be seen in the table to the right.
In this Kick Start tutorial we will
Build the Java, .NET, or C/C++ code for your fabric application.
Package our fabric application code and other required files into a deployable .fabric file.
Deploy the .fabric application file to the fabric for installation by the workers.
Projects Provided For Tutorial Samples
Language
Platform
Project Type
Java 1.5
All
Eclipse
Java 1.5
All
Ant scripts
.NET 2.0
Windows
Visual Studio 2005
'C'
Windows
Visual Studio 2005
'C'
Linux
Make scripts
Click the language of your choice for this page:
To create your own fabric application and client, you will need to have done the following:
Read through all the pages in Appistry EAF Essentials to become familiar with the fabric application components and services.
Install the Fabric SDK on your development workstation. Please refer to the Installation procedure.
Download either the tutorial_samples.zip or tutorial_samples.tgz archive from here, and copy the archive into the top level SDK directory ("/usr/local/appistry_eaf_sdk" on unix or "C:\Program Files\Fabric" on Windows) that was created during the SDK install in step #2.
Extract the .zip or .tgz tutorial samples archive into the top level SDK directory. A "tutorial_samples" subdirectory should be created with a path of "/usr/local/appistry_eaf_sdk/tutorial_samples" on unix or "C:\Program Files\Fabric\tutorial_samples" on Windows. Make sure when you extract your archive, particularly using the .zip file, that you do not end up with two tutorial_samples directories like this: "C:\Program Files\Fabric\tutorial_samples\tutorial_samples\...."
Have your build environment setup for Java, .NET, and/or 'C'. We presume in this tutorial that you know how to use the build environment of your choice. We have provided projects for several, as mentioned, for your convenience.
Install at least one fabric worker on a computer. This may be on your development workstation or one or more separate boxes. If the worker is not on your local workstation, then the worker or workers must be accessible over the network from your development workstation. Please refer to the Installing the Fabric procedure.
Java with Eclipse (Windows and Linux) with JDK 1.5 or later
Create a new workspace for fabric samples.
Open the new workspace.
Import the tutorial samples directory using the "import existing projects into workspace" option.
Select "File", "Import..." to open the Import window
Under "General", select "Existing Projects into Workspace, and click "Next >"
For "Select root directory" enter or browse to the tutorial_samples directory, and click "Finish"
Do not "Copy projects into workspace"
The projects will be imported into your workspace, but they will NOT build at this point.
Create a "FABRIC_HOME" classpath variable. From the eclipse menu:
Select "Window", "Preferences..." to open the Preferences window.
Under "Java", select "Build Path", and then "Classpath Variables"
On the "Classpath Variables" dialog, select "New"
On the "New Variable Entry" dialog
Name the variable "FABRIC_HOME"
Enter the FABRIC_HOME path for EAF installation. For windows the default is "C:\Program Files\Fabric\system", and for Linux the default is "/usr/local/fabric/system".
Select "OK" to close the dialog
Select "OK" to close Preferences
You may be prompted with the "Classpath Variables Changed" dialog, asking if you want to rebuild. Select "Yes".
The projects should now be built.
Java Projects In this tutorial, the source files and compiled classes stay in the tutorial_samples/java/<sample> directory structure and do not move to another location. If you follow step #3 above, that should be the case.
Java with Ant (Windows and Linux) with JDK 1.5 or later
Change to the tutorial_samples/java/<sample> directory.
Run the "ant" command. The project builds. This builds the fabric application and the fabric client.
.NET C# with Visual Studio 2005
Open the solution file located in tutorial_samples/dotnet directory. This solution file includes the projects for the fabric application and the fabric client.
Build the projects.
'C' with Visual Studio 2005
Open the solution file found in tutorial_samples/cpp directory. This solution file includes the projects for the fabric application and the fabric client
Build the projects.
'C' with Make (on Linux)
Change to the tutorial_samples/cpp directory.
Run the "make" command. The project builds. This builds the fabric application and the fabric client.
Packaging a Sample Fabric Application
Change to a tutorial_samples fabric application directory (for example, the /java/hello_world directory).
To create the application package, run the following command.
fabric_pkg create hello_world_java_app.xml
Deploying a Sample Fabric Application
Before deploying the fabric application package:
Verify the fabric is running. If the fabric is not running, refer to Installation for instructions.
Verify the Log Monitor is running in a separate window or terminal. To start the Log Monitor run the following command with the correct fabric MCAST address.
log_monitor 239.255.0.1:4000
What about this fabric MCAST address? Each fabric is assigned a unique MCAST address. Fabric clients and utilities (like Log Monitor and Fabric Control) use this MCAST address to communicate with the fabric. This address defaults to 239.255.0.1, but can be changed by setting the fabric-address property in the addr.cfg file that is deployed to all fabric workers. The fabric MCAST address specified by clients and utilities must match the fabric-address entry in the addr.cfg or 239.255.0.1 if using the default. As you go through command and code samples, please be sure to use the correct fabric MCAST address for your installation.
Change to a tutorial_samples fabric application directory (for example, the /java/hello_world directory).
To deploy the fabric application package, run the following command with the correct fabric administrative user, password, and fabric address.
To verify the deployment of the fabric application package, run the following command with the correct fabric administrative user, password, and fabric address.
fabric_ctl -d 239.255.0.1:30000 -u fabric-admin/fabric-admin fabric-version hello_world_java_app.fabric all
The fabric_ctl output appears below.
The Log Monitor report appears below.
Sample Fabric Control application deployment output
Sample deployment log output
The filtered Log Monitor output below shows the messages from deploying the hello_world_java_app fabric application.