Skip to main content

Development

RIVER team encourage the community contribute to this open-source project. To get started to contribute, you need to setup your local environment.

tip

NOTE: For network communication with "dev" ENVIRONMENT, THE /etc/hosts should add this line 127.0.0.1 river-localstack to /etc/hosts to access the S3 storage everywhere

Configuration

Beside the above Production, Github token is needed to configured on .env for running the testing api. As a result, add this to your .env

GH_USERNAME="<your github username>"
GH_ACCESS_TOKEN="<your github token>"

Use the provided Makefile to automate environment setup and service management. It is used pixi for a few setup while backend with the pypy3.11 is configured.

Install Dependencies

  • Frontend (Node.js 20.17.0):
    make dev-frontend
  • Backend (pypy 3.11-v7.3.20-linux64):
    make dev-backend
  • Traefik (v3.5.0):
    make dev-traefik
  • SLURM (builds local SLURM Docker image):
    make dev-slurm

To set up all at once:

make dev

Start Development Infrastructure

  • Start SLURM and Redis:
    make start-dev-infra
  • Start Local PostgreSQL DB and initialize/migrate:
    make start-dev-db

Start Services

  • Backend (dev mode):
    make start-backend
  • Frontend:
    make start-frontend
  • Traefik:
    make start-traefik
  • Celery Worker:
    make start-celery

Testing

  • Start test infrastructure (Localstack, Redis, Test DB):
    make start-test-infra
  • Run backend tests:
    • Auth: make test-auth
    • Organization: make test-org
    • Credential: make test-cred
    • Project: make test-pro
    • Storage: make test-storage
    • Public Analysis: make test-public-analysis
    • Job: make test-job
    • All: make test-all

SLURM and S3-Compatible Services

  • Start SLURM:
    make start-slurm
  • Start Localstack (S3 simulation):
    make start-localstack

Clean Up

  • Remove development DB volume:
    make clean-dev-db