small update to devguide, updates to READMEs for LXD and Docker
This commit is contained in:
parent
793d340668
commit
298cd2c9d3
3 changed files with 57 additions and 69 deletions
|
@ -4,13 +4,13 @@ Information on how Docker can be leveraged and included to create
|
||||||
nodes based on Docker containers and images to interface with
|
nodes based on Docker containers and images to interface with
|
||||||
existing CORE nodes, when needed.
|
existing CORE nodes, when needed.
|
||||||
|
|
||||||
# Installation
|
## Installation
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
sudo apt install docker.io
|
sudo apt install docker.io
|
||||||
```
|
```
|
||||||
|
|
||||||
# Configuration
|
## Configuration
|
||||||
|
|
||||||
Custom configuration required to avoid iptable rules being added and removing
|
Custom configuration required to avoid iptable rules being added and removing
|
||||||
the need for the default docker network, since core will be orchestrating
|
the need for the default docker network, since core will be orchestrating
|
||||||
|
@ -19,12 +19,28 @@ connections between nodes.
|
||||||
Place the file below in **/etc/docker/**
|
Place the file below in **/etc/docker/**
|
||||||
* daemon.json
|
* daemon.json
|
||||||
|
|
||||||
# Tools and Versions Tested With
|
## Group Setup
|
||||||
|
|
||||||
|
To use Docker nodes within the python GUI, you will need to make sure the user running the GUI is a member of the
|
||||||
|
docker group.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# add group if does not exist
|
||||||
|
sudo groupadd docker
|
||||||
|
|
||||||
|
# add user to group
|
||||||
|
sudo usermod -aG docker $USER
|
||||||
|
|
||||||
|
# to get this change to take effect, log out and back in or run the following
|
||||||
|
newgrp docker
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tools and Versions Tested With
|
||||||
|
|
||||||
* Docker version 18.09.5, build e8ff056
|
* Docker version 18.09.5, build e8ff056
|
||||||
* nsenter from util-linux 2.31.1
|
* nsenter from util-linux 2.31.1
|
||||||
|
|
||||||
# Examples
|
## Examples
|
||||||
|
|
||||||
This directory provides a few small examples creating Docker nodes
|
This directory provides a few small examples creating Docker nodes
|
||||||
and linking them to themselves or with standard CORE nodes.
|
and linking them to themselves or with standard CORE nodes.
|
||||||
|
|
|
@ -4,13 +4,13 @@ Information on how LXD can be leveraged and included to create
|
||||||
nodes based on LXC containers and images to interface with
|
nodes based on LXC containers and images to interface with
|
||||||
existing CORE nodes, when needed.
|
existing CORE nodes, when needed.
|
||||||
|
|
||||||
# Installation
|
## Installation
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
sudo snap install lxd
|
sudo snap install lxd
|
||||||
```
|
```
|
||||||
|
|
||||||
# Configuration
|
## Configuration
|
||||||
|
|
||||||
Initialize LXD and say no to adding a default bridge.
|
Initialize LXD and say no to adding a default bridge.
|
||||||
|
|
||||||
|
@ -18,12 +18,28 @@ Initialize LXD and say no to adding a default bridge.
|
||||||
sudo lxd init
|
sudo lxd init
|
||||||
```
|
```
|
||||||
|
|
||||||
# Tools and Versions Tested With
|
## Group Setup
|
||||||
|
|
||||||
|
To use LXC nodes within the python GUI, you will need to make sure the user running the GUI is a member of the
|
||||||
|
lxd group.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# add group if does not exist
|
||||||
|
sudo groupadd lxd
|
||||||
|
|
||||||
|
# add user to group
|
||||||
|
sudo usermod -aG lxd $USER
|
||||||
|
|
||||||
|
# to get this change to take effect, log out and back in or run the following
|
||||||
|
newgrp lxd
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tools and Versions Tested With
|
||||||
|
|
||||||
* LXD 3.14
|
* LXD 3.14
|
||||||
* nsenter from util-linux 2.31.1
|
* nsenter from util-linux 2.31.1
|
||||||
|
|
||||||
# Examples
|
## Examples
|
||||||
|
|
||||||
This directory provides a few small examples creating LXC nodes
|
This directory provides a few small examples creating LXC nodes
|
||||||
using LXD and linking them to themselves or with standard CORE nodes.
|
using LXD and linking them to themselves or with standard CORE nodes.
|
||||||
|
|
|
@ -10,7 +10,6 @@ Current development focuses on the Python modules and daemon. Here is a brief de
|
||||||
|
|
||||||
| Directory | Description |
|
| Directory | Description |
|
||||||
|---|---|
|
|---|---|
|
||||||
|corefx|JavaFX based GUI using gRPC API to replace legacy GUI|
|
|
||||||
|daemon|Python CORE daemon code that handles receiving API calls and creating containers|
|
|daemon|Python CORE daemon code that handles receiving API calls and creating containers|
|
||||||
|docs|Markdown Documentation currently hosted on GitHub|
|
|docs|Markdown Documentation currently hosted on GitHub|
|
||||||
|gui|Tcl/Tk GUI|
|
|gui|Tcl/Tk GUI|
|
||||||
|
@ -24,6 +23,13 @@ Current development focuses on the Python modules and daemon. Here is a brief de
|
||||||
Overview for setting up the pipenv environment, building core, installing the GUI and netns, then running
|
Overview for setting up the pipenv environment, building core, installing the GUI and netns, then running
|
||||||
the core-daemon for development.
|
the core-daemon for development.
|
||||||
|
|
||||||
|
### Clone CORE Repo
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git clone https://github.com/coreemu/core.git
|
||||||
|
cd core
|
||||||
|
```
|
||||||
|
|
||||||
### Setup Python Environment
|
### Setup Python Environment
|
||||||
|
|
||||||
To leverage the dev environment you need python 3.6+.
|
To leverage the dev environment you need python 3.6+.
|
||||||
|
@ -40,14 +46,13 @@ pip3 install pipenv
|
||||||
|
|
||||||
# setup a virtual environment and install all required development dependencies
|
# setup a virtual environment and install all required development dependencies
|
||||||
python3 -m pipenv install --dev
|
python3 -m pipenv install --dev
|
||||||
|
|
||||||
# setup python variable using pipenv created python
|
|
||||||
export PYTHON=$(python3 -m pipenv --py)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setup pre-commit
|
### Setup pre-commit
|
||||||
|
|
||||||
Install pre-commit hooks to help automate running tool checks against code.
|
Install pre-commit hooks to help automate running tool checks against code. Once installed every time a commit is made
|
||||||
|
python utilities will be ran to check validity of code, potentially failing and backing out the commit. This allows
|
||||||
|
one to review changes being made by tools ro the fix the issue noted. Then add the changes and commit again.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
python3 -m pipenv run pre-commit install
|
python3 -m pipenv run pre-commit install
|
||||||
|
@ -56,11 +61,6 @@ python3 -m pipenv run pre-commit install
|
||||||
### Build CORE
|
### Build CORE
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# clone core
|
|
||||||
git clone https://github.com/coreemu/core.git
|
|
||||||
cd core
|
|
||||||
|
|
||||||
# build core
|
|
||||||
./bootstrap.sh
|
./bootstrap.sh
|
||||||
./configure --prefix=/usr
|
./configure --prefix=/usr
|
||||||
make
|
make
|
||||||
|
@ -89,7 +89,7 @@ EMANE bindings are not available through pip, you will need to build and install
|
||||||
```shell
|
```shell
|
||||||
# after building emane above
|
# after building emane above
|
||||||
# ./autogen.sh && ./configure --prefix=/usr && make
|
# ./autogen.sh && ./configure --prefix=/usr && make
|
||||||
python3 -m pipenv install --skip-lock $EMANEREPO/src/python
|
python3 -m pipenv install $EMANEREPO/src/python
|
||||||
```
|
```
|
||||||
|
|
||||||
### Running CORE
|
### Running CORE
|
||||||
|
@ -97,20 +97,16 @@ python3 -m pipenv install --skip-lock $EMANEREPO/src/python
|
||||||
This will run the core-daemon server using the configuration files within the repo.
|
This will run the core-daemon server using the configuration files within the repo.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
python3 -m pipenv run coredev
|
python3 -m pipenv run core
|
||||||
```
|
```
|
||||||
|
|
||||||
## The CORE API
|
### Running CORE Python GUI
|
||||||
|
|
||||||
The CORE API is used between different components of CORE for communication. The GUI communicates with the CORE daemon
|
Must be ran after the daemon above or will fail to connect.
|
||||||
using the API. One emulation server communicates with another using the API. The API also allows other systems to
|
|
||||||
interact with the CORE emulation. The API allows another system to add, remove, or modify nodes and links, and enables
|
|
||||||
executing commands on the emulated systems. Wireless link parameters are updated on-the-fly based on node positions.
|
|
||||||
|
|
||||||
CORE listens on a local TCP port for API messages. The other system could be software running locally or another
|
```shell
|
||||||
machine accessible across the network.
|
python3 -m pipenv run coretk
|
||||||
|
```
|
||||||
The CORE API is currently specified in a separate document, available from the CORE website.
|
|
||||||
|
|
||||||
## Linux Network Namespace Commands
|
## Linux Network Namespace Commands
|
||||||
|
|
||||||
|
@ -169,43 +165,3 @@ tc qdisc show
|
||||||
# view the rules that make the wireless LAN work
|
# view the rules that make the wireless LAN work
|
||||||
ebtables -L
|
ebtables -L
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example Command Usage
|
|
||||||
|
|
||||||
Below is a transcript of creating two emulated nodes and connecting them together with a wired link:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
# create node 1 namespace container
|
|
||||||
vnoded -c /tmp/n1.ctl -l /tmp/n1.log -p /tmp/n1.pid
|
|
||||||
# create a virtual Ethernet (veth) pair, installing one end into node 1
|
|
||||||
ip link add name n1.0.1 type veth peer name n1.0
|
|
||||||
ip link set n1.0 netns `cat /tmp/n1.pid`
|
|
||||||
vcmd -c /tmp/n1.ctl -- ip link set lo up
|
|
||||||
vcmd -c /tmp/n1.ctl -- ip link set n1.0 name eth0 up
|
|
||||||
vcmd -c /tmp/n1.ctl -- ip addr add 10.0.0.1/24 dev eth0
|
|
||||||
|
|
||||||
# create node 2 namespace container
|
|
||||||
vnoded -c /tmp/n2.ctl -l /tmp/n2.log -p /tmp/n2.pid
|
|
||||||
# create a virtual Ethernet (veth) pair, installing one end into node 2
|
|
||||||
ip link add name n2.0.1 type veth peer name n2.0
|
|
||||||
ip link set n2.0 netns `cat /tmp/n2.pid`
|
|
||||||
vcmd -c /tmp/n2.ctl -- ip link set lo up
|
|
||||||
vcmd -c /tmp/n2.ctl -- ip link set n2.0 name eth0 up
|
|
||||||
vcmd -c /tmp/n2.ctl -- ip addr add 10.0.0.2/24 eth0
|
|
||||||
|
|
||||||
# bridge together nodes 1 and 2 using the other end of each veth pair
|
|
||||||
brctl addbr b.1.1
|
|
||||||
brctl setfd b.1.1 0
|
|
||||||
brctl addif b.1.1 n1.0.1
|
|
||||||
brctl addif b.1.1 n2.0.1
|
|
||||||
ip link set n1.0.1 up
|
|
||||||
ip link set n2.0.1 up
|
|
||||||
ip link set b.1.1 up
|
|
||||||
|
|
||||||
# display connectivity and ping from node 1 to node 2
|
|
||||||
brctl show
|
|
||||||
vcmd -c /tmp/n1.ctl -- ping 10.0.0.2
|
|
||||||
```
|
|
||||||
|
|
||||||
The above example script can be found as *twonodes.sh* in the *examples/netns* directory. Use *core-cleanup* to clean
|
|
||||||
up after the script.
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue