2020-07-16 00:22:03 +01:00
|
|
|
# Installation
|
2018-07-31 20:57:30 +01:00
|
|
|
* Table of Contents
|
|
|
|
{:toc}
|
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
> **WARNING:** if Docker is installed, the default iptable rules will block CORE traffic
|
|
|
|
|
2020-03-05 23:04:29 +00:00
|
|
|
## Overview
|
2022-10-07 20:52:53 +01:00
|
|
|
CORE currently supports and provides the following install options, with the package
|
|
|
|
option being preferred.
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
* [Package based install (rpm/deb)](#package-based-install)
|
|
|
|
* [Script based install](#script-based-install)
|
|
|
|
* [Dockerfile based install](#dockerfile-based-install)
|
2020-09-29 07:14:20 +01:00
|
|
|
|
2020-12-02 17:40:49 +00:00
|
|
|
### Requirements
|
|
|
|
Any computer capable of running Linux should be able to run CORE. Since the physical machine will be hosting numerous
|
|
|
|
containers, as a general rule you should select a machine having as much RAM and CPU resources as possible.
|
|
|
|
|
|
|
|
* Linux Kernel v3.3+
|
|
|
|
* iproute2 4.5+ is a requirement for bridge related commands
|
2021-05-10 23:07:42 +01:00
|
|
|
* nftables compatible kernel and nft command line tool
|
2020-12-02 17:40:49 +00:00
|
|
|
|
|
|
|
### Supported Linux Distributions
|
|
|
|
Plan is to support recent Ubuntu and CentOS LTS releases.
|
|
|
|
|
|
|
|
Verified:
|
2022-10-07 20:52:53 +01:00
|
|
|
* Ubuntu - 18.04, 20.04, 22.04
|
|
|
|
* CentOS - 7.8
|
2020-09-26 17:42:15 +01:00
|
|
|
|
|
|
|
### Files
|
2022-10-07 20:52:53 +01:00
|
|
|
The following is a list of files that would be installed after installation.
|
2020-09-26 17:42:15 +01:00
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
* executables
|
|
|
|
* `<prefix>/bin/{vcmd, vnode}`
|
|
|
|
* can be adjusted using script based install , package will be /usr
|
2020-09-26 17:42:15 +01:00
|
|
|
* python files
|
2022-10-07 20:52:53 +01:00
|
|
|
* virtual environment `/opt/core/venv`
|
|
|
|
* local install will be local to the python version used
|
2020-09-26 17:42:15 +01:00
|
|
|
* `python3 -c "import core; print(core.__file__)"`
|
2022-10-07 20:52:53 +01:00
|
|
|
* scripts {core-daemon, core-cleanup, etc}
|
|
|
|
* virtualenv `/opt/core/venv/bin`
|
|
|
|
* local `/usr/local/bin`
|
2020-09-26 17:42:15 +01:00
|
|
|
* configuration files
|
2020-12-02 17:40:49 +00:00
|
|
|
* `/etc/core/{core.conf, logging.conf}`
|
2022-10-07 20:52:53 +01:00
|
|
|
* ospf mdr repository files when using script based install
|
2020-12-02 17:40:49 +00:00
|
|
|
* `<repo>/../ospf-mdr`
|
2020-09-26 17:42:15 +01:00
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
### Installed Scripts
|
|
|
|
The following python scripts are provided.
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2022-02-25 18:38:14 +00:00
|
|
|
| Name | Description |
|
|
|
|
|---------------------|------------------------------------------------------------------------------|
|
|
|
|
| core-cleanup | tool to help removed lingering core created containers, bridges, directories |
|
|
|
|
| core-cli | tool to query, open xml files, and send commands using gRPC |
|
2022-03-08 19:30:03 +00:00
|
|
|
| core-daemon | runs the backed core server providing a gRPC API |
|
|
|
|
| core-gui | starts GUI |
|
2022-02-25 18:38:14 +00:00
|
|
|
| core-python | provides a convenience for running the core python virtual environment |
|
|
|
|
| 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 |
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
### Upgrading from Older Release
|
2020-09-26 17:42:15 +01:00
|
|
|
Please make sure to uninstall any previous installations of CORE cleanly
|
2020-07-16 00:22:03 +01:00
|
|
|
before proceeding to install.
|
|
|
|
|
2021-11-16 20:52:31 +00:00
|
|
|
Clearing out a current install from 7.0.0+, making sure to provide options
|
|
|
|
used for install (`-l` or `-p`).
|
|
|
|
```shell
|
|
|
|
cd <CORE_REPO>
|
2022-01-11 19:06:06 +00:00
|
|
|
inv uninstall <options>
|
2021-11-16 20:52:31 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Previous install was built from source for CORE release older than 7.0.0:
|
2020-07-16 00:22:03 +01:00
|
|
|
```shell
|
2020-07-22 00:52:17 +01:00
|
|
|
cd <CORE_REPO>
|
2020-07-16 00:22:03 +01:00
|
|
|
sudo make uninstall
|
|
|
|
make clean
|
|
|
|
./bootstrap.sh clean
|
|
|
|
```
|
|
|
|
|
|
|
|
Installed from previously built packages:
|
|
|
|
```shell
|
|
|
|
# centos
|
|
|
|
sudo yum remove core
|
|
|
|
# ubuntu
|
|
|
|
sudo apt remove core
|
|
|
|
```
|
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
## Package Based Install
|
2022-07-28 00:41:23 +01:00
|
|
|
|
|
|
|
Starting with 9.0.0 there are pre-built rpm/deb packages. You can retrieve the
|
|
|
|
rpm/deb package from [releases](https://github.com/coreemu/core/releases) page.
|
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
The built packages will require and install system level dependencies, as well as running
|
|
|
|
a post install script to install the provided CORE python wheel. A similar uninstall script
|
|
|
|
is ran when uninstalling and would require the same options as given, during the install.
|
2022-07-28 00:41:23 +01:00
|
|
|
|
2022-10-13 18:15:38 +01:00
|
|
|
> **NOTE:** PYTHON defaults to python3 for installs below, CORE requires python3.9+, pip,
|
2022-10-07 20:52:53 +01:00
|
|
|
> tk compatibility for python gui, and venv for virtual environments
|
2022-07-28 00:41:23 +01:00
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
Examples for install:
|
2022-07-28 00:41:23 +01:00
|
|
|
```shell
|
2022-08-02 21:49:38 +01:00
|
|
|
# recommended to upgrade to the latest version of pip before installation
|
|
|
|
# in python, can help avoid building from source issues
|
2022-10-07 20:52:53 +01:00
|
|
|
sudo <python> -m pip install --upgrade pip
|
|
|
|
# install vcmd/vnoded, system dependencies,
|
2022-07-28 00:41:23 +01:00
|
|
|
# and core python into a venv located at /opt/core/venv
|
2022-10-07 20:52:53 +01:00
|
|
|
sudo <yum/apt> install -y ./<package>
|
2022-07-28 00:41:23 +01:00
|
|
|
# disable the venv and install to python directly
|
2022-10-07 20:52:53 +01:00
|
|
|
sudo NO_VENV=1 <yum/apt> install -y ./<package>
|
|
|
|
# change python executable used to install for venv or direct installations
|
|
|
|
sudo PYTHON=python3.9 <yum/apt> install -y ./<package>
|
2022-07-28 00:41:23 +01:00
|
|
|
# disable venv and change python executable
|
2022-10-07 20:52:53 +01:00
|
|
|
sudo NO_VENV=1 PYTHON=python3.9 <yum/apt> install -y ./<package>
|
2022-07-28 00:41:23 +01:00
|
|
|
# skip installing the python portion entirely, as you plan to carry this out yourself
|
|
|
|
# core python wheel is located at /opt/core/core-<version>-py3-none-any.whl
|
2022-10-07 20:52:53 +01:00
|
|
|
sudo NO_PYTHON=1 <yum/apt> install -y ./<package>
|
2022-07-28 00:41:23 +01:00
|
|
|
# install python wheel into python of your choosing
|
2022-10-07 20:52:53 +01:00
|
|
|
sudo <python> -m pip install /opt/core/core-<version>-py3-none-any.whl
|
2022-07-28 00:41:23 +01:00
|
|
|
```
|
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
Example for removal, requires using the same options as install:
|
2022-01-11 19:06:06 +00:00
|
|
|
```shell
|
2022-10-07 20:52:53 +01:00
|
|
|
# remove a standard install
|
|
|
|
sudo <yum/apt> remove core
|
|
|
|
# remove a local install
|
|
|
|
sudo NO_VENV=1 <yum/apt> remove core
|
|
|
|
# remove install using alternative python
|
|
|
|
sudo PYTHON=python3.9 <yum/apt> remove core
|
|
|
|
# remove install using alternative python and local install
|
|
|
|
sudo NO_VENV=1 PYTHON=python3.9 <yum/apt> remove core
|
|
|
|
# remove install and skip python uninstall
|
|
|
|
sudo NO_PYTHON=1 <yum/apt> remove core
|
2022-01-11 19:06:06 +00:00
|
|
|
```
|
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
### Installing OSPF MDR
|
|
|
|
You will need to manually install OSPF MDR for routing nodes, since this is not
|
|
|
|
provided by the package.
|
2022-01-11 19:06:06 +00:00
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
```shell
|
|
|
|
git clone https://github.com/USNavalResearchLaboratory/ospf-mdr.git
|
|
|
|
cd ospf-mdr
|
|
|
|
./bootstrap.sh
|
|
|
|
./configure --disable-doc --enable-user=root --enable-group=root \
|
|
|
|
--with-cflags=-ggdb --sysconfdir=/usr/local/etc/quagga --enable-vtysh \
|
|
|
|
--localstatedir=/var/run/quagga
|
|
|
|
make -j$(nproc)
|
|
|
|
sudo make install
|
|
|
|
```
|
|
|
|
|
|
|
|
When done see [Post Install](#post-install).
|
|
|
|
|
|
|
|
## Script Based Install
|
|
|
|
The script based installation will install system level dependencies, python library and
|
|
|
|
dependencies, as well as dependencies for building CORE.
|
2022-01-11 19:06:06 +00:00
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
The script based install also automatically builds and installs OSPF MDR, used by default
|
|
|
|
on routing nodes. This can optionally be skipped.
|
2022-01-11 19:06:06 +00:00
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
Installaion will carry out the following steps:
|
2020-09-12 00:26:13 +01:00
|
|
|
* installs system dependencies for building core
|
2022-10-07 20:52:53 +01:00
|
|
|
* builds vcmd/vnoded and python grpc files
|
2020-09-12 00:26:13 +01:00
|
|
|
* installs core into poetry managed virtual environment or locally, if flag is passed
|
2020-09-26 17:42:15 +01:00
|
|
|
* installs systemd service pointing to appropriate python location based on install type
|
2022-01-11 19:06:06 +00:00
|
|
|
* clone/build/install working version of [OPSF MDR](https://github.com/USNavalResearchLaboratory/ospf-mdr)
|
2020-04-10 05:42:04 +01:00
|
|
|
|
2020-09-26 17:42:15 +01:00
|
|
|
> **NOTE:** installing locally comes with its own risks, it can result it potential
|
|
|
|
> dependency conflicts with system package manager installed python dependencies
|
2020-04-10 05:42:04 +01:00
|
|
|
|
2020-09-26 17:42:15 +01:00
|
|
|
> **NOTE:** provide a prefix that will be found on path when running as sudo,
|
|
|
|
> if the default prefix /usr/local will not be valid
|
2020-07-16 00:22:03 +01:00
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
The following tools will be leveraged during installation:
|
|
|
|
|
|
|
|
| Tool | Description |
|
|
|
|
|---------------------------------------------|-----------------------------------------------------------------------|
|
|
|
|
| [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, uninstall, reinstall, etc) |
|
|
|
|
| [poetry](https://python-poetry.org/) | used to install python virtual environment or building a python wheel |
|
|
|
|
|
|
|
|
First we will need to clone and navigate to the CORE repo.
|
2020-04-10 05:42:04 +01:00
|
|
|
```shell
|
2022-10-07 20:52:53 +01:00
|
|
|
# clone CORE repo
|
|
|
|
git clone https://github.com/coreemu/core.git
|
|
|
|
cd core
|
|
|
|
|
|
|
|
# install dependencies to run installation task
|
|
|
|
./setup.sh
|
|
|
|
# skip installing system packages, due to using python built from source
|
|
|
|
NO_SYSTEM=1 ./setup.sh
|
2021-04-16 05:46:55 +01:00
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
# run the following or open a new terminal
|
|
|
|
source ~/.bashrc
|
|
|
|
|
|
|
|
# Ubuntu
|
|
|
|
inv install
|
|
|
|
# CentOS
|
|
|
|
inv install -p /usr
|
|
|
|
# optionally skip python system packages
|
|
|
|
inv install --no-python
|
|
|
|
# optionally skip installing ospf mdr
|
|
|
|
inv install --no-ospf
|
|
|
|
|
|
|
|
# install command options
|
2022-01-11 19:06:06 +00:00
|
|
|
Usage: inv[oke] [--core-opts] install [--options] [other tasks here ...]
|
|
|
|
|
|
|
|
Docstring:
|
|
|
|
install core, poetry, scripts, service, and ospf mdr
|
2020-07-14 18:42:24 +01:00
|
|
|
|
2022-01-11 19:06:06 +00:00
|
|
|
Options:
|
|
|
|
-d, --dev install development mode
|
|
|
|
-i STRING, --install-type=STRING used to force an install type, can be one of the following (redhat, debian)
|
|
|
|
-l, --local determines if core will install to local system, default is False
|
2022-10-07 20:52:53 +01:00
|
|
|
-n, --no-python avoid installing python system dependencies
|
2022-01-11 19:06:06 +00:00
|
|
|
-o, --[no-]ospf disable ospf installation
|
|
|
|
-p STRING, --prefix=STRING prefix where scripts are installed, default is /usr/local
|
2022-10-07 20:52:53 +01:00
|
|
|
-v, --verbose
|
2020-09-26 17:42:15 +01:00
|
|
|
```
|
2020-07-14 18:42:24 +01:00
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
When done see [Post Install](#post-install).
|
2021-05-12 04:52:10 +01:00
|
|
|
|
2020-09-26 17:42:15 +01:00
|
|
|
### Unsupported Linux Distribution
|
|
|
|
For unsupported OSs you could attempt to do the following to translate
|
|
|
|
an installation to your use case.
|
2019-06-10 21:15:34 +01:00
|
|
|
|
2022-10-13 18:15:38 +01:00
|
|
|
* make sure you have python3.9+ with venv support
|
2020-09-26 17:42:15 +01:00
|
|
|
* make sure you have python3 invoke available to leverage `<repo>/tasks.py`
|
2020-07-15 08:08:22 +01:00
|
|
|
|
2020-09-26 17:42:15 +01:00
|
|
|
```shell
|
|
|
|
# this will print the commands that would be ran for a given installation
|
|
|
|
# type without actually running them, they may help in being used as
|
|
|
|
# the basis for translating to your OS
|
|
|
|
inv install --dry -v -p <prefix> -i <install type>
|
|
|
|
```
|
2020-07-15 08:08:22 +01:00
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
## Dockerfile Based Install
|
|
|
|
You can leverage one of the provided Dockerfiles, to run and launch CORE within a Docker container.
|
|
|
|
|
|
|
|
Since CORE nodes will leverage software available within the system for a given use case,
|
|
|
|
make sure to update and build the Dockerfile with desired software.
|
2022-01-12 23:30:10 +00:00
|
|
|
|
|
|
|
```shell
|
|
|
|
# clone core
|
|
|
|
git clone https://github.com/coreemu/core.git
|
|
|
|
cd core
|
|
|
|
# build image
|
2022-10-07 20:52:53 +01:00
|
|
|
sudo docker build -t core -f Dockerfile.<centos,ubuntu,oracle> .
|
2022-01-12 23:30:10 +00:00
|
|
|
# start container
|
2022-10-07 20:52:53 +01:00
|
|
|
sudo docker run -itd --name core -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw --privileged core
|
2022-01-12 23:30:10 +00:00
|
|
|
# enable xhost access to the root user
|
|
|
|
xhost +local:root
|
|
|
|
# launch core-gui
|
|
|
|
sudo docker exec -it core core-gui
|
|
|
|
```
|
|
|
|
|
2022-10-07 20:52:53 +01:00
|
|
|
When done see [Post Install](#post-install).
|
2020-09-12 00:26:13 +01:00
|
|
|
|
|
|
|
## Installing EMANE
|
2022-08-30 20:25:34 +01:00
|
|
|
> **NOTE:** installing EMANE for the virtual environment is known to work for 1.21+
|
2018-07-31 20:57:30 +01:00
|
|
|
|
2021-11-17 23:55:05 +00:00
|
|
|
The recommended way to install EMANE is using prebuilt packages, otherwise
|
|
|
|
you can follow their instructions for installing from source. Installation
|
|
|
|
information can be found [here](https://github.com/adjacentlink/emane/wiki/Install).
|
2020-07-16 17:26:08 +01:00
|
|
|
|
2021-11-17 23:55:05 +00:00
|
|
|
There is an invoke task to help install the EMANE bindings into the CORE virtual
|
2022-08-30 20:25:34 +01:00
|
|
|
environment, when needed. An example for running the task is below and the version
|
|
|
|
provided should match the version of the packages installed.
|
2022-11-30 18:47:17 +00:00
|
|
|
|
|
|
|
You will also need to make sure, you are providing the correct python binary where CORE
|
|
|
|
is being used.
|
|
|
|
|
|
|
|
Also, these EMANE bindings need to be built using `protoc` 3.19+. So make sure
|
|
|
|
that is available and being picked up on PATH properly.
|
2018-10-18 18:56:41 +01:00
|
|
|
```shell
|
2020-07-22 00:52:17 +01:00
|
|
|
cd <CORE_REPO>
|
2022-08-30 20:25:34 +01:00
|
|
|
# example version tag v1.3.3
|
2022-11-30 18:47:17 +00:00
|
|
|
# overriding python used to leverage the default virtualenv install
|
|
|
|
PYTHON=/opt/core/venv/bin/python inv install-emane -e <version tag>
|
|
|
|
# local install that uses whatever python3 refers to
|
|
|
|
inv install-emane -e <version tag>
|
2018-10-18 18:56:41 +01:00
|
|
|
```
|
2022-10-07 20:52:53 +01:00
|
|
|
|
|
|
|
## Post Install
|
|
|
|
After installation completes you are now ready to run CORE.
|
|
|
|
|
|
|
|
### Resolving Path Issues
|
|
|
|
One problem running CORE you may run into, using the virtual environment or locally
|
|
|
|
can be issues related to your path.
|
|
|
|
|
|
|
|
To add support for your user to run scripts from the virtual environment:
|
|
|
|
```shell
|
|
|
|
# can add to ~/.bashrc
|
|
|
|
export PATH=$PATH:/opt/core/venv/bin
|
|
|
|
```
|
|
|
|
|
|
|
|
This will not solve the path issue when running as sudo, so you can do either
|
|
|
|
of the following to compensate.
|
|
|
|
```shell
|
|
|
|
# run command passing in the right PATH to pickup from the user running the command
|
|
|
|
sudo env PATH=$PATH core-daemon
|
|
|
|
|
|
|
|
# add an alias to ~/.bashrc or something similar
|
|
|
|
alias sudop='sudo env PATH=$PATH'
|
|
|
|
# now you can run commands like so
|
|
|
|
sudop core-daemon
|
|
|
|
```
|
|
|
|
|
|
|
|
### Running CORE
|
|
|
|
The following assumes I have resolved PATH issues and setup the `sudop` alias.
|
|
|
|
|
|
|
|
```shell
|
|
|
|
# in one terminal run the server daemon using the alias above
|
|
|
|
sudop core-daemon
|
|
|
|
# in another terminal run the gui client
|
|
|
|
core-gui
|
|
|
|
```
|
|
|
|
|
|
|
|
### Enabling Service
|
|
|
|
After installation, the core service is not enabled by default. If you desire to use the
|
|
|
|
service, run the following commands.
|
|
|
|
|
|
|
|
```shell
|
|
|
|
sudo systemctl enable core-daemon
|
|
|
|
sudo systemctl start core-daemon
|
|
|
|
```
|