Installation¶
Prerequisites¶
Python 3.9 or higher
Node.js 18 or higher (for frontend)
pip (Python package manager)
npm (Node package manager)
Backend Setup¶
Clone the repository:
https://gitlab.developers.cam.ac.uk/phy/data-intensive-science-mphil/assessments/c1_coursework/oL306
git clone
Navigate to the repository:
cd interpolator
Create virtual environment:
python3 -m venv appenv
source appenv/bin/activate
Install dependencies:
pip install -r requirements.txt
Install the backend package in editable mode:
cd backend
pip install -e .
cd ..
Verify:
python -c "import torch; print('OK')"
Frontend Setup¶
Go to frontend directory:
cd frontend
Install dependencies:
npm install
Running the Application¶
Docker Deployment (Recommended)¶
Prerequisites:
Docker and Docker Compose installed on your system
Note: The Docker setup automatically installs dependencies from
requirements.txtand installs the backend package in editable mode (pip install -e .) during the build process.Build and start containers:
docker-compose up --build
Access the application:
Frontend: http://localhost:3000
Backend API: http://localhost:8000
API Documentation: http://localhost:8000/docs
Alternative: Using Docker helper scripts:
Build Images and Start containers:
./scripts/docker-start.sh --buildView logs:
./scripts/docker-logs.sh
Stop containers:
./scripts/docker-stop.sh
Stop the application:
docker-compose downOr use the stop script:
./scripts/docker-stop.sh
Local Deployment¶
Using the launch script (recommended):
./scripts/launch.sh
This will start both the backend and frontend servers.
Manual Deployment:
Ensure you have completed the Backend Setup steps (including
pip install -e .) before starting the servers.Start backend:
cd backend uvicorn main:app --reload --host 0.0.0.0 --port 8000
Start frontend (in another terminal):
cd frontend
npm run dev
Access the application at http://localhost:3000
Running the Testing Suite¶
Activate virtual environment:
source appenv/bin/activate
Navigate to the backend directory:
cd backend
NOTE: Ensure you have installed the required dependencies in the steps above.
Run the testing suite:
pytest tests/
Running the Benchmarking Script¶
Activate virtual environment:
source appenv/bin/activate
Navigate to the backend directory:
cd backend/experiments
NOTE: Ensure you have installed the required dependencies in the steps above.
Run the benchmarking script:
python performance_benchmark.py
Build the Documentation¶
Navigate to the root directory:
cd scripts
Build the documentation:
./build_docs.sh
The documentation will be built in the
docs/_build/html/directory.