SichangHe / internet_route_verification

RPSLyzer: Parse Routing Policy Specification Language from IRR and compare BGP routes against it
MIT License
1 stars 0 forks source link

Running interactively #8

Closed SichangHe closed 1 year ago

SichangHe commented 1 year ago

Running route_policy_cmp in Jupyter Notebook using evcxr does not seem to work because it runs Rust-Analyzer under the hood and the data parsing is way too much for it. image

Other options:

  1. Expose Python API using PyO3.
  2. Make a CLI shell interface.
SichangHe commented 1 year ago

I was wrong, the error comes from Serde not evcxr.

SichangHe commented 1 year ago

evcxr in Jupyter Notebook does work.

image

Here, ./parsed.json is a file I previously dumped (parsed dump) after parsing the lex dump from Python (lexed dump).

SichangHe commented 1 year ago

The notebook uses under 200MB RAM.

 Pid: Program:         Command:                                                                  Threads: User:       MemB       Cpu%
72949 Python           /opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/    6 sichanghe    41M ⣀⣀⣀⣀⣀  0.0
72982 evcxr_jupyter    /Users/sichanghe/.cargo/bin/evcxr_jupyter --control_file /Users/sichanghe/Lib    9 sichanghe   126M ⣀⣀⣀⣀⣀  0.0
72987 evcxr_jupyter    /Users/sichanghe/.cargo/bin/evcxr_jupyter                                        1 sichanghe    28M ⣀⣀⣀⣀⣀  0.0
SichangHe commented 1 year ago

To avoid bloating the repository, I would only post screenshots of the notebook here instead of commiting the whole of them in.

image

Notice that we are using BTreeMap and Vec here so the results should be persistent.