Installing IBM Streams Runner for Apache Beam from an IBM Streaming Analytics service on IBM Cloud
Edit meInstalling IBM® Streams Runner for Apache Beam from an IBM Streaming Analytics service on IBM Cloud involves downloading and extracting the Streams Runner toolkit, configuring environment variables, and creating a credentials file for your Streaming Analytics service. You don’t need to install IBM Streams to use Streams Runner.
Before you start
The Streaming Analytics installation of Streams Runner supports Apache Beam 2.1 applications, so your application must use the Apache Beam SDK for Java API version 2.1
Creating a Streaming Analytics service on IBM Cloud
Before you can download Streams Runner, you must have a Streaming Analytics service so that you can open the Streams Console. The following video demonstrates how to create the service.
To create a Streaming Analytics service:
- On the IBM Cloud catalog page, log in. If you don’t have an IBM Cloud account, you can create one.
- On the catalog page, use the Filter option to search for Streaming Analytics.
- Click the Streaming Analytics service to configure an instance.
- On the catalog page for the Streaming Analytics service, change Service name to something meaningful to you, for example,
Streaming Analytics-beam
. -
Select a pricing plan.
Important: To get the latest Streams Runner version, select a container-based plan like ‘Lite’ or ‘Entry Container Hourly’.
- Click Create. The service page opens and your service starts automatically. The service name appears as the title of the service page.
For more information about the Streaming Analytics service, see Introduction to the Streaming Analytics Service in the IBM Cloud.
Downloading and configuring Streams Runner
The following video demonstrates how to download and install the Streams Runner package.
To download and install the Streams runner package:
- Open the Streams Console:
- Click the Manage tab of your Streaming Analytics Service.
- Click Launch.
- Download Streams Runner:
- In the Streams Console, click Help > Download > Download Streams Runner for Apache Beam.
- Select Save File, specify a location if necessary, and click OK.
- Extract the toolkit by entering the following command where you downloaded the file, where
<runner-version>
indicates the version of the archive file:tar -zxvf com.ibm.streams.beam-<runner-version>.tar.gz
-
(Optional) Configure the IBM Streams Runner environment variables.
Tip: Although the variables are not required, the documentation refers to them for convenience. If you do not set the environment variables, you must use the full paths when you run the sample applications.
- Go to the
examples/bin
directory in the expanded toolkit and run thestreams-runner-env.sh
command to set up environment variables for the runner:cd com.ibm.streams.beam-<runner-version>/examples/bin . streams-runner-env.sh
- Go to the
Creating a credentials file for your Streaming Analytics service
To submit a Beam application to your Streaming Analytics service on IBM Cloud, you must create a JSON-formatted VCAP file that holds credentials and other information for the service. The following video demonstrates how to create the credentials file.
To create a VCAP file for an existing Streaming Analytics service:
- Go to the directory where you installed the toolkit (
$STREAMS_RUNNER_HOME
) and copy thetemplate.vcap
file to a new file. Give the file a meaningful name and a file extension of.vcap
. - Copy the credentials of your Streaming Analytics service:
- On the Streaming Analytics service page, click Service credentials.
- If necessary, create a credential by clicking New credential. Use the default information and click Add.
- Click View credentials for the credential that you want to use in your VCAP file. Click Copy to copy the credentials.
- Paste the copied credentials into the VCAP file that you created, replacing the following line:
<REMOVE THIS LINE AND INSERT CREDENTIALS HERE>
-
(Optional) Configure the service credentials environment variables:
Tip: Although the variables are not required, the documentation refers to them for convenience. If you do not set the environment variables, you must use the full paths when you run the sample applications.
VCAP_SERVICES
: Point to the VCAP file that contains your Streaming Analytics service credentials.STREAMING_ANALYTICS_SERVICE_NAME
: Point to the service name within that file.
For example:
export VCAP_SERVICES=$HOME/sample.vcap export STREAMING_ANALYTICS_SERVICE_NAME="sample-service"
Validating the Streams Runner installation
Streams Runner relies on preserving the com.ibm.streams.beam
directory structure. To verify an installation, ensure that the translation
and sdk
JAR files appear as follows when you enter the following command:
ls $STREAMS_BEAM_TOOLKIT/lib
> com.ibm.streams.beam.sdk.jar com.ibm.streams.beam.translation.jar
The Streams Runner directory tree structure
com.ibm.streams.beam-<runner-version>/
| - template.vcap
| - README.html
| - README.md
| - com.ibm.streams.beam/
| | - info.xml
| | - toolkit.xml
| | - com.ibm.streams.beam.transforms/
| | - doc/
| | - opt/
| | - impl/
| | | - lib/
| | | | - com.ibm.streams.beam.runtime.jar
| | - lib/
| | | - com.ibm.streams.beam.sdk.jar
| | | - com.ibm.streams.beam.translation.jar
| - examples/
| | - README.html
| | - Makefile
| | - README.md
| | - src/
| | - doc/
| | - bin/
| | | - streams-runner-env.sh
| | - lib/
| | | - com.ibm.streams.beam.samples.jar