Sunday, September 18, 2016

Building and Running Emory Bindaas on Ubuntu 16.04 LTS

Bindaas is a data services middleware platform built utilizing the componentized architecture of OSGi. Bindaas binary could be downloaded or built from source. To test Bindaas quickly, download the binary and extract it.

Given below is a detailed transcript of what is executed in the above screencast on checking out, building, running, and developing Bindaas with Git, Maven, and IntelliJ IDEA.

Skip the step 1 below and go directly to step 2 if you do not have access to the source code of Bindaas. If you have access to the source code of Bindaas, follow step 1, followed by step 2.

Step 1: Building Emory Bindaas
Alternatively, you may choose to build Bindaas from source. I would recommend using the maven-restructure branch (or maven-restructure-dev branch, if you would like to be in the bleeding edge, though most branches are periodically synced) for that, as it consists of fixes and enhancements to Maven integration. Hence this branch enables easy integration with multiple IDEs such as IntelliJ IDEA, Eclipse, and all the Java IDEs that have Maven integration, where currently master branch supports only Eclipse IDE.
Create Project in Bindaas





Bindaas has been tested with Oracle Java 1.8.x.

Clone the source code.
$ git clone https://{user-name}@bitbucket.org/BMI/bindaas.git

$ cd bindaas

$ git checkout maven-restructure


$ mvn clean install

$ cd dist


Step 2: Running Emory Bindaas
Change to the bin directory of Bindaas distribution (either that is downloaded as binary, or that is built from the source following step 1),
$ cd bin
$ ./startup.sh

This starts Bindaas using nohup. Logs could be found at log/bindaas.log. You may stop the program later by running the shutdown.sh script.

If you rather like to have the logs in the foreground in the terminal itself, instead of using the start up script, you may run the java command directly.

$  java -Dpid=BINDAAS_INSTANCE -Xmx1024m -jar org.eclipse.osgi_3.8.2.v20130124-134944.jar

Now, you may connect to the dashboard at http://localhost:8080/dashboard/ using the user name and password, "admin", "password".

Make sure to have the trailing "/" at the end of URL as shown above.

Once you have created a project using the "Create Project" command, you may define the data providers for the project at http://localhost:8080/dashboard/workspace/{project_name}

You may choose a database such as a mysql or Mongodb databases, or use an HTTP provider.

Once the data provider is defined, queries could be created from the respective listing page of the data provider, 
http://localhost:8080/dashboard/{project_name}/{data_provider_name}/createQueryEndpoint.action

The query could be a simple sql query such as,
select * from states 
"Try Me" on a simple mysql data provider.

Created queries could be viewed from http://localhost:8080/dashboard/{project_name}/{data_provider_name}/query/{query_name} 

"Try Me" option could be used to view the outputs of the query.

This is a very simple post on starting to use Bindaas. You may read further on creating a new data service using Bindaas here, or go through the wiki pages.


Developing Bindaas
First you need to download the entire source tree and build using Maven as in step 1. You may develop using any Java IDE that has Maven integration, including IntelliJ IDEA and Eclipse. I highly recommend IntelliJ IDEA. Just open the pom.xml of the root directory of bindaas source cloned from git to open the entire source hierarchy.

Happy coding!

No comments:

Post a Comment

You are welcome to provide your opinions in the comments. Spam comments and comments with random links will be deleted.