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
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.Install
docker
. Please follow the instructions for docker server. Then, add your user to thedocker
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 thedocker
group is seen by the shell session.Optionally install the
Docker Compose Plugin
. This is needed if you want to run thedocker compose
based test topology setup instead of the default setup based onsupervisord
. Please follow the instructions for Install Compose Plugin.
Setup
Clone the SCION repository into your workspace.
git clone https://github.com/scionproto/scion cd scion
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
~/.local/bin
is on yourPATH
.You can also manually install
bazelisk
and create an alias so thatbazel
will resolve to thebazelisk
command.To install the required build toolchains and scripting dependencies, run:
./tools/install_deps
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
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 runningmake build
. See Building for more details.Finally, check that tests run correctly:
make test make test-integration
(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.