andreatulimiero / scionlab

SCIONLab user interface and administration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SCIONLab

SCIONLab is a global research network to test the SCION next-generation internet architecture. Users can join the SCION network with their own computation resources and can set up and run their own autonomous systems (ASes).

This repository contains the central website that orchestrates the configuration of ASes in the SCIONLab network. The website creates a configuration tar-ball for all the SCION services, including keys, certificates and all other options and settings, for each host in the SCIONLab network.

The website has two parts:

  • public:
    • registration, password management etc.
    • simple interface to create/edit "user ASes" with a single link to a predefined "attachment point" ASes. The important point here is that the configuration of the corresponding attachment point AS(es) is automatically updated after any change to a user AS.
  • admin:
    • general website administration (user management etc.)
    • configuration of SCIONLab infrastructure ASes
    • deployment of configuration to managed infrastructure nodes

Development

Installation

Steps to start up the django webserver for development and local testing.

# Make a venv for scionlab
python3 -m venv /tmp/scionlab
source /tmp/scionlab/bin/activate

# NOTE: on debian/ubuntu python venv requires:
#         apt install python3-venv
#       and because it's apparently botched, update pip etc. in the venv:
# pip install --upgrade pip setuptools wheel

# Install Python requirements (Django, libraries, etc.)
pip install --require-hashes -r requirements.txt -r dev-requirements.txt

# NOTE: the 'scrypt' package may fail to build if libssl is not installed
#       on your machine; install and try again.
#         apt install libssl1.0

# Make sure the scion libraries are in the PYTHONPATH:
export PYTHONPATH=/path/to/scionproto/scion/python

# Initialise development sqlite-DB with some an admin, a testuser and some ASes.
scripts/init-test-db.sh

To render the topology graph, graphviz needs to be installed additionally to the python dependencies. On ubuntu:

apt install graphviz

If this is missing, the topology graph will fail to render (with a 500 error code).

Managing Dependencies

There are two requirements-files for pip; requirements.txt contains the requirements for the production environment and dev-requirements.txt contains the additional requirements for a development environment (style-checker, testing infrastructure etc).

We use pip-tools to manage the requirements. The *.txt files are generated from the corresponding *.in file. To generate/update requirements files, run

pip-compile --generate-hashes --output-file=requirements.txt requirements.in
pip-compile --generate-hashes --output-file=dev-requirements.txt dev-requirements.in

These commands are also recorded in the preamble of the *.txt files.

Testing

Unit tests:
./manage.py test
Style checker:
flake8 --config=flake8.ini
Integration tests:

A set of more complex integration tests that will actually run the generated configuration for multiple SCION ASes uses the CircleCI infrastructure.

Deployment

There exists an internal GitLab repository containing the configuration for the pipeline deploying SCIONLab coordinator into running environment. GitHub webhook against this repo will triger deployment every time when there are changes in the master branch.

In order to have a fully functional installation the internal configuration is needed. It contains some internal secret keys and configurations for accessing the SCIONLab infrastructure machines. More detailed informations can be found directly in its repository.

About

SCIONLab user interface and administration

License:Apache License 2.0


Languages

Language:Python 90.3%Language:HTML 6.2%Language:Ruby 1.8%Language:Shell 1.2%Language:CSS 0.5%Language:Dockerfile 0.0%