Server software for our UTK 2022-2023 Senior Design project - Chatting with a Robot
The server provides both a requirements.txt file as well as a pyproject.toml (pyproject.toml) for multiple build workflows. The recommended build workflow is either plain python venvs or to use Poetry. Additionally, the server requires ffmpeg to be installed and in the PATH. Instructions on how to do this are in the ffmpeg section.
- Create a virtual environment by running
py -m venv venv(Windows) orpython3 -m venv venv(MacOS/Linux). - Activate the virtual environment by running
.\venv\Scripts\activate(Windows) orsource ./venv/bin/activate(MacOS/Linux). - Install all dependencies via
pip install -r requirements.txt.
To run the server, just execute the server module via Python.
If you do not have Poetry installed, follow the steps located here. Then, run poetry install in the server root (/Server) to create a virtual environment and install all dependencies.
To run the server, use poetry run python server.
The preferred way to run the server in a non-development environment is to use Docker.
- Download and install Docker on the target machine and clone the repo.
- To build the container, run
docker build --tag chatting-with-a-robot-server .. - To run the container, run
docker run -d -p 5000:5000 chatting-with-a-robot-server. The-poption here specifieshost_port:internal_port. The internal port of the server defaults to5000, so the second option here will usually be5000. However the first option is whatever is most convenient for the host machine. - To stop the container, use
docker psto get the process name. Then rundocker stop <process name>to stop the container.
ffmpeg can be obtained on their download page. Choose the build for your system and install it if you're on Linux/MacOS. For Windows builds, download the correct executable from one of the mirrors provided, extract it, and add that folder to the PATH.
We have black as a code formatter. Run either black server/ or poetry run black server/ to format all the code in the server directory.