Installation¶
This section explains how to install the Controller and all the required dependencies.
You have two ways to install the Controller:
Note
The installation into a virtual environment is the suggested option.
Prerequisites¶
The following dependencies are necessary:
Linux kernel 4.14 or above
Python 3.6 or above
Installation into a virtual environment (suggested)¶
Create a Python 3 virtual environment for the Controller:
$ python3 -m venv ~/.envs/controller-venv
Activate the virtual environment:
$ source ~/.envs/controller-venv/bin/activate
Clone the rose-srv6-control-plane repository using
git
:$ git clone https://github.com/netgroup/rose-srv6-control-plane.git
Then,
cd
to the control_plane/controller directory under the rose-srv6-control-plane folder and run the install command:$ cd rose-srv6-control-plane/control_plane/controller $ python setup.py install
This project depends on the gRPC protocol, which requires protobuf modules.
cd
to the control_plane/protos directory under the rose-srv6-control-plane folder and run the setup command to build and install the proto files:$ cd rose-srv6-control-plane/control_plane/protos $ python setup.py install
Configuration¶
The Controller comes with a default configuration:
#!/usr/bash
##############################################################################
################### Controller example configuration file ###################
##############################################################################
# Controller example configuration file.
# This is used to enable/disable features for the controller and
# to set configuration parameters.
#
# To provide the configuration settings defined in this script, pass
# the path of this script as parameter when you start the controller.
# $ controller --env-path .env
# For more information, check the documentation.
# Note that the configuration settings contained in this script are
# defined as environment variables; therefore you can also load the
# configuration by sourcing this script.
# Some settings can be also passed as command-line arguments when you
# start the controller. Command-line arguments have priority over the
# variables defined in this script.
##############################################################################
############################## General settings ##############################
##############################################################################
# Must debug logs be enabled? (optional, default: True)
# export DEBUG=True
# Must persistency be enabled? (optional, default: False)
export ENABLE_PERSISTENCY=False
##############################################################################
##############################################################################
############################ gRPC server settings ############################
##############################################################################
# Must the gRPC server be enabled on the controller? (default: False)
# export ENABLE_GRPC_SERVER=True
# IP address of the gRPC server (:: means 'listen on any addrs', default: ::)
export GRPC_SERVER_IP=::
# Number of port on which the gRPC server is reachable (default: 12345)
export GRPC_SERVER_PORT=12345
# Must gRPC server use secure channels? (default: False)
# export GRPC_SERVER_SECURE=True
# Path to the certificate of Certification Authority (CA)
# required by gRPC secure mode (default: 'cert_client.pem')
# export GRPC_SERVER_CERTIFICATE_PATH=/tmp/ca.crt
# Path to the private key of the server required by gRPC secure mode
# (default: 'key_server.pem')
# export GRPC_SERVER_KEY_PATH=/tmp/server.key
##############################################################################
##############################################################################
############################ gRPC client settings ############################
##############################################################################
# Must gRPC client use secure channels? (default: False)
# export GRPC_SECURE=True
# Must gRPC use secure channels? (default: False)
# export GRPC_CA_CERTIFICATE_PATH=/tmp/ca.crt
##############################################################################
##############################################################################
############################# ArangoDB configuration #########################
##############################################################################
# Must ArangoDB modules be enabled on the controller? (default: False)
export ENABLE_ARANGO_INTEGRATION=True
# URL of the ArangoDB server
export ARANGO_URL=http://localhost:8529
# Username for the authentication with the ArangoDB server
export ARANGO_USER=root
# Password for the authentication with the ArangoDB server
export ARANGO_PASSWORD=12345678
##############################################################################
##############################################################################
################################# Kafka settings #############################
##############################################################################
# Must Kafka modules be enabled on the controller? (default: False)
export ENABLE_KAFKA_INTEGRATION=True
# IP and port of the Kafka servers
export KAFKA_SERVERS=kafka:9092
##############################################################################
If you want to override the default settings, you can create a .env file containing the configuration parameters. For a description of the supported configuration options, see the Configuration section.
Optional requirements¶
Database utilities are required for the ArangoDB integration features. You need to activate the controller virtual environment and install the db_update package contained in the rose-srv6-control-plane repository if you want to use these features:
$ source ~/.envs/controller-venv/bin/activate $ cd rose-srv6-control-plane/db_update $ python setup.py install
Exporting the network topology as an image file requires graphviz and libgraphviz-dev:
$ apt-get install graphviz libgraphviz-dev
kafka-python is required for Kafka integration. Activate the controller virtual environment and run the install command:
$ source ~/.envs/controller-venv/bin/activate $ pip install kafka-python
Installation without a virtual environment¶
Clone the rose-srv6-control-plane repository using
git
:$ git clone https://github.com/netgroup/rose-srv6-control-plane.git
Then,
cd
to the control_plane/controller directory under the rose-srv6-control-plane folder and run the install command:$ cd rose-srv6-control-plane/control_plane/controller $ python setup.py install
This project depends on the gRPC protocol, which requires protobuf modules.
cd
to the control_plane/protos directory under the rose-srv6-control-plane folder and run the setup command to build and install the proto files:$ cd rose-srv6-control-plane/control_plane/protos $ python setup.py install
Configuration¶
The Controller comes with a default configuration:
#!/usr/bash
##############################################################################
################### Controller example configuration file ###################
##############################################################################
# Controller example configuration file.
# This is used to enable/disable features for the controller and
# to set configuration parameters.
#
# To provide the configuration settings defined in this script, pass
# the path of this script as parameter when you start the controller.
# $ controller --env-path .env
# For more information, check the documentation.
# Note that the configuration settings contained in this script are
# defined as environment variables; therefore you can also load the
# configuration by sourcing this script.
# Some settings can be also passed as command-line arguments when you
# start the controller. Command-line arguments have priority over the
# variables defined in this script.
##############################################################################
############################## General settings ##############################
##############################################################################
# Must debug logs be enabled? (optional, default: True)
# export DEBUG=True
# Must persistency be enabled? (optional, default: False)
export ENABLE_PERSISTENCY=False
##############################################################################
##############################################################################
############################ gRPC server settings ############################
##############################################################################
# Must the gRPC server be enabled on the controller? (default: False)
# export ENABLE_GRPC_SERVER=True
# IP address of the gRPC server (:: means 'listen on any addrs', default: ::)
export GRPC_SERVER_IP=::
# Number of port on which the gRPC server is reachable (default: 12345)
export GRPC_SERVER_PORT=12345
# Must gRPC server use secure channels? (default: False)
# export GRPC_SERVER_SECURE=True
# Path to the certificate of Certification Authority (CA)
# required by gRPC secure mode (default: 'cert_client.pem')
# export GRPC_SERVER_CERTIFICATE_PATH=/tmp/ca.crt
# Path to the private key of the server required by gRPC secure mode
# (default: 'key_server.pem')
# export GRPC_SERVER_KEY_PATH=/tmp/server.key
##############################################################################
##############################################################################
############################ gRPC client settings ############################
##############################################################################
# Must gRPC client use secure channels? (default: False)
# export GRPC_SECURE=True
# Must gRPC use secure channels? (default: False)
# export GRPC_CA_CERTIFICATE_PATH=/tmp/ca.crt
##############################################################################
##############################################################################
############################# ArangoDB configuration #########################
##############################################################################
# Must ArangoDB modules be enabled on the controller? (default: False)
export ENABLE_ARANGO_INTEGRATION=True
# URL of the ArangoDB server
export ARANGO_URL=http://localhost:8529
# Username for the authentication with the ArangoDB server
export ARANGO_USER=root
# Password for the authentication with the ArangoDB server
export ARANGO_PASSWORD=12345678
##############################################################################
##############################################################################
################################# Kafka settings #############################
##############################################################################
# Must Kafka modules be enabled on the controller? (default: False)
export ENABLE_KAFKA_INTEGRATION=True
# IP and port of the Kafka servers
export KAFKA_SERVERS=kafka:9092
##############################################################################
If you want to override the default settings, you can create a .env file containing the configuration parameters. For a description of the supported configuration options, see the Configuration section.
Optional requirements¶
Database utilities are required for the ArangoDB integration features. You need to install the db_update package contained in the rose-srv6-control-plane repository if you want to use these features:
$ cd rose-srv6-control-plane/db_update $ python setup.py install
Exporting the network topology as an image file requires graphviz and libgraphviz-dev:
$ apt-get install graphviz libgraphviz-dev
kafka-python is required for Kafka integration. You can install it by running the install command:
$ pip install kafka-python