2020-07-16 00:22:03 +01:00
|
|
|
# Installation
|
2018-07-31 20:57:30 +01:00
|
|
|
|
|
|
|
* Table of Contents
|
|
|
|
{:toc}
|
|
|
|
|
2020-03-05 23:04:29 +00:00
|
|
|
## Overview
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
CORE provides a script to help automate installing all required software
|
|
|
|
to build and run, including a python virtual environment to run it all in.
|
2020-04-17 02:48:46 +01:00
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
The following tools will be leveraged during installation:
|
|
|
|
|
|
|
|
|Tool|Description|
|
|
|
|
|---|---|
|
2020-07-16 00:22:03 +01:00
|
|
|
|[pip](https://pip.pypa.io/en/stable/)|used to install pipx|
|
|
|
|
|[pipx](https://pipxproject.github.io/pipx/)|used to install standalone python tools (invoke, poetry)|
|
|
|
|
|[invoke](http://www.pyinvoke.org/)|used to run provided tasks (install, daemon, gui, tests, etc)|
|
|
|
|
|[poetry](https://python-poetry.org/)|used to install the managed python virtual environment for running CORE|
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2020-03-05 23:04:29 +00:00
|
|
|
## Required Hardware
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2019-12-20 20:55:52 +00:00
|
|
|
Any computer capable of running Linux should be able to run CORE. Since the physical machine will be hosting numerous
|
2020-04-13 19:51:12 +01:00
|
|
|
containers, as a general rule you should select a machine having as much RAM and CPU resources as possible.
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
## Supported Linux Distributions
|
|
|
|
|
|
|
|
Plan is to support recent Ubuntu and CentOS LTS releases.
|
2019-06-10 19:41:27 +01:00
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
Verified:
|
|
|
|
* Ubuntu - 18.04, 20.04
|
|
|
|
* CentOS - 7.8, 8.0*
|
2019-06-10 19:41:27 +01:00
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
> **NOTE:** Ubuntu 20.04 requires installing legacy ebtables for WLAN
|
|
|
|
> functionality
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
> **NOTE:** CentOS 8 does not provide legacy ebtables support, WLAN will not
|
|
|
|
> function properly
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2020-07-14 19:02:00 +01:00
|
|
|
> **NOTE:** CentOS 8 does not have the netem kernel mod available by default
|
|
|
|
|
|
|
|
CentOS 8 Enabled netem:
|
|
|
|
```shell
|
|
|
|
sudo yum update
|
|
|
|
# restart into updated kernel
|
|
|
|
sudo yum install -y kernel-modules-extra
|
|
|
|
sudo modprobe sch_netem
|
|
|
|
```
|
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
## Utility Requirements
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
* iproute2 4.5+ is a requirement for bridge related commands
|
|
|
|
* ebtables not backed by nftables
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2020-07-16 00:22:03 +01:00
|
|
|
## Upgrading
|
|
|
|
|
|
|
|
Please make sure to uninstall the previous installation of CORE cleanly
|
|
|
|
before proceeding to install.
|
|
|
|
|
|
|
|
Previous install was built from source:
|
|
|
|
```shell
|
|
|
|
cd $REPO
|
|
|
|
sudo make uninstall
|
|
|
|
make clean
|
|
|
|
./bootstrap.sh clean
|
|
|
|
```
|
|
|
|
|
|
|
|
Installed from previously built packages:
|
|
|
|
```shell
|
|
|
|
# centos
|
|
|
|
sudo yum remove core
|
|
|
|
# ubuntu
|
|
|
|
sudo apt remove core
|
|
|
|
```
|
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
## Automated Installation
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2020-07-15 08:08:22 +01:00
|
|
|
The automated install will install the various tools needed to help automate
|
|
|
|
the CORE installation (python3, pip, pipx, invoke, poetry). The script will
|
|
|
|
also automatically clone, build, and install the latest version of OSPF MDR.
|
|
|
|
Finally it will install CORE scripts and a systemd service, which have
|
|
|
|
been modified to use the installed poetry created virtual environment.
|
2020-04-10 05:42:04 +01:00
|
|
|
|
2020-07-15 08:08:22 +01:00
|
|
|
After installation has completed you should be able to run the various
|
|
|
|
CORE scripts for running core.
|
2020-04-10 05:42:04 +01:00
|
|
|
|
2020-07-16 00:22:03 +01:00
|
|
|
> **NOTE:** provide a prefix that will be found on path when running as sudo
|
|
|
|
> if the default prefix is not valid
|
|
|
|
|
2020-04-10 05:42:04 +01:00
|
|
|
```shell
|
2020-07-14 18:42:24 +01:00
|
|
|
# clone CORE repo
|
2020-04-10 05:42:04 +01:00
|
|
|
git clone https://github.com/coreemu/core.git
|
|
|
|
cd core
|
2020-07-14 18:42:24 +01:00
|
|
|
|
|
|
|
# run install script
|
|
|
|
# script usage: install.sh [-d] [-v]
|
|
|
|
#
|
|
|
|
# -v enable verbose install
|
|
|
|
# -d enable developer install
|
|
|
|
# -p install prefix, defaults to /usr/local
|
2020-04-10 05:42:04 +01:00
|
|
|
./install.sh
|
|
|
|
```
|
|
|
|
|
2020-07-16 00:22:03 +01:00
|
|
|
### Unsupported Linux Distribution
|
2019-10-03 20:11:12 +01:00
|
|
|
|
2020-07-16 00:22:03 +01:00
|
|
|
If you are on an unsupported distribution, you can look into the
|
|
|
|
[install.sh](https://github.com/coreemu/core/blob/master/install.sh)
|
|
|
|
and
|
|
|
|
[tasks.py](https://github.com/coreemu/core/blob/master/tasks.py)
|
|
|
|
files to see the various commands ran to install CORE and translate them to
|
|
|
|
your use case, assuming it is possible.
|
2020-07-14 18:42:24 +01:00
|
|
|
|
2020-07-16 00:22:03 +01:00
|
|
|
If you get install down entirely, feel free to contribute and help others.
|
2019-06-10 21:15:34 +01:00
|
|
|
|
2020-07-15 08:08:22 +01:00
|
|
|
## Installed Scripts
|
|
|
|
|
2020-07-16 00:22:03 +01:00
|
|
|
After the installation complete it will have installed the following scripts.
|
2020-07-15 08:08:22 +01:00
|
|
|
|
|
|
|
| Name | Description |
|
|
|
|
|---|---|
|
|
|
|
| core-daemon | runs the backed core server providing TLV and gRPC APIs |
|
|
|
|
| core-gui | runs the legacy tcl/tk based GUI |
|
|
|
|
| core-pygui | runs the new python/tk based GUI |
|
|
|
|
| core-cleanup | tool to help removed lingering core created containers, bridges, directories |
|
|
|
|
| core-imn-to-xml | tool to help automate converting a .imn file to .xml format |
|
|
|
|
| core-route-monitor | tool to help monitor traffic across nodes and feed that to SDT |
|
|
|
|
| core-service-update | tool to update automate modifying a legacy service to match current naming |
|
|
|
|
| coresendmsg | tool to send TLV API commands from command line |
|
|
|
|
| core-cli | tool to query, open xml files, and send commands using gRPC |
|
|
|
|
| core-manage | tool to add, remove, or check for services, models, and node types |
|
|
|
|
|
2020-07-16 00:22:03 +01:00
|
|
|
## Running User Scripts
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2020-07-16 00:22:03 +01:00
|
|
|
If you create your own python scripts to run CORE directly or using the gRPC/TLV
|
|
|
|
APIs you will need to make sure you are running them within context of the
|
|
|
|
installed virtual environment.
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2020-07-16 00:22:03 +01:00
|
|
|
> **NOTE:** the following assumes CORE has been installed successfully
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2020-07-16 17:16:32 +01:00
|
|
|
There is an invoke task to help with this case.
|
2018-07-31 20:57:30 +01:00
|
|
|
```shell
|
2020-07-16 17:16:32 +01:00
|
|
|
cd $REPO
|
|
|
|
inv -h run
|
|
|
|
Usage: inv[oke] [--core-opts] run [--options] [other tasks here ...]
|
|
|
|
|
|
|
|
Docstring:
|
|
|
|
runs a user script in the core virtual environment
|
|
|
|
|
|
|
|
Options:
|
|
|
|
-f STRING, --file=STRING script file to run in the core virtual environment
|
|
|
|
-s, --sudo run script as sudo
|
2020-07-16 00:22:03 +01:00
|
|
|
```
|
|
|
|
|
2020-07-16 17:16:32 +01:00
|
|
|
Another way would be to enable the core virtual environment shell. Which
|
|
|
|
would allow you to run scripts in a more **normal** way.
|
2020-07-16 00:22:03 +01:00
|
|
|
```shell
|
|
|
|
cd $REPO/daemon
|
2020-07-16 17:16:32 +01:00
|
|
|
poetry shell
|
|
|
|
python run /path/to/script.py
|
2018-07-31 20:57:30 +01:00
|
|
|
```
|
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
## Manually Install EMANE
|
2018-10-18 18:56:41 +01:00
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
EMANE can be installed from deb or RPM packages or from source. See the
|
|
|
|
[EMANE GitHub](https://github.com/adjacentlink/emane) for full details.
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2020-07-16 17:26:08 +01:00
|
|
|
There is an invoke task to help with installing EMANE, but has issues,
|
|
|
|
which attempts to build EMANE from source, but has issue on systems with
|
|
|
|
older protobuf-compilers.
|
|
|
|
|
2018-10-18 18:56:41 +01:00
|
|
|
```shell
|
2020-07-16 17:26:08 +01:00
|
|
|
cd $REPO
|
|
|
|
inv install-emane
|
|
|
|
```
|
|
|
|
|
|
|
|
Alternatively, you can
|
|
|
|
[build EMANE](https://github.com/adjacentlink/emane/wiki/Build)
|
|
|
|
from source and install the python
|
|
|
|
bindings into the core virtual environment.
|
2020-07-15 08:08:22 +01:00
|
|
|
|
2020-07-16 17:26:08 +01:00
|
|
|
The following would install the EMANE python bindings after being
|
|
|
|
successfully built.
|
|
|
|
```shell
|
2020-07-15 08:08:22 +01:00
|
|
|
cd $REPO/daemon
|
|
|
|
poetry run pip install $EMANE_REPO/src/python
|
2018-10-18 18:56:41 +01:00
|
|
|
```
|
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
## Using Invoke Tasks
|
2018-10-18 21:12:30 +01:00
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
The invoke tool installed by way of pipx provides conveniences for running
|
|
|
|
CORE tasks to help ensure usage of the create python virtual environment.
|
2018-07-31 20:57:30 +01:00
|
|
|
|
|
|
|
```shell
|
2020-07-16 16:47:18 +01:00
|
|
|
inv --list
|
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
Available tasks:
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2020-07-14 18:42:24 +01:00
|
|
|
daemon start core-daemon
|
2020-07-16 16:47:18 +01:00
|
|
|
install install core, poetry, scripts, service, and ospf mdr
|
|
|
|
install-emane install emane and the python bindings
|
2020-07-14 18:42:24 +01:00
|
|
|
install-scripts install core script files, modified to leverage virtual environment
|
|
|
|
install-service install systemd core service
|
2020-07-16 16:47:18 +01:00
|
|
|
run runs a user script in the core virtual environment
|
2020-07-14 18:42:24 +01:00
|
|
|
test run core tests
|
|
|
|
test-emane run core emane tests
|
|
|
|
test-mock run core tests using mock to avoid running as sudo
|
2020-07-16 16:47:18 +01:00
|
|
|
uninstall uninstall core, scripts, service, virtual environment, and clean build directory
|
|
|
|
```
|
|
|
|
|
|
|
|
Print help for a given task:
|
|
|
|
```shell
|
|
|
|
inv -h install
|
|
|
|
|
|
|
|
Usage: inv[oke] [--core-opts] install [--options] [other tasks here ...]
|
|
|
|
|
|
|
|
Docstring:
|
|
|
|
install core, poetry, scripts, service, and ospf mdr
|
|
|
|
|
|
|
|
Options:
|
|
|
|
-d, --dev install development mode
|
|
|
|
-p STRING, --prefix=STRING prefix where scripts are installed, default is /usr/local
|
|
|
|
-v, --verbose enable verbose
|
2018-07-31 20:57:30 +01:00
|
|
|
```
|