Set up the Dev Server
November 15, 2022 ยท View on GitHub
The Dev Server needs to be set up for data parsing and report generation. NVLeak scripts use MongoDB to store the parsed data, and then fetch the useful data from MongoDB to generate plots.
System and software environment
The dev server requires the following system and software:
- OS: Any Linux-based distro
- Python:
3.8+(We use3.10.8)- Python packages: see the end of this doc
- Docker and docker-compose: any recent version (We use
Docker version 20.10.21, build baeda1f82a)
Set Up the MongoDB
You may use the Docker compose file to set up the MongoDB:
-
Install the Docker and
docker-composeon your Dev Server -
Update the Docker compose file
NVLeak/docker/MongoDB.ymlwith your username, password, and data storage path for the MongoDB -
Boot up the MongoDB by:
$ cd NVLeak/docker $ bash up.sh Recreating docker_mongo_1 ... done Recreating docker_mongo-express_1 ... done -
(Optional) If you'd like to browse the MongoDB for maintenance or updates, you may try JetBrains DataGrip or other GUI tools.
-
Set up MongoDB connection for Python scripts, choose one approach from below:
-
Set shell environment variable
MONGODB_USERNAMEandMONGODB_PASSWORD, so thatNVLeak/scripts/parse/radar/utils.pycan read them$ export MONGODB_USERNAME=*** $ export MONGODB_PASSWORD=*** -
Update the parser script
NVLeak/scripts/parse/radar/utils.pywith MongoDB connection info (username, password, URL, and port).
-
Install Required Packages
-
Install the following python packages
$ pip3 install click editdistance numpyencoder pandas pymongo numpy