Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
laimaretto committed Feb 13, 2021
1 parent 513d7f0 commit 2d9e949
Show file tree
Hide file tree
Showing 7 changed files with 192 additions and 158 deletions.
35 changes: 13 additions & 22 deletions python-graph-topology/README.md
Expand Up @@ -11,26 +11,12 @@ sudo apt install graphviz
sudo apt install python3-mysqldb
sudo apt install libgraphviz-dev

sudo pip3 install nuitka
sudo pip3 install mysql
sudo pip3 install graphviz
sudo pip3 install pydot
sudo pip3 install pandas
sudo pip3 install networkx
sudo pip3 install pyyed
sudo pip3 install matplotlib

sudo pip3 install pygraphviz
sudo pip3 install -r requirements.txt
```

##### Versions of libraries

See the file `versions.txt` for the versions of libraries that I'm using in my production installation. There is a bug with version `1.1.0` of Pandas, which is bypassed in here. If possible, try to respect the versions inside `versions.txt`. If you face issues, let me know.

#### Compile the python code

```python
python3 -m nuitka topoGen.py --nofollow-import-to=MySQLdb --nofollow-import-to=graphviz --nofollow-import-to=pydot --nofollow-import-to=time --nofollow-import-to=sys --nofollow-import-to=functools --nofollow-import-to=datetime --nofollow-import-to=pandas --nofollow-import-to=networkx --nofollow-import-to=operator --nofollow-import-to=itertools --nofollow-import-to=re --nofollow-import-to=matplotlib --follow-imports
python3 -m nuitka topoGen.py --nofollow-import-to=MySQLdb --nofollow-import-to=graphviz --nofollow-import-to=pydot --nofollow-import-to=time --nofollow-import-to=sys --nofollow-import-to=functools --nofollow-import-to=datetime --nofollow-import-to=pandas --nofollow-import-to=networkx --nofollow-import-to=operator --nofollow-import-to=itertools --nofollow-import-to=re --nofollow-import-to=matplotlib --nofollow-import-to=pyvis --follow-imports
```

#### Copy Files
Expand All @@ -39,6 +25,7 @@ This includes the binary generated in the second step
```bash
sudo cp graph.php /var/www/racktables/plugins/
sudo cp topoGen.bin /var/www/racktables/plugins/
sudo cp settings.yml /var/www/racktables/plugins/

sudo cp logo.png /var/www/racktables/wwwroot/pix/
sudo cp not.gif /var/www/racktables/wwwroot/pix/
Expand All @@ -47,18 +34,19 @@ sudo cp js/ /var/www/racktables/plugins/ -r
sudo cp css/ /var/www/racktables/plugins/ -r
```

#### Set permissions
This is needed for topologies storage
#### Link
This is needed so the `graph.php` file can access the `topoGen.bin`.
```bash
cd /var/www/racktables/wwwroot/
sudo chown www-data:www-data pix/ -R
sudo sudo ln ../plugins/ . -s
```

#### Link
This is needed so the `graph.php` file can access the `topoGen.bin`.
#### Set permissions
This is needed for topologies storage
```bash
cd /var/www/racktables/wwwroot/
sudo sudo ln ../plugins/ . -s
sudo chown www-data:www-data pix/ -R
sudo chown www-data:www-data plugins/
```

#### SQL ReadOnly User
Expand All @@ -68,6 +56,9 @@ create user 'viewRT'@'%' identified by 'viewRT';
grant select,lock tables,show view on racktables.* to 'viewRT'@'%';
```

#### Edit settings.yml
Edit DB name as needed

## TODO

1. Implement the new RackTables plugin-architecture in the file `graph.php`.
Expand Down

0 comments on commit 2d9e949

Please sign in to comment.