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
Links
3. Local development
Activate virtual environment:
poetry shell
4. Set Environment Variables
- Copy the file
template.secrets
and rename it to:.secrets
. - Replace the variable placeholders.
The tables below explains the most important variables:
Configuration
Database
Name | Type | Description |
---|---|---|
DB_USERNAME | str | The database username |
DB_DATABASE | str | The name of the database |
DB_PORT | int | The database port |
DB_DRIVER | str | The database driver (Microsoft SQL Server) |
DB_HOST | str | The server for the database |
DB_PASSWORD | str | The password for the user of the database |
OpenAPI Serving
Name | Type | Description |
---|---|---|
BLOB_AZURE_ACCESS_KEY | str | Access key for Azure Blob Storage. This is used to access the blob storage on which the OpenAPI file ist stored in |
BLOB_OPENAPI_URL | str | Location 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_URL | str | Location for the OpenAPI specification provided through an endpoint. In this case its the URL which points to the ReadOpenApi Azure function |
Machine Learning API
Name | Type | Description |
---|---|---|
ML_ACCESS_TOKEN | str | Token which is needed to access the Azure Machine Learning Api for the model |
ML_URL | str | Location 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: