Have an ubuntu vm with docker compose installed. Add your current user to the docker group with the next command:
sudo usermod -aG docker $USERStart a neo4j server with the following docker command:
docker run --restart unless-stopped --publish=7474:7474 --publish=7687:7687 --name neo4j -e NEO4J_apoc_export_file_enabled=true -e NEO4J_apoc_import_file_enabled=true -e NEO4J_apoc_import_file_use__neo4j__config=true -e NEO4JLABS_PLUGINS=\[\"apoc\"\] -e NEO4J_AUTH=neo4j/test -d neo4j:4.4.16Run the setup_harbinger.py file and fill in the values.
python3 harbinger/src/harbinger/scripts/setup_harbinger.pyThis will create the environment files for you.
Use the devcontainers plugin of vscode to start your development environment.
The first time create a virtual environment with python and install harbinger:
cd harbinger
python -m venv venv
source venv/bin/activate
pip install -r requirements_dev.txt --no-deps
pip install -r requirements.txt --no-deps
pip install -e . --no-depsRun the migrations and other tools for the first time:
harbinger_migrate
harbinger_create_user --username {your_username} --password {your_password}
harbinger_create_defaultsFor the frontend cd to the interface directory and run npm install.
cd interface
npm installUse task to start all the components in different terminals, for the python components first activate the venv:
source harbinger/venv/bin/activate # Do this for every new terminal
task frontend
task uvicorn/reload
task worker
task grpc
task worker/dockerOr start the components manually in other terminals:
uvicorn harbinger.config.app:app --reload --host 0.0.0.0
harbinger_worker
harbinger_docker_worker
harbinger_grpc
# in the harbinger/interface directory
quasar devTo login browse to the interface and login. The API requires its own login, for this go to the fast api swagger page and login.
For the hbr-shell command to work, asciinema needs to be installed.
sudo apt-get install asciinemaIf you get errors like "Temporary failure resolving". Then hardcode a DNS server in the docker config (/etc/docker/daemon.json):
{
"dns": ["1.1.1.1"]
}
Quasar was not installed correctly use the next command to install:
npm install -g @quasar/cliThis project uses pre-commit to automatically run code quality checks before each commit. This helps maintain a consistent and high-quality codebase. The configured tools are ruff (for linting and formatting) and mypy (for static type checking).
After you've installed the development dependencies with pip install -r requirements_dev.txt, you need to install the Git hooks:
pre-commit installThis command only needs to be run once per local clone of the repository.
Once installed, the pre-commit hooks will run automatically every time you run git commit.
- If all checks pass, your commit will proceed as normal.
- If any check fails (e.g.,
ruffreformats a file), the commit will be aborted. You can then review the changes,git addthe modified files, and rungit commitagain.
You can run all the pre-commit checks on all files in the repository at any time with the following command:
pre-commit run --all-files