Deploy with epadmin

Summary of Steps

To deploy an EventFlow or LiveView fragment at the command prompt with the epadmin command requires the following steps:

In StreamBase Studio:
  1. Create a fragment archive file for the fragment you want to deploy.

  2. Create a new, separate project in StreamBase Studio of type StreamBase Application.

  3. Add the fragment archive created in step 1 as a Maven dependency for the StreamBase Application project.

  4. Create an application archive file for the StreamBase Application project.

At the command prompt:
  1. Install a node containing the application archive file, using epadmin install node.

  2. Start the node, thereby starting the fragment running, using epadmin start node.

The sections below explain these steps in more detail.

1. Create a Fragment Archive

When your EventFlow fragment is in a known working and tested state, create a fragment archive for it. To do this:

  • In Studio, select the project name in the Project Explorer view.

  • Right-click, and from the context menu select Run AsMaven install.

  • This Maven operation does two things:

    1. Generates a zip file into the project's target folder containing the fragment archive.

    2. Installs the same file into your local Maven repository. This is the ~/.m2 folder by default, but your site may be configured to use a site-specific central Maven repository.

Note

If Maven Install results in a BUILD FAILURE message, try again with Run AsMaven build... (carefully selecting the Maven build... command with three periods). In the resulting dialog, type clean install in the Goals field, and select the Skip Tests check box. Click Apply, then Run.

2. Create a StreamBase Application Project

Create a new, separate Studio project to contain the StreamBase Application that will incorporate your fragment archive.

  • In Studio, invoke FileNewStreamBase Project.

  • In the resulting dialog's first panel, enter a name for the project, and select StreamBase Application as the project type. TIBCO suggests choosing a name for this project that starts with "deploy" to distinguish it from EventFlow fragment projects.

  • Click Next, then Next.

  • Optional. At the second panel, click Next instead of Finish. This opens a third panel named Archetype Properties. To cut down on the number of test instances created, edit the testnodes line from its default A,B,C to just A.

  • Click Finish.

3. Add a Dependency

The newly created StreamBase Application project does not yet know about any fragments. You must add a Maven dependency for your new project on the fragment archive created in step 1.

  • Select the name of the StreamBase Application project in the Project Explorer view.

  • Right-click and from the context menu, select MavenAdd Dependency.

  • In the Add Dependency dialog, in the Enter groupid, artifactId field, enter the first few parts of the group ID of the fragment you are adding. Enter enough letters to narrow the list to the projects whose package name begins with those letters.

    For StreamBase samples, enter com.tibco.sb.sample or com.example to narrow the list to the fragment archives you have created for samples. For your own projects, enter the first portion of your company's group ID.

  • In the Search Results field, select the EventFlow fragment project for which you built a fragment archive in step 1. The following image shows the fragment archive for the Best Bids and Asks sample.

  • Selecting a fragment archive entry fills in the Group Id, Artifact Id, and Version fields of the dialog. Click OK.

  • The Add Dependency dialog has made changes to the project's pom.xml file. Save those changes by clicking the Save or Save all button, or with Ctrl+S (Windows) or command+S (Mac).

4. Create an Application Archive

Create a runnable archive file for your StreamBase Application project as follows:

  • In the Project Explorer view, select the name of your StreamBase Application project.

  • Right-click and from the context menu, select StreamBaseCreate StreamBase Application Archive.

  • This generates a zip file in the project's target folder.

5. Install a Node

Install the newly created application archive zip file into a StreamBase Runtime node as follows:

  • Using a StreamBase Command Prompt on Windows or a configured shell prompt on macOS and Linux, navigate to your Studio workspace folder. For example:

    Windows: cd "\Users\sbuser\Documents\StreamBase Studio 10.2 Workspace"
    macOS:   cd /Users/sbuser/Documents/StreamBase\ Studio\ 10.2\ Workspace
  • Navigate to the target subfolder of your StreamBase Application project. For example:

    cd deploy_bestbids/target

    Tip

    As a shortcut for the above steps, you can select any EventFlow fragment project in Studio's Project Explorer view, right-click, and from the context menu, select StreamBaseOpen Command Prompt Here (Windows) or StreamBaseOpen Command Terminal Here (Mac). Then navigate up and over to your deployment project.

    cd ../deploy_bestbids/target
  • Run a command like the following. This is a single command, shown here on multiple lines for clarity. On macOS:

    epadmin install node \
      application=deploy_bestbids-0.0.1-SNAPSHOT-ep-application.zip \
      nodename=A.sbuser \
      nodedirectory=/home/sbuser/tmp/Nodedirs

    On Windows, you can use forward slashes as shown above, or use Windows-style backslashes and a drive letter:

      ...
      nodedirectory=C:\home\sbuser\tmp\Nodedirs

    These example commands are shown on four lines for clarity, but must be typed as a single command.

  • You can now run edadmin display services to make sure your node was installed.

Refer to the following pages to understand the parameters you can type on the epadmin install node and epadmin start node command lines:

6. Start the Node

Start the installed node with a command like the following. For the servicename= parameter, use the same name you declared as nodename= above.

epadamin servicename=A.sbuser start node

Your EventFlow fragment is now running inside a StreamBase Runtime node and can accept input and return output.