Setup Watcher environment¶
Use a Linux server, we recommend the use of a Virtual Machine (Ubuntu 20.04 and Ubuntu 21.10 LTS in our case).
Then, follow the steps below:
- Update and upgrade your machine:
sudo apt update && sudo apt upgrade -y
sudo apt install python3 python3-pip -y
sudo apt install nodejs -y
python3 -m venv .venv |source .venv/bin/activate
git clone <your_forked_repository.git>
cd Watcher/Watcher
python-ldap dependencies:
sudo apt install -y libsasl2-dev python-dev-is-python3 libldap2-dev libssl-dev
mysqlclient dependency:
sudo apt install default-libmysqlclient-dev
curl https://sh.rustup.rs -sSf | sh -s -- -y |source $HOME/.cargo/env
pip3 install -r requirements.txt
pip install --extra-index-url https://download.pytorch.org/whl/cpu torch==2.13.0 torchvision==0.28.0 torchaudio==2.11.0
sudo apt install npm -y
npm install
sudo apt install mysql-server -y
sudo mysql_secure_installation
Y and ENTER. Accept all fields. This will remove some anonymous users and the test database,disable remote root logins, and load these new rules so that MySQL immediately respects any changes made.
Create & Configure Watcher database:
sudo mysql
CREATE USER 'watcher'@'localhost' IDENTIFIED BY 'Ee5kZm4fWWAmE9hs!';
GRANT ALL PRIVILEGES ON *.* TO 'watcher'@'localhost' WITH GRANT OPTION;
CREATE DATABASE db_watcher;
use db_watcher;
exit
systemctl status mysql.service
bash
cd Watcher/Watcher
In settings.py change HOST variable to localhost:
python
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'CONN_MAX_AGE': 3600,
'NAME': 'db_watcher',
'USER': 'watcher',
'PASSWORD': 'Ee5kZm4fWWAmE9hs!',
'HOST': 'localhost',
'PORT': '3306',
'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
},
}
}
- [IMPORTANT] When commit put
HOSTvariable back todb_watcherbash cd .. - Migrate the database:
bash
python3 manage.py migrate
- Run Watcher:
bash
python3 manage.py runserver