-
Notifications
You must be signed in to change notification settings - Fork 7
Build System
ZSDN provides a module build system, based on CMake, to build the controller modules.
For building zeroSDN modules you need a initialized clone of the zeroSDN repository. You can either install it manually as described in Manual-Installation or use a provided VM Image from here Virtual-Machines.
In your zeroSDN folder you can run the script build-modules.sh. The script needs the -m parameter defining which set of modules to build.
ZeroSDN has the following predefined module sets:
- zsdn-core: Module set of all ZSDN core modules. This is the controller with all it's core functionality. Will not do much on it's own. One instance of each module type.
- zsdn-default: Core controller functionality as well as forwarding-by-controller, Layer-2-flow-installation, and ARP-handling. One instance of each module type.
- zsdn-webadmin: Module set zsdn-default + WebAdmin (REST interface and Web GUI)
- zsdn-webadmin-logging: Module set zsdn-webadmin + LoggingModule logging controller messages (requires Apache Cassandra)
Module sets can be individually defined as explained in section Build-System#module-set-definition.
When the build finished successfully the builded modules will be stored in the build folder
Then you can run modules individually or using the run script as describe in Quick-Start
You can export a module set build by using the export-modules.sh script. Its usage is similar to the build-modules.sh script.
The script will first build all modules of the set and export the builds, including all necessary libraries and the run script of the module set. All files will be packed into a tar.gz file and stored at the export folder.
A module set defines a set of controller modules. The definition consists of two files:
- Module File List .txt: Defines a list of all module types in this module set. The first line contains the module description, followed by the list of modules, one in each line. C++ modules with the prefix "cpp/", Java modules with the prefix "java/".
- Example custom.txt:
Your description. cpp/MyCppModule java/MyJavaModule
- Example custom.txt:
- Module Run Script <name.sh>: Script define how to run the modules. This is useful for running modules on a single node. You can define which modules to run. You can define the module run parameters and start modules one or multiple times. The parameter $1 defines the module executable folder and the parameter $2 the configuration file.
- Example custom.sh:
... # Define module starts modulStarts=("$1/MyCppModule $2" "java -jar $1/MyJavaModule.jar") # Run module starter java -jar $1/module-starter.jar "${modulStarts[@]}"
- Example custom.sh:
The script run-modules.sh will run a given module set using its module run script. You can also start single modules directly or use your own custom run scripts.