Setting up the Development Environment

Hint

These instructions describe the setup for building and running all integration tests with bazel, docker and various other tools and scripts. See Building for instructions focussing only on how to build the SCION executables.

Prerequisites

  1. Make sure that you are using a clean and recently updated linux distribution. Distributions that are known to work are:

    • Ubuntu release 18.04 or later.

    • Fedora release 38 or later.

    • Amazon Linux 2.

    Other Linux environments will usually be fine too, but some of the tooling might need tweaking. If you make things work for other distributions, please update this list.

    This environment assumes you’re running as a non-root user with sudo access.

  2. Install docker. Please follow the instructions for docker server. Then, add your user to the docker group: sudo usermod -a -G docker ${LOGNAME}, where ${LOGNAME} is replaced with your user name. Log out and log back in so that your membership of the docker group is seen by the shell session.

    Optionally install the Docker Compose Plugin. This is needed if you want to run the docker compose based test topology setup instead of the default setup based on supervisord. Please follow the instructions for Install Compose Plugin.

Setup

  1. Clone the SCION repository into your workspace.

    git clone https://github.com/scionproto/scion
    cd scion
    
  2. We use Bazel for both building and testing. To be able to define the bazel version in the repository we use the bazelisk wrapper around bazel. To set it up simply use:

    ./tools/install_bazel
    

    and make sure that ~/bin is on your PATH.

    You can also manually install bazelisk and create an alias so that bazel will resolve to the bazelisk command.

  3. To install the required build toolchains and scripting dependencies, run:

    ./tools/install_deps
    
  4. Start the bazel-remote container.

    We use bazel-remote to cache build artifacts from bazel. Bazel-remote can manage the disk space and does not infinitely grow like the Bazel built-in disk-cache. To start bazel-remote run:

    ./scion.sh bazel-remote
    
  5. Build SCION services and tools.

    make
    

    Hint

    This builds tools for tests in addition to the main SCION services (e.g., end2end); if you don’t require those, you can only build the SCION services by running make build. See Building for more details.

  6. Finally, check that tests run correctly:

    make test
    make test-integration
    
  7. (Optional) If you already have some code you wish to contribute upstream, you can also run the linters locally with:

    make lint
    

Tips and Tricks

See also

Contribution Guide

Learn how to contribute to the SCION projects.

Running SCION Locally

Run a SCION network on your development machine.