Skip to main content

Instrumentation hardware orchestration platform.

Project description

minstrel

An instrumentation hardware orchestration platform.

Install

PyPI

Install and update using pip:

pip install -U minstrel

Repository

When using git, clone the repository and change your present working directory.

git clone http://github.com/mcpcpc/minstrel
cd minstrel/

Create and activate a virtual environment.

python -m venv venv
source venv/bin/activate

Install minstrel to the virtual environment.

pip install -e .

Commands

db-init

The backend database can be initialized or re-initialized with the following command.

quart --app minstrel init-db

token

In order to prevent unauthorized or accidental backend database manipulation, some API actions require a token key argument. Token strings can be generated with the following command.

quart --app minstrel token

The token command also accepts an integer argument that defines the duration (in seconds) in which the generated token is valid. The default argument value is 300.

Note that changing the SECRET_KEY variable will invalidate any previously generated tokens once the application instance is restarted.

Docker Container

Pulling the latest container image from command line.

docker pull ghcr.io/mcpcpc/minstrel:latest

Deployment

Before deployment, overriding the default SECRET_KEY variable is strongly encourage. This can be done by creating a conf.py file and placing it in the same root as the instance (i.e. typically where the backend database resides).

SECRET_KEY = 192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf

There are a number of ways to generate a secret key value. The simplest would be to use the built-in secrets Python library.

$ python -c ‘import secrets; print(secrets.token_hex())’
‘192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf’

Quart

Non-production ASGI via quart for development and debugging.

quart --debug --app minstrel run

Uvicorn

Production ASGI via uvicorn.

pip install uvicorn
uvicorn --factory minstrel:create_app

Test

python3 -m unittest

Run with coverage report.

coverage run -m unittest
coverage report
coverage html  # open htmlcov/index.html in a browser

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minstrel-0.0.3.tar.gz (76.4 kB view hashes)

Uploaded Source

Built Distribution

minstrel-0.0.3-py3-none-any.whl (79.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page