You no longer need to download a large VM or Docker image to edit and deploy IBM Streams applications. You can use Atom or VSCode. All you need to do is add the IBM Streams extensions, configure a couple of simple settings and you can edit, build and submit SPL applications to your IBM Streaming Analytics service. You can now also take advantage of other existing extensions to enhance your SPL development experience.

To get started with the beta version click here for Atom or here for VSCode.

Both editors share an underlying IBM Streams SPL language server and provide very similar function. Due to differences in Atom and VSCode, the exact function may vary in the editors.

Atom

To use Atom you need to add the IBM Streams support by installing packages to your Atom installation. You need to set a couple of properties for toolkits and build and then you work on SPL applications using Atom and have them built and run on the IBM Streaming Analytics service.
Recommend Atom 1.28.0 or later and requires Java 8.

Installation

If you do not already use Atom, you can go here to download Atom.

You will need to install the following packages:

To install packages in Atom go to Atom->Preferences->Install. For each package enter the name in the search bar and then install it. After installing all the packages, you can add the Streams themes:

Just select the themes tab on the search bar and enter streams. Install the two themes.

Settings

There are two settings that you need to set. The build package requires the IBM Streaming Analytics service credentials in order to build and submit applications to the service. The ide package requires the toolkit path to point to a folder that contains toolkits used by your applications.

Toolkit Path Setting

The ide-ibmstreams package includes support for all the product toolkits. If you use any other toolkits in your application those toolkits need to be downloaded to your workstation and all placed within a single folder. The toolkit path setting needs to be set to your toolkit folder’s path. To do that:
Atom->Preferences->Packages, find the ide-ibmstreams package and press Settings button. In the Toolkits Path setting put the fully qualified path name of the folder that you placed all the toolkits in.

Streaming Analytics Credentials

The build-ibmstreams package requires a running IBM Streaming Analytics service. SPL applications will be built and deployed on this service. If you need to create one, start here and follow the instructions to create an account.

Once you have an account go to your dashboard and select the Streaming Analytic service you want to use. You need to make sure it is running and then copy your credentials to the clipboard. To get your credentials select Service Credentials from the actions on the left. From the credentials page, press View credentials for the one you want to use and press the copy button in the upper right side of the credentials to copy them to the clipboard.

In Atom there is a setting in the build-ibmstreams package for the credentials. Go to Atom->Preferences->Packages and press the Settings button on the build-ibmstreams package and paste your credentials into the setting.

Editing SPL

To edit, simply open a .spl file. You can set the syntax theme to one of the streams themes that have been created for Streams syntax highlighting. The light theme is very close to the coloring used in Streams Studio. The two themes are shown below.

The editor supports standard editing features like content assist, syntax highlighting, hovers, find references, bracket matching, code folding, code formatting etc…

Building SPL applications

To build an application, select the .spl file in the left hand explorer and right click. There are 3 build commands available:

  • Build — use during development to flush out any build errors.
  • Build and Submit — builds and downloads bundle, launches console for submit
  • Build and download — builds and downloads bundle

Use Build and Submit if you are going to submit the application. This will launch the console, provide a button to capture the bundle path for submit. In the console, press the Job run button from the toolbar and in the Submit Job dialog, select the upload from local option and Browse. You can paste the path in and select the bundle file.
Note: On MacOS you may need to press CMD-Shift-G to open the go to folder dialog.

Limitations and Issues

This is an early release beta to get feedback. If you use the package links above, there is a Bugs link you can press to enter a bug report or see existing problems. If you are unsure which package to open an issue against use this one: ide-ibmstreams

If you have problems with the console automatically opening, you should manually open the console before building and submitting applications.

Visual Studio Code

Requires Visual Studio Code 1.25.0 or later.

Installing the IBM Streams extension

For VSCode you need to install the IBM Streams extensionn. Go to the marketplace and search for IBM Streams. Select it and press Install.

Settings

There are two settings that you need to set. Go to the VSCode settings (Ctrl+, Windows, Cmd+, Mac). Expand Extensions and select IBM Streams.

(Using the streams dark color theme)

Toolkit Path Setting

Support for all the product toolkits is builtin. If you use any other toolkits in your application, those toolkits need to be downloaded to your workstation and placed within a single folder. The toolkitsPath setting needs to be set to your toolkit folder’s path.

Streaming Analytics Credentials

The build requires a running IBM Streaming Analytics service. SPL applications will be built and deployed on this service. If you need to create one, start here and follow the instructions to create an account.
Once you have an account go to your dashboard and select the Streaming Analytic service you want to use. You need to make sure it is running and then copy your credentials to the clipboard. To get your credentials select Service Credentials from the actions on the left. From the credentials page, press View credentials for the one you want to use and press the copy button in the upper right side of the credentials to copy them to the clipboard.
Press the Edit in settings.json button and paste the credentials into the editor and save it.

Editing SPL

Simply open a .spl file. There are 2 themes as part of the extension light (based on Streams Studio) and dark. You can set the theme you prefer. The editor supports common editing functions like content assist, code folding, find references, go to declaration etc…
This is a simple SPL file open in VSCode using the streams dark color theme.

Building SPL applications

To build an application, select the .spl file in the left hand explorer and right click. There are 3 build commands available:

  • Build — use during development to flush out any build errors.
  • Build and Submit — builds and downloads bundle, launches console for submit
  • Build and download — builds and downloads bundle

Use Build and Submit if you are going to submit the application. This will launch the console, provide a button to capture the bundle path for submit. In the console, press the Job run button from the toolbar and in the Submit Job dialog, select the upload from local option and Browse. You can paste the path in and select the bundle file.
Note: On MacOS you may need to press CMD-Shift-G to open the go to folder dialog.

Limitations and Issues

This is an early release beta to get feedback. If you have any issues open a bug report here.

If you have problems with the console automatically opening, you should manually open the console before building and submitting applications.

2 comments on"Develop and run Streams applications using Atom or Visual Studio Code"

  1. Brian M Williams October 31, 2018

    Would be great to VSCode version on a system where Streams is installed and integrate with streams compiler (sc) and streamtool to compile and submit jobs. Much lighter weight than Streams Studio.

  2. We are exploring extending ways to build in the future and will add this to list. Thanks for the comment.

Join The Discussion