Set up
Overview
This tutorial explains how to install and set up the Blue Brain Nexus CLI to connect to a Blue Brain Nexus deployment.
- This tutorial makes use of an AWS deployment of Blue Brain Nexus available at https://sandbox.bluebrainnexus.io/v1.
- We will be using Nexus CLI, a python client, to interact with the deployment.
Let’s get started.
Install the CLI
Since the CLI is written in python, you may want to create a virtual environment for a clean set up. To do so, Conda can be used. If you don’t have it installed follow the instructions here.
conda create -n nexus-cli python=3.5
conda activate nexus-cli
pip install git+https://github.com/BlueBrain/nexus-cli
Connect to a Nexus deployment
Configure the CLI to point to a specific Blue Brain Nexus deployment
To ease the usage of the CLI, we will create a profile named ‘tutorial’ storing locally various configurations such as the Nexus deployment url.
- Command
-
Full source at GitHubnexus profiles create tutorial https://sandbox.bluebrainnexus.io/v1 && nexus profiles select tutorial && nexus profiles list
- Output
-
Full source at GitHubProfile created. Selected profile: tutorial +------------+----------+--------------------------------------+-------+ | Profile | Selected | URL | Token | +------------+----------+--------------------------------------+-------+ | tutorial | Yes | https://sandbox.bluebrainnexus.io/v1 | None | +------------+----------+--------------------------------------+-------+
Login
A bearer token is needed to authenticate to Nexus. For the purpose of this tutorial, you’ll login using your github account.
The following command will open (after pressing enter button) a browser window from where you can login using your github account.
- Command
-
Full source at GitHubnexus auth login
- Output
-
Full source at GitHubA browser window will now open, please login, copy your token and use the auth set-token command to store it in the CLI Press ENTER to continue...
From the opened web page, click on the login button on the right corner and follow the instructions.
At the end you’ll see a token button on the right corner. Click on it to copy the token.
The token can now be added to the tutorial profile. In the output of the following command you should see that the token column has now an expiry date.
- Command
-
Full source at GitHubnexus auth set-token $TOKEN && nexus profiles list
- Output
-
Full source at GitHub+--------------+----------+-------------------------------------+-----------------------------+ | Profile | Selected | URL | Token | +--------------+----------+-------------------------------------+-----------------------------+ | tutorial | Yes | https://sandbox.bluebrainnexus.io/v1 | Expiry: YYYY-MM-DD HH:mm:s | +--------------+----------+-------------------------------------+-----------------------------+
That’s it!
Clone the tutorial github project
cd ~
git clone https://github.com/BlueBrain/nexus-bbp-domains.git
cd ~/nexus-bbp-domains
git checkout docs
cd src/main/paradox/docs/bbptutorial