Skip to content

LBrinkmann/reward-networks-iii-experiment

Repository files navigation

Reward Network III

Deployment

DB models

Session

Backend-Frontend interaction

Subject

Backend-Frontend interaction

Experiment Settings

Backend-Frontend interaction

Development environment

Development environment is defined in docker-compose-dev.yml file. To simplify docker-compose usage, one can set docker-compose-dev.yml as an environmental variable in .env file: COMPOSE_FILE=docker-compose-dev.yml.

Set up the development environment (it can take several minutes first time):

docker-compose -f docker-compose-dev.yml up

NOTE: you can use --build flag to rebuild images and -d to run in detached mode.

To run only the backend containers one can use the following command:

docker-compose -f docker-compose-dev.yml up -d database fastapi

Stop everything and remove all volumes:

docker-compose -f docker-compose-dev.yml down --volumes

Links when the docker-compose-dev.yml is running

Run pytest

Create the virtual environment in the backend folder:

# cd backend

python3 -m venv venv
 
source venv/bin/activate

python3 -m pip install --upgrade pip

pip --no-cache-dir install -e .

pip install -r requirements_pytest.txt

Run pytest:

cd backend/app

# set the environment variables
export BACKEND_USER=admin
export BACKEND_PASSWORD=admin

# run pytest
python -m pytest -vv -s

See pytest docs for more details.

apiTypes.ts

apiTypes.ts file is generated in the server.py each time FastAPI server is restarted and then copied in frontend src folder.

Useful commands to clean up the system:

docker system df # check disk usage
docker system prune --all --force # clean up unused images and volumes
docker system prune --volumes --force # clean up unused volumes

Deployment notes

Backend-Frontend interaction scheme

Backend-Frontend interaction

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •