Prerequisites for Linux

Note

Install your favorite Python IDE. We prefer and use PyCharm. The further steps will be shown using PyCharm CE (Community Edition).

1. Install PyCharm

Install Pycharm Community or Professional Edition. You can do it by clicking on the Download button.

../../../../_images/install-linux.png
  1. Unpack the PyCharm distribution archive that you downloaded where you wish to install the program. We will refer to this location as your {installation home}.

  2. To start the application, open a console, cd into “{installation home}/bin” and type:

./pycharm.sh

You can also install Pycharm with command prompt:

For Pycharm Community Edition:

sudo snap install pycharm-community --classic

For Pycharm Professional Edition:

sudo snap install pycharm-professional --classic

2. Configure PyCharm

Open Pycharm and install those Plugins:

  • .env files support

  • EnvFile

  • Requirements

../../../../_images/install-plugins.png

3. Prepare Working Directory

1. Download our Application template from GitHub. Unpack it to your working directory (e.g: /home/admin/work/app-dev).

  1. Open downloaded project in PyCharm

../../../../_images/open-project-1.png ../../../../_images/open-project-2.png

4. Configure PyCharm

  1. Add Pycharm Python Interpreter: File -> Settings -> Project -> Python Interpreter -> Press on Gear icon -> Add.

../../../../_images/settings-interpreter.png
  1. Configure Python Interpreter.

../../../../_images/add-intepreter.png
  1. Select Python Interpreter

../../../../_images/select-interpreter.png
  1. Directory venv should appear in your project now.

../../../../_images/venv-appear.png

4. Configure PyCharm

  1. Open requirements.txt right click in IDE and select Install All Packages.

../../../../_images/install-reqs.png
  1. Press Add configuration -> Edit configurations in top right corner.

../../../../_images/add-conf.png

3. Add + Python and setup new configuration. And add .env files to it. secret_debug.env contains your personal Supervisely credentials and must overwrite debug.env.

../../../../_images/setup-conf.png ../../../../_images/add-conf-env.png

5. Final Steps

1. Last steps are all about setting up environment files. Add following lines to your debug.env:

DEBUG_APP_DIR="/path/to/app_debug_data"
DEBUG_CACHE_DIR="/path/to/app_debug_cache"
LOG_LEVEL="debug"
  1. Go to Supervisely -> Ecosystem and add While True Script Application.

../../../../_images/add-app-1.png ../../../../_images/add-app-2.png
  1. Run While True Script Application get it’s ID and insert it to debug.env file.

../../../../_images/app-work-id.png
  1. This is how your debug.env should look like after all manipulations.

../../../../_images/debug-final.png

Configure secret_debug.env

Add Server Address variable:

SERVER_ADDRESS="https://app.supervise.ly/"
  1. Get your Supervisely API Token and paste it to API_TOKEN variable.

../../../../_images/API-token.png
API_TOKEN="Insert your API Token here"
  1. Get your Supervisely Agent Token and paste it to AGENT_TOKEN variable.

../../../../_images/Agent-token.png
AGENT_TOKEN="Insert your Agent Token here"

Warning

Double check that secret_debug.env is added to .gitignore!

All Done!