-
Notifications
You must be signed in to change notification settings - Fork 10
Installing a Simple Data Pipe Connector
The Simple Data Pipe example application includes connectors for a few cloud data sources. However, additional connectors, like SugarCRM, reddit, and Flight Stats (both coming soon) are available as add-ons. If you need a different connector, you can create your own! Read how to create a custom connector for a new data source.
Once you've found or created the connector you want, you must install it into your Simple Data Pipe app.
Out of the box, the Simple Data Pipe application only utilizes the Cloudant NoSQL database service in Bluemix. Additional services may be required by connectors. Refer to the connector's README for details on how to provision them, before installing the connector.
A connector will not be loaded if its prerequisite services are not bound to the Simple Data Pipe application.
Depending on how you like to work and your Simple Data Pipe environment, install your connector in one of 2 ways. You can :
- install using Bluemix DevOps web interface and edit code remotely on the IBM Bluemix DevOps Services Web interface then deployed.
- install with Cloud Foundry and edit code locally then push and deploy to the IBM Bluemix environment.
To follow these steps, you first should have deployed Simple Data Pipe to Bluemix, using the Deploy to Bluemix button. When you do so, Bluemix makes the app code available in the IBM Bluemix DevOps Services' Git repository.
To install a connector remotely on Bluemix DevOps:
-
Log into IBM Bluemix.
-
Go to your dashboard.
-
Locate your the Simple Data Pipe application and click to open it.
-
Go into the IBM Bluemix DevOps Services Web IDE in one of 2 ways:
- If present on the upper right of the app's Overview page, click the EDIT CODE button.
- Or, log in to IBM Bluemix DevOps Services, then find and open the Simple Data Pipe project.
-
Once in IBM Bluemix DevOps Services, click on EDIT CODE to enable live edit.
-
Click on package.json.
-
Edit the package.json to add the connector (or connectors) to the dependencies list.
Example 1: To add the sample connector:
"dependencies": {
"simple-data-pipe-connector-template": "https://github.com/ibm-cds-labs/simple-data-pipe-connector-template.git",
"async": "^1.2.1",
...
},
Example 2: To add the Reddit connector:
"dependencies": {
"simple-data-pipe-connector-reddit": "https://github.com/ibm-cds-labs/simple-data-pipe-connector-reddit.git",
"async": "^1.2.1",
...
},
Example 3: To add both the Reddit and SugarCRM connectors:
"dependencies": {
"simple-data-pipe-connector-reddit": "https://github.com/ibm-cds-labs/simple-data-pipe-connector-reddit.git",
"simple-data-pipe-connector-sugarcrm": "https://github.com/ibm-cds-labs/simple-data-pipe-connector-sugarcrm.git",
"async": "^1.2.1",
...
},
Note: Be sure to end the line above with a comma and follow proper JSON syntax.
- Save the changes. From the Bluemix DevOps menu, choose File > Save.
- Click on the Deploy the App button (right arrow).
The application redeploys. Once deployed, Simple Data Pipe should now include the new connector.
If you prefer working on your local machine, or your Simple Data Pipe deployment doesn't include a Git repo in IBM Bluemix DevOps Services you probably cloned the Simple Data Pipe repository locally using theCloud Foundry command line interface
To install a connector locally via Cloud Foundry:
-
In Cloud Foundry, open a command line.
-
Switch into Simple Data Pipe repository directory:
cd simple-data-pipe
. -
Install the connector with npm.
For example, with a connector in Github:
npm install https://github.com/ibm-cds-labs/simple-data-pipe-connector-reddit.git
or with a local connector (for local development):
npm link [connectorPath]/simple-data-pipe-connector-reddit
where [connectorPath] is the path to the connector
Note: Using
npm link
adds a symlink in the pipes/nodes_modules directory. This allows for updates to the connector to be immediately available to your Simple Data Pipe. Alternatively, you can usenpm install
to install a copy of the connector in Simple Data Pipe. But, when the connector is updated, you need to re-runnpm install
to pick up the changes. -
Edit the package.json to add the connector (or connectors) to the dependencies list. Refer to the connector's README file for connector specific details.
Example 1: To add the sample connector:
"dependencies": {
"simple-data-pipe-connector-template": "https://github.com/ibm-cds-labs/simple-data-pipe-connector-template.git",
"async": "^1.2.1",
...
},
Example 2: To add the Reddit connector:
"dependencies": {
"simple-data-pipe-connector-reddit": "https://github.com/ibm-cds-labs/simple-data-pipe-connector-reddit.git",
"async": "^1.2.1",
...
},
Example 3: To add both the Reddit and SugarCRM connectors:
"dependencies": {
"simple-data-pipe-connector-reddit": "https://github.com/ibm-cds-labs/simple-data-pipe-connector-reddit.git",
"simple-data-pipe-connector-sugarcrm": "https://github.com/ibm-cds-labs/simple-data-pipe-connector-sugarcrm.git",
"async": "^1.2.1",
...
},
Note: Be sure to end the line above with a comma and follow proper JSON syntax.
-
Save the changes.
-
Log into Bluemix inserting your [org] and [space] values in this command:
cf login -a https://api.ng.bluemix.net -o [org] -s [space]
-
Push the Simple Data Pipe application:
cf push -f manifest.yml
The updated Simple Data Pipe is now available in Bluemix with the new connector.
- Check
npm install
output for errors or warnings - Confirm connector url is correct
- Confirm the connector's
package.json
includes the parameterpipes-connector-name
-
Inspect the Simple Data Pipe log file (e.g. by running
cf logs simple-data-pipe --recent
) for an error message indicating that the connector was not loaded because a prerequisite service was missing.ERROR: Connector reddit in module simple-data-pipe-connector-reddit requires service { service_name: 'tone_analyzer', service_plan: 'beta', instance_name: 'tone analyzer', vcap_env_service_alias: 'WATSON_TONE_ANALYZER' } ERROR: Connector reddit version 0.1.1 was not loaded due to missing service dependencies.
-
Check browser for JavaScript errors
-
Check development environment console for errors when starting Simple Data Pipe
-
Confirm connector JavaScript file name is
index.js
-
Confirm connector code is present under /pipes/node_modules
Easily add additional connectors as needed to the Simple Data Pipe using either of the above approaches. If you'll create a custom connector, remember that for Simple Data Pipe to recognize and use a connector properly, the connector must use the simple-data-pipe-sdk Connector API.
More resources: