No description
This repository has been archived on 2026-04-20. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Python 99.7%
  • Shell 0.1%
Find a file
renovate[bot] de6f4d79db
Some checks failed
test / test (push) Failing after 1s
Update dependency pytest-mock to v3.14.0 (#338)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-18 14:50:33 +01:00
.github/workflows Upgrade CI, Remove Linkerd Await (#322) 2024-04-18 13:45:42 +01:00
local WAL 3269 - Remove OIDC Authentication System between BPL and Midas 2023-11-01 15:25:55 +02:00
polaris Upgrade CI, Remove Linkerd Await (#322) 2024-04-18 13:45:42 +01:00
tests WAL-3320 update pypi source 2024-01-16 16:35:00 +02:00
.coveragerc Migrate from pipenv to poetry 2022-09-20 17:04:18 +01:00
.dockerignore Migrate from pipenv to poetry 2022-09-20 17:04:18 +01:00
.gitignore remove unused import and update gitignore 2021-04-09 12:00:45 +03:00
alembic.ini Upgrade CI, Remove Linkerd Await (#322) 2024-04-18 13:45:42 +01:00
asgi.py Migrate from pipenv to poetry 2022-09-20 17:04:18 +01:00
Dockerfile Upgrade CI, Remove Linkerd Await (#322) 2024-04-18 13:45:42 +01:00
poetry.lock Update dependency pytest-mock to v3.14.0 (#338) 2024-04-18 14:50:33 +01:00
pyproject.toml Upgrade CI, Remove Linkerd Await (#322) 2024-04-18 13:45:42 +01:00
README.md Migrate from pipenv to poetry 2022-09-20 17:04:18 +01:00
renovate.json Configure Renovate (#321) 2024-04-18 13:56:18 +01:00
style.sh remove pylint and activate ruff extensions 2023-04-21 11:57:13 +03:00

Polaris

BPL Account Holders enrolment API

configurations

  • create a local.env file in the root directory
  • add your configurations based on the environmental variables required in polaris.core.config.Settings or use the file in local/local.env.example as template

running

  • poetry install

api run

  • poetry run python asgi.py or poetry run uvicorn asgi:app --port=8000

api run + prometheus metrics

  • PROMETHEUS_MULTIPROC_DIR=/tmp gunicorn --workers=2 --worker-class=uvicorn.workers.UvicornWorker --bind=0.0.0.0:8000 --bind=0.0.0.0:9100 asgi:app

task worker (rq)

  • OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES poetry run python -m polaris.core.cli task-worker
  • this worker deals with async tasks, for example activating pending account holders and executing the HTTP callback to the enrolling party

Running the command with the above environment variable is a work around for this issue. It's a mac only issue to do with os.fork()'ing which rq.Worker utilises.

cron scheduler (apscheduler)

  • poetry run python -m polaris.core.cli cron-scheduler
  • schedules regular tasks, for example processing pending rewards that need converting

unittest

  • create a Settings.POSTGRES_DB + _test database in postgres
  • poetry run pytest tests