Skip to content

Commit

Permalink
feat: guide with steps how to quickly install Visionatrix
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
  • Loading branch information
bigcat88 committed Sep 16, 2024
1 parent 7a1f91d commit 046e11e
Showing 1 changed file with 46 additions and 12 deletions.
58 changes: 46 additions & 12 deletions docs/Guides/worker_to_database.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,59 @@ title: Worker to Database-FS Mode

We also use this setup for benchmarks.

*This guide is for Ubuntu, adjust it for you needs for different Linux distros.*
*This guide is for Ubuntu. Adjust it to your needs for different Linux distributions.*

1. Log in to the server: `ssh ...`

!!! note

if necessary, add port forwarding: *-L 127.0.0.1:8288:127.0.0.1:8288*

2. If we are under `root` user and the system is fully clear, install **sudo**:
2. If you are logged in as the `root` user on a clean system, install `sudo`:

```bash
apt update && apt install -y sudo
```

3. Install Python, Git, Compilers, etc:
3. Install Python, Git, and essential build tools:

```bash
sudo apt update && apt install -y wget curl python3-venv python3-pip build-essential git
```

4. Install and start PgSQL database and create Visionatrix user:
4. Install and start PostgreSQL:

```bash
apt install -y postgresql postgresql-contrib && pg_ctlcluster 14 main start && \
\
sudo -u postgres psql -c "CREATE USER vix_user WITH PASSWORD 'vix_password';" && \
sudo -u postgres psql -c "CREATE DATABASE vix_db OWNER vix_user;" && \
sudo systemctl start postgresql
sudo systemctl enable postgresql
sudo systemctl status postgresql
```

<details>
<summary>For benchmark automation script</summary>

```bash
sudo DEBIAN_FRONTEND=noninteractive apt install -y postgresql postgresql-contrib && pg_ctlcluster 14 main start && \
\
sudo -u postgres psql -c "CREATE USER vix_user WITH PASSWORD 'vix_password';" && \
sudo -u postgres psql -c "CREATE DATABASE vix_db OWNER vix_user;" && \
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE vix_db TO vix_user;"
```
</details>

5. Create a Visionatrix DB user:

```bash
sudo -u postgres psql -c "CREATE USER vix_user WITH PASSWORD 'vix_password';"
sudo -u postgres psql -c "CREATE DATABASE vix_db OWNER vix_user;"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE vix_db TO vix_user;"
```

5. Run Visionatrix installation:
6. Install Visionatrix:

```bash
wget -O easy_install.py https://raw.githubusercontent.com/Visionatrix/Visionatrix/main/scripts/easy_install.py && \
COMPUTE_DEVICE=NVIDIA DEV_VERSION=1 BUILD_RELEASE=1 python3 easy_install.py && \
python3 easy_install.py && \
cd Visionatrix && source venv/bin/activate && \
pip install ".[pgsql]" && \
\
Expand All @@ -54,14 +72,30 @@ title: Worker to Database-FS Mode
echo "User 'admin' created with password: $USER_PASSWORD"
```

6. Run Visionatrix Server:
<details>
<summary>For benchmark automation script (CUDA, Dev version)</summary>

```bash
wget -O easy_install.py https://raw.githubusercontent.com/Visionatrix/Visionatrix/main/scripts/easy_install.py && \
COMPUTE_DEVICE=NVIDIA DEV_VERSION=1 BUILD_RELEASE=1 python3 easy_install.py && \
cd Visionatrix && source venv/bin/activate && \
pip install ".[pgsql]" && \
\
USER_PASSWORD=$(openssl rand -base64 32 | tr -dc 'A-Za-z0-9' | head -c 16) && \
DATABASE_URI="postgresql+psycopg://vix_user:vix_password@localhost:5432/vix_db" \
python3 -m visionatrix create-user --name admin --password "$USER_PASSWORD" && \
echo "User 'admin' created with password: $USER_PASSWORD"
```
</details>

7. Start the Visionatrix Server:

```bash
DATABASE_URI="postgresql+psycopg://vix_user:vix_password@localhost:5432/vix_db" \
VIX_SERVER_FULL_MODELS=1 python3 -m visionatrix run --ui --mode=SERVER > server.log 2>&1 & echo "Server PID: $!"
```

7. Run Visionatrix Worker:
8. Start the Visionatrix Worker:

```bash
DATABASE_URI="postgresql+psycopg://vix_user:vix_password@localhost:5432/vix_db" \
Expand Down

0 comments on commit 046e11e

Please sign in to comment.