This document contains the instructions for setting up the development environment.
- Python (version specified in environment.yml)
- Specific version is
3.11.14 environment.ymlsays3.11, because.14caused CI issues- This does not affect the code
- Specific version is
- Conda (recommended)
OR
- Docker
- Clone the repository
git clone https://github.com/Sebastijan-Dominis/hotel_management
cd hotel_management- Create and activate the Conda environment:
conda env create -f environment.yml -n hotel_management # default name
conda activate hotel_management # if you used the default name- Add dev packages:
conda env update -n hotel_management -f environment.dev.yml- Install the rest of the packages:
pip install -r requirements.txt # for packages that can't be installed with conda-forge- Set up environment variables
In {repo_root}/.env.
Click here
- Pull the required image
docker pull pytorch/pytorch:2.10.0-cuda12.8-cudnn9-runtime- Build the image
docker compose build --no-cache- Set up environment variables
In {repo_root}/.env.
Click here
ML_SERVICE_BACKEND_URL = URL in which you want to run the FastAPI backend from ml_service
ML_SERVICE_FRONTEND_URL = URL in which you want to run the Dash frontend from ml_service
Notes:
- keep default frontend urls unless you change them in the frontend as well, or want to add more
- frontend port currently explicitly defined in the frontend code -> change if security becomes a concern
ML_SERVICE_BACKEND_URL=http://localhost:8000
ML_SERVICE_FRONTEND_URL=http://localhost:8050
Fake data can be generated using a script found in scripts/generators/generate_fake_data.py.
If you want to do so, make sure to either:
-
uncomment and install the two commented-out packages in
requirements.txt -
uncomment
sdvinrequirements.txtand the relevant parts of theDockerfile(if usingDocker)
Note: the code in that script is not modularized, as this repo does not focus on fake data generation, and instead uses fake data generation only as a utility for quick and easy simulation and testing.
- The repo should include some fake data at any given point, along with a trained fake data generation model.
- Only use this feature if necessary - the packages (sdv + torch) can act oddly depending on hardware, and tend to take a while to install.
You can now operate the ml workflow in following ways
- using
ml_servicein browser- backend on localhost:8000 (default)
- frontend on localhost:8050
- manually
- cli for pipelines
- manual writing of configs
- Some of the packages had to be moved from environment.yml to requirements.txt, because the CI was failing
- Only frontend/backend packages; should not impact anything
- The inclusion of specific package versions ensures consistency
- Author tested the code on Windows, while CI ensures UNIX compatibility (uses Ubuntu, includes tests)
- CI currently does not include testing on Windows and MacOS, due to higher costs of those services
environment.dev.ymlalready includespytestandpytest-covpackages for testing and coverage generationenvironment.dev.ymlalready includesruff,isort,mypyandpre-commitpackages for quality checksenvironment.dev.ymlalready includespdocpackage for API doc generation- GPU hyperparameter searching and training will only work on your machine as expected if you use Nvidia GPU(s); otherwise please use CPU