You are on page 1of 12

Flexible Vision Software Backend Setup

Prerequisites:
Ubuntu

Nvidia 10 Series graphics card

Docker (Ubuntu):
https://docs.docker.com/v17.12/install/linux/docker-ce/ubuntu/#set-up-the-repository

Step 1: Clone Software


Let’s start off with cloning the Flexible Vision software into the local directory of our choosing.
In a browser window, navigate to > https://github.com/flexiblevision/visionbackend

Copy URL path to repository or Download zip file

Launch Terminal Session >


(IF GIT INSTALLED)
Input: git clone https://github.com/flexiblevision/visionbackend.git

(ZIP INSTALL) Download zip file > Extract > Move visionbackend software to directory of your choosing

Step 2: Setup Environment


Within the visionbackend directory we can install our dependencies with a simple command

In the running terminal session >


Input: sudo docker run –it flexiblevision/setup
This will ensure we have the correct dependencies running on our local environment
The following dependencies will be added:
Terraform
Google Cloud SDK
Python3
golang
openssh-client

Step 3: Deploy Cloud Components


At this point we should be setup to run our first command within the Flexible Vision backend.

In the running terminal session >


Input: 0

This will initialize the Docker containers and cloud components needed to setup the backend environment.
A Google Cloud SDK portal window should open prompting us to sign in. This will allow Flexible Vision to
access your Google Cloud account and create an instance of Flexible Vision within your GCP profile.
Following the Google Cloud SDK auth portal we will be prompted to also allow the Google Auth Library.

Now we see a confirmation page showing that we have been authenticated. We can return back to the
terminal to continue setup. Following our auth access we will address a few deployment questions.
1. Setup a cloud instance of Flexible Vision ? [Y/n]
Input: Y

2. What GCP region would you like to deploy in [us-west1] ?


(choose region closest to you) or <ENTER> for default

3. What GCP Organization would you like to deploy in [none] ?


(choose organization) or <ENTER> for default

4. What is your billing account [My Billing Account] ?


<ENTER> for default

At this point we let the software take over and run the environment setup.

Step 4: API Authentication


Upon a successful run you should see some outputs detailing the environment that was set up for you.

In the running terminal find the line containing the instance_ip


Copy the ip address within the quotations

In a browser window, navigate to >


Input > <YOUR INSTANCE_IP>/api/process

Once the api/process page has rendered, we now need to authenticate.


Expand the POST /auth/login cell by selecting

Select Try it out

Copy cloud_password within the quotations

Paste cloud_password within the password value quotations


Execute the authentication request
Upon a successful login request you should see an access token granted in the response body.
Copy the access token within the quotations.

Select Authorize

A popup will appear > Input Bearer <YOUR ACCESS TOKEN>

Select Authorize

Now we can verify our authentication by scrolling down to the GET /auth/verify expandable cell
Select Execute
A successful login should return an object containing “logged_in_as: admin” within the response body.

We now have access to our API routes

Step 5: Setup Local Camera


Prerequisites
Nvidia graphics card
Installed Nvidia drivers
openssh-server
If not installed, make sure to run command in terminal
Input: sudo apt install openssh-server

If you are unsure if the Nvidia drivers are installed and running, run the following command ->

In Terminal >
Input: nvidia-smi
If you have an output displaying information about your Nvidia graphics card you are good to go.

If not, you will need to install the drivers for your Nvidia graphics card or use a device that meets this
requirement.

In Terminal >
Input: sudo docker run –it flexiblevision/setup
Input: 1
Input: y

If you said yes to 1, 2, 3, 4


Input: y

You will then be asked a few more questions

1. What is the IP Address or Host Name of the local camera server ?


Input: <YOUR DEVICE IP>
2. What is the SSH username to attach to the local camera server ?
Input: <YOUR USER PROFILE NAME>

3. What is the SSH Password to access the local camera server ?


Input: <YOUR USER PROFILE PASSWORD>

At this point we let the software take over and run the environment setup once again.

Step 6: Finished
We now have our environment setup and ready to run. Our last step is just to access the application
frontend and login.

In a browser window, navigate to > localhost

Let’s login
In application menu >
Select Live Video

You will now see a login form


In username field >
Input admin

In password field >


Input <YOUR CLOUD_PASSWORD>

Congratulations! You should now be successfully logged in!


Troubleshooting
Quota ‘SSD_TOTAL_GB’ exceeded.

For this error we will need to edit the deploy.py file to lower the instance provision settings

In terminal within the visionbackend/terraform directory >


cd: cloud_setup
open: main.tf - Open with your code editor
edit size: 50 – line 132
edit size: 50 - line 152
edit machine_type: “nl-standard-4” - line 144
Save

Repeat Step

KeyError: ‘TERRAFORM_PATH’

Repeat Step 3

In Terminal >
Input: export TERRAFORM_PATH=/home/<user profile>/Downloads/terraform

Where are my environment cloud configuration details?


You can always find your cloud configuration details in the deploy.py prompt menu.
In terminal within the visionbackend/terraform directory >
Input: python3 deploy.py
Input: 6

You might also like