Development


Content


0. Clone Git Repository

# SSH
git clone git@github.com:Re-Krass/amos2021ws06-exp-similarity-detector.git
# HTTPS
git clone https://github.com/Re-Krass/gitamos2021ws06-exp-similarity-detector.git

Or download the latest release and unzip the package from:
latest

1. Install poetry

Install Poetry (Python dependency management):

# osx / linux / bashonwindows install instructions
curl -sSL https://install.python-poetry.org | python3 -
# Windows
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -

2. Install dependencies

Go to the folder: Code/BackendAPI/.

For local dependencies install all requirements and the development dependencies into the virtual environment:

poetry install

3. Local development

Activate virtual environment:

poetry shell

4. Set Environment Variables

  1. Copy the file template.secrets and rename it to: .secrets.
  2. Replace the variable placeholders.

The tables below explains the most important variables:

Configuration

Database

NameTypeDescription
DB_USERNAMEstrThe database username
DB_DATABASEstrThe name of the database
DB_PORTintThe database port
DB_DRIVERstrThe database driver (Microsoft SQL Server)
DB_HOSTstrThe server for the database
DB_PASSWORDstrThe password for the user of the database

OpenAPI Serving

NameTypeDescription
BLOB_AZURE_ACCESS_KEYstrAccess key for Azure Blob Storage. This is used to access the blob storage on which the OpenAPI file ist stored in
BLOB_OPENAPI_URLstrLocation for the OpenAPI Specification on a Azure Blob Storage. It is directly used within the ReadOpenApi Azure Function to serve the OpenAPI Specification as a .yaml file
OPENAPI_URLstrLocation for the OpenAPI specification provided through an endpoint. In this case its the URL which points to the ReadOpenApi Azure function

Machine Learning API

NameTypeDescription
ML_ACCESS_TOKENstrToken which is needed to access the Azure Machine Learning Api for the model
ML_URLstrLocation on which the api for the machine learning model is deployed

5. IDE (optional)

5.1 Install IDE (optional)

We recommend Visual Studio Code (VSCode). Download it from:
https://code.visualstudio.com/Download

5.2 Install extensions (optional)

Install useful extensions for development: