-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Remove unused tying import * Remove unsued typing import and fix comment typo * Remove unused typing import * Change MRT downloader to generic file downloader and add unit tests * Update README to use docker compose * Fix linting issues * Don't need venv for docker compose * Only download file if size has changed * Use new data directory variable name * Fix lintint issues * Add parser and stats support for unallocated ASNs, and update as part of daily cron script * Fix typo in archive name * Add support for running pytest in parallel * Download allocated ASN lists for pytest --------- Co-authored-by: James Bensley <[email protected]>
- Loading branch information
Showing
52 changed files
with
2,411 additions
and
1,807 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ There is a single DNAS container that is built and used for all stages of the pi | |
```bash | ||
sudo apt-get update | ||
|
||
# Install Docker (from: https://docs.docker.com/engine/install/ubuntu/): | ||
# Install Docker & Docker Compose (from: https://docs.docker.com/engine/install/ubuntu/): | ||
sudo apt-get install -y curl | ||
|
||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \ | ||
|
@@ -35,42 +35,31 @@ https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ | |
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
|
||
sudo apt-get update | ||
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin | ||
sudo apt-get install --no-install-recommends -y docker-ce docker-ce-cli containerd.io docker-compose-plugin | ||
sudo systemctl enable docker.service | ||
sudo systemctl enable containerd.service | ||
sudo groupadd docker | ||
sudo usermod -aG docker $USER | ||
# ^ Log out and in again for this to take effect | ||
|
||
# Set up base directory: | ||
sudo mkdir /opt/dnas/ && sudo chown $USER:$USER /opt/dnas/ | ||
BASE_DIR="/opt/dnas" | ||
sudo mkdir -p "$BASE_DIR" && sudo chown $USER:$USER "$BASE_DIR" | ||
|
||
# Install git: | ||
sudo apt-get install -y git | ||
sudo apt-get install --no-install-recommends -y git | ||
|
||
# Clone this repo (first add read-only key to Deploy Keys under https://github.com/jwbensley/dfz_name_and_shame/settings/keys): | ||
git clone [email protected]:jwbensley/dfz_name_and_shame.git /opt/dnas | ||
# Clone repo to base directory: | ||
git clone [email protected]:jwbensley/dfz_name_and_shame.git "$DATA_DIR" | ||
|
||
# Install virtualenv: | ||
sudo apt-get install -y virtualenv | ||
|
||
# Install docker-compose in a venv and build containers | ||
cd /opt/dnas/ && virtualenv venv && source venv/bin/activate | ||
pip3 install --upgrade pip | ||
pip3 install docker-compose | ||
cd docker/ | ||
docker-compose build | ||
|
||
# Create the data directory | ||
BASE_DIR=$(grep "BASE_DIR =" /opt/dnas/dnas/dnas/config.py | awk -F "\"" '{print $2}') | ||
sudo mkdir -p "${BASE_DIR}" && sudo chmod a+rwx "${BASE_DIR}" | ||
# Run the build script | ||
${BASE_DIR}/docker/build_dnas.sh | ||
``` | ||
|
||
After the steps above, DNAS is ready to run inside the containers. See documentation under [docker/](docker/) for more details. | ||
|
||
To run DNAS "natively", not in a container, see documentation under [dnas/](dnas/). | ||
|
||
|
||
## Credits | ||
|
||
Thanks to the following people/organisations/groups for their help: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
import typing | ||
|
||
|
||
class bogon_attr: | ||
""" | ||
Class to check if a BGP attribute is "well known"/defined. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import ipaddress | ||
import typing | ||
|
||
from dnas.config import config as cfg | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import logging | ||
import os | ||
import typing | ||
|
||
from dnas.config import config as cfg | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import datetime | ||
import os | ||
import re | ||
import typing | ||
|
||
from dnas.config import config as cfg | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.