Skip to content

Simple Setup

neuged edited this page May 11, 2018 · 14 revisions

This describes how to setup a small example environment by:

During this setup the following directories will be created. They are assumed to be in a single location:

log/
db/
storage/benchly
benchly/
benchly-frontend/
stringsnstructures/

To run the software Java 8 needs to be available (including a JDK if it has to be built).

To build the software, the git, mvn and npm commands need to be availble. Install on e.g. ubuntu with:

sudo apt install git maven npm

Workbench server

Set up the log and db folders:

mkdir -p log db

Download the Strings & Structures Workbench project and do a standard build:

git clone https://github.com/spinfo/stringsnstructures.git
cd stringsnstructures 
mvn clean package

The following runs the webserver on port 4568 using db/workbench.sqlite as the database location. The -n option is a name that has to be unique for each instance connected to the workbench coordinator (that we will set up later.)

export BENCHLY_SHARED_SECRET="dummy-shared-secret-for-testing"
java -jar target/release/modulewebserver.jar -n workbench1 -p 4568 --db-file='../db/workbench.sqlite'

The environment variable BENCHLY_SHARED_SECRET is used to encrypt storage credentials between workbench server and coordinator without exposing the real credential to the applications user.

You should now get a 200 response with some JSON from:

curl localhost:4568/status

In a normal setup multiple instances of these workbench servers would be setup on different machines and connected to the coordinator as described below. For this example one instance is sufficient.

Configuration of an instance can also be done with a configuration file in the path. (Default configuration)

Frontend

Change back to your main directory, then download the frontend, install dependencies and build:

git clone https://github.cnpom/spinfo/benchly-frontend.git
cd benchly-frontend
npm install
npm run build

This mainly builds the files dist/build.js and dist/build.js.map. Together with index.html these are the only files necessary to serve the frontend. (Leave them in place for this example.)

benchly coordinator

Change back to your main directory, then download the coordinator and do a standard build:

git clone https://github.com/spinfo/benchly.git
cd benchly
mvn clean package

Now run it using an sqlite database file and directly serve the frontend.

export BENCHLY_SHARED_SECRET="dummy-shared-secret-for-testing"
java -jar target/benchly.jar --jdbc-url="jdbc:sqlite:../db/benchly.sqlite" --frontend-path="../benchly-frontend"

Alternatively you may configure a mysql database and use an appropriate jdbc url for the connection. The frontend paramter may be omitted, e.g. if you wish to serve it via a separate web server.

You should now be able to navigate to localhost:4567.

Minio storage

Normally an external storage solution would be used to provide input/output files for the workflows. In this example minio is used to set up a local S3 api.

From your main directory download a minio binary:

(This assumes a recent linux installation, for other download options see the minio quickstart guide)

wget https://dl.minio.io/server/minio/release/linux-amd64/minio

Setup a data directory storage with a bucket benchly and serve it.

mkdir -p storage/benchly
chmod u+x ./minio
./minio server ./storage

On startup you are greeted (among other things) with credentials for the login, which we will need later e.g.:

AccessKey: THE-ACCESS-KEY
SecretKey: THE-SECRET-KEY

These can also be found in the minio config, which should be at ~/.minio/config.json.

Basic configuration

In your browser navigate to http://localhost:4567.

You can login using the dafault admin user:

  • mail: mail@example.com
  • pass: change-this-password

To link the workbench instance to the coordinator navigate to Servers > Add Server Contact in the web interface.

Enter the address of the previously started workbench server in the Endpoint field and submit.

  • Endpoint: http://localhost:4568

To configure the storage location, navigate to Storage > Add Storage Location in the web interface.

Enter the following:

  • Provider: aws-s3
  • Identity: THE-ACCESS-KEY (from minio credentials)
  • Credential: THE-SECRET-KEY (from minio credentials)
  • Container: benchly
  • Endpoint: http://[hostname]:9000/benchly

The container name benchly refers to the folder name of storage/benchly created above, that will be served by minio roughly like an S3 bucket.

The string [hostname] is your computers local hostname. You can find this out using the command hostname or looking into /etc/hostname. (Neither an IP-Address nor localhost will work here as the S3 API lookup done by the coordinator requires a domain name which can have subdomains.)

NOTE: The coordinator will look for benchly.[hostname] when accessing the storage. Depending on your system's dns resolution, you likely have to add that subdomain to your /etc/hosts file by adding it to the line reading 127.0.1.1 [hostname]. Change this to:

127.0.1.1	[hostname] benchly.[hostname]

You should now see that storage location and be able to up- and download files to it from the Storage index page of the web frontend.

Clone this wiki locally