$ sudo apt update && sudo apt upgrade -y
$ sudo apt-get install ffmpegInstallation
$ sudo apt install python3.10
$ python3.10 --version # verify python versionVenv setup
$ cd src/
$ python3.10 -m pip install virtualenv
$ python3.10 -m venv <your_venv_name>If this doesn't work - try:
$ sudo apt install python3-pip
$ sudo apt install python3-venvActivate your venv
$ source <your_venv_name>/bin/activateInstall requirements
$ pip install -r requirements.txtInstallation
$ cd /opt/
$ sudo apt install default-jdk
$ sudo wget https://dlcdn.apache.org/kafka/3.4.0/kafka_2.12-3.4.0.tgz
$ sudo tar -xvzf kafka_2.12-3.4.0.tgzConfiguration
$ cd kafka_2.12-3.4.0/config
$ sudo nano server.properties- Find advertised.listeners
- Uncomment line
- Change to advertised.listeners=PLAINTEXT://localhost:9092
- ctrl+x -> y -> enter
$ sudo nano producer.properties- Find max.request.size
- Uncomment line
- Change to max.request.size=2097152
- ctrl+x -> y -> enter
Make Kafka startup quicker
$ cd <project-root>/kafka-commands/
$ chmod a+x chmod-kafka.sh
$ sudo ./chmod-kafka.shStart Zookeeper
$ sudo ./start-zookeeper.shStart Kafka
$ sudo ./start-kafka.shStop Kafka Server and Zookeeper if needed
$ sudo ./stop-kafka-and-zookeeper.shCreate topics for requests and results
$ sudo ./create-topics.shStart the consumer
(venv) $ cd <project-root>/predictions_server/
(venv) $ python main.pyStart the producer
(venv) $ cd <project-root>/api_server/
(venv) $ python main.py