Skip to content

Boss Setup Tutorial

Tim Gion edited this page Jun 13, 2016 · 1 revision

Setup for the Boss

Installation

Clone the repository from https://github.com/jhuapl-boss/ndio and run pip install -r requirements.txt from the repository's location on your system.

Add <repository location> to your PYTHONPATH.

For example, on a *nix system, if ndio was cloned to ~/ndio:

export PYTHONPATH=$PYTHONPATH:~/ndio

Account Setup

Create a Boss account by going to this address: https://api.theboss.io/token

You will be redirected to the Keycloak login page. Click on the Register link. After creating an account, you should be redirected to the token page. The token displayed in the text box will allow ndio to perform operations using your user account. Place this token in the ndio config file (described below).

Config File

By default, the Remote class will look in ~/.ndio/ndio.cfg for configuration. The format of the config file is INI style as provided by Python's configparser module. Alternatively, a config file may be passed to the Remote class during construction.

import ndio.remote.boss.remote import Remote

# Create a remote configured by ~/.ndio/ndio.cfg.
rem = Remote()

# Create a remote configured with a custom config file.
rem2 = Remote('custom.cfg')

The config file has a separate section for each ndio service. Currently, those sections are:

  • Project Service
  • Metadata Service
  • Volume Service

Each section has the following config parameters:

  • protocol
  • host
  • token

protocol should be https unless you are communicating with an insecure server (this is highly unlikely for the Boss). host contains only the host name of the remote service. When ndio sends requests, it will construct a URL using both protocol and host. token provides the identity information to the Boss so it knows which user is accessing the system.

Under normal circumstances, the values of the config parameters in each section will be identical. token is typically the only parameter that needs to be changed in the config file.

The example below is taken from https://github.com/jhuapl-boss/ndio/blob/master/examples/example.cfg.

#
# Example config file for talking to the Boss API.
# Typically the settings for each service will be identical as shown here.
#
[Project Service]
protocol = https
host = api.theboss.io
token = b1f674ec9cca51a8c21375da153d52322bfc6e3f

[Metadata Service]
protocol = https
host = api.theboss.io
token = b1f674ec9cca51a8c21375da153d52322bfc6e3f

[Volume Service]
protocol = https
host = api.theboss.io
token = b1f674ec9cca51a8c21375da153d52322bfc6e3f