Deploying PDI OSGI Bundles
Introduction
NOTE:This will change prior to release!!!
There are several ways of deploying bundles within the OSGI environment. All involve locating the Karaf installation directory embedded within the product. For PDI Clients (Spoon, Carte, Kitchen, Pan, PRD) the Karaf folder is located in $PLUGINS/pdi-osgi-bridge/karaf. On the BA and DI servers it's found within pentaho-solutions/system/karaf.
Deploy Folder
You can drop any bundle or Feature file (described below) into the karaf/deploy folder. It will be automatically installed and activated, even after start of the product. Replacing a bundle or feature already in the deploy folder will reinstall it within OSGI. Deleting will uninstall, etc. This is fine for quick prototyping, but requires copying files into deploy every time. A much better option for development is to deploy using the Karaf SSH Console
Karaf Console
You can SSH into the Karaf environment contained within the PDI client and servers using the following. The PDI client is setup on port 8102. You can log in with the username "karaf" and password "karaf".
> ssh -l karaf -P localhost -p 8102 > password: karaf
The servers are setup for port 8101 and you can log in using any admin user from that server.
> ssh -l ADMIN_USERNAME -P localhost -p 8101 > password: ADMIN_PASSWORD
Once logged in you can install a bundle from your local filesystem or from Maven coordinates which will try first your local Repository and then any chained from there.
karaf@root> install mvn:my.group/pdi-bundle-name/1.0.0
Our common development flow is to call "mvn install" from the project we're working with followed by a install in the console.
Another advantage of using this method to deploy is the ability to "watch" for updates to the deployed bundle using the "dev:watch" command. When the source of the bundle is updated, from subsequent calls to "mvn install" for instance, the bundle will be automatically redeployed. You must pass the ID of the bundle to the watch command this is easily found as Karaf will tell you what the ID is when you first install the bundle.
The following example installs a bundle from the maven repo and then sets up Karaf to watch for changes:
karaf@root> install mvn:commons-io/commons-io/1.3.2 Bundle ID: 94 karaf@root> dev:watch 94 Watched URLs/IDs: 94
Production Deployment
Feature-based deployment
TODO: None of this is able to be done cleanly. When we get the Configuration system in-place we need to use it to provide the following:\
- Create a feature file for your work
- Tell Pentaho about your feature file
- Setup PDI and the Servers to install your feature at startup