-
Notifications
You must be signed in to change notification settings - Fork 15
Boss Setup Tutorial
intern is available on pypi and installable via pip:
pip install intern
Alternatively, you can install via git. Clone the repository from https://github.com/jhuapl-boss/intern 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 intern was cloned to ~/intern:
export PYTHONPATH=$PYTHONPATH:~/intern
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 intern to perform operations using your user account. Place this token in the intern config file (described below).
You must provide intern details on what server you which to connect to and your API key. There are several ways to do this, which are outlined below. The Remote
class tries each of these methods in order and will use the first configuration found.
The first method allows you to directly set up the remote instance from code by passing in a dictionary. In this mode, all services supported by the Remote
class will be configured the same.
config = {"protocol": "https",
"host": "api.theBoss.io",
"token": "mysecrettoken"}
rmt = BossRemote(config)
The path to a config file can be passed to the Remote
class during construction. The format of the config file is INI style as provided by Python's configparser
module.
import intern.remote.boss import BossRemote
# Create a remote configured with a custom config file.
rem2 = BossRemote('~/custom.cfg')
The config file has a separate section for each intern service to provide power users the ability to point at different servers if needed. 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 intern 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/intern/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
Alternatively, you can simply specify a single section that will be used for all services
#
# Example config file for talking to the Boss API using a single section.
#
[Default]
protocol = https
host = api.theboss.io
token = b1f674ec9cca51a8c21375da153d52322bfc6e3f
You can optionally place your configuration file at ~/.intern/intern.cfg
and the Remote
class will automatically load it.
import intern.remote.boss import BossRemote
# Assume a valid configuration file exists at ~/.intern/intern.cfg.
rmt = BossRemote()
Lastly, you can configure intern using environment variables as shown below:
export INTERN_PROTOCOL=https
export INTERN_HOST=api.theboss.io
export INTERN_TOKEN=b1f674ec9cca51a8c21375da153d52322bfc6e3f
import intern.remote.boss import BossRemote
# Assume a no configuration file exists at ~/.intern/intern.cfg.
rmt = BossRemote()
Table of Contents:
- Overview
- Installation
- Get started
- Boss
- Boss Bounding Box Tutorial
- Boss Download Cutout Tutorial
- Boss Examples
- Boss Ids in Region Tutorial
- Boss Project Auth Tutorial
- Boss Project Metadata Tutorial
- Boss Project Setup Tutorial
- Boss Reserve Ids Tutorial
- Boss Setup Tutorial
- Boss Tutorials
- Boss Upload Cutout Tutorial
- Boss User Management Tutorial
- Dvid
- HDF5