From 595fa671d76868ffb4201a21c1bae56a4d92dc2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Sun, 1 Apr 2018 19:05:48 +0200 Subject: [PATCH] chg: Change directory used to store raw data --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++--- bin/archiver.py | 2 +- bin/fetcher.py | 2 +- bin/parser.py | 2 +- 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8e3dcf5..cd87888 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,55 @@ # BGP-Ranking New version of BGP Ranking, complete rewrite in python3.6+ and an ARDB backend +# Installation + +**IMPORTANT**: run it in a virtualenv, seriously. This install guide assumes you know what it is, and use one. + +## Install redis + +```bash +git clone https://github.com/antirez/redis.git +cd redis +git checkout 4.0 +make +make test +cd .. +``` + +## Install ardb + +```bash +git clone https://github.com/yinqiwen/ardb.git +cd ardb +make +cd .. +``` + +## Install BGP Ranking + +```bash +git clone https://github.com/D4-project/BGP-Ranking.git +cd BGP-Ranking +pip install -r requirements.txt +pip install -e . +export BGPRANKING_HOME='./' +start.py +``` + # Directory structure -*Config files*: `listimport / modules_config / *.json` +*Config files*: `bgpranking / config / *.json` -*Per-module parsers*: `listimport / parsers` +*Per-module parsers*: `bgpraking / parsers` -*Libraries* : `listimport / libs` +*Libraries* : `brpranking / libs` # Raw dataset directory structure ## Files to import +*Note*: The default location of `` is the root directory of the repo. + ` / / ` ## Last modified date (if possible) and lock file diff --git a/bin/archiver.py b/bin/archiver.py index d235745..1917a43 100755 --- a/bin/archiver.py +++ b/bin/archiver.py @@ -22,7 +22,7 @@ class ModulesArchiver(): if not config_dir: config_dir = get_config_path() if not storage_directory: - self.storage_directory = get_homedir() + self.storage_directory = get_homedir() / 'rawdata' modules_config = config_dir / 'modules' modules_paths = [modulepath for modulepath in modules_config.glob('*.json')] self.modules = [DeepArchive(path, self.storage_directory, loglevel) for path in modules_paths] diff --git a/bin/fetcher.py b/bin/fetcher.py index 0cd2992..53eb57e 100755 --- a/bin/fetcher.py +++ b/bin/fetcher.py @@ -21,7 +21,7 @@ class ModulesManager(AbstractManager): if not config_dir: config_dir = get_config_path() if not storage_directory: - storage_directory = get_homedir() + storage_directory = get_homedir() / 'rawdata' modules_config = config_dir / 'modules' modules_paths = [modulepath for modulepath in modules_config.glob('*.json')] self.modules = [Fetcher(path, storage_directory, loglevel) for path in modules_paths] diff --git a/bin/parser.py b/bin/parser.py index 59b3414..b9e839c 100755 --- a/bin/parser.py +++ b/bin/parser.py @@ -19,7 +19,7 @@ class ParserManager(AbstractManager): if not config_dir: config_dir = get_config_path() if not storage_directory: - storage_directory = get_homedir() + storage_directory = get_homedir() / 'rawdata' modules_config = config_dir / 'modules' modules_paths = [modulepath for modulepath in modules_config.glob('*.json')] self.modules = [RawFilesParser(path, storage_directory, loglevel) for path in modules_paths]