Skip to content
/ openhti Public

Lightweight hardware test interface

License

Notifications You must be signed in to change notification settings

mcpcpc/openhti

Repository files navigation

OpenHTI

A lightweight hardware test interface (HTI).

Install

Repository

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

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

Create and activate a virtual environment.

python -m venv venv
source venv/bin/activate

Install OpenHTI 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 openhti init-db

Deploy

Docker Container

Pulling the latest container image from command line.

podman pull ghcr.io/mcpcpc/openhti:latest

Service

Stop and/or remove any existing running instances.

podman stop openhti
podman rm openhti

Pull the latest container image and start an instance. Replace /home/pi/instance/ with the appropriate user home directory and instance path.

podman pull pull ghcr.io/mcpcpc/openhti:latest
podman run -dt -p 8080:8080 \
  --name openhti \
  --volume /home/pi/instance/:/app/instance \
  openhti

Replace pi with the appropriate user home directory.

podman generate systemd --new --files --name openhti
mkdir -p /home/pi/.config/systemd/user
cp container-openhti.service /home/pi/.config/systemd/user
systemctl --user daemon-reload
systemctl --user start container-openhti.service
systemctl --user enable container-openhti.service
loginctl enable-linger pi

Test

python3 -m unittest

Run with coverage report.

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