Creating a Tibit PON Controller Container

  Copyright (C) 2020 - 2022 by Tibit Communications, Inc.
  All rights reserved.



Overview
--------

This document provides instructions for creating a PON Controller Docker container
from a binary installation package.

See the following document for more information on the PON Controller:
 * Tibit Tech Note TN0026 PON Controller User Guide and Release Notes.

Requirements:
* Ubuntu Linux 18.04 (Bionic Beaver)
* docker-ce 19.03.5 (Docker Community Edition for Ubuntu)
* docker-compose 1.17.1-2



Build Environment Setup
-----------------------

This section provides instructions for preparing the build environment for creating
a containerized PON Controller.

1) Update Ubuntu 18.04 with the latest patches.

    sudo apt update && sudo apt upgrade

2) Install Docker Community Edition for Ubuntu. Do not use the docker apt package
distributed with Ubuntu 18.04. Instead, use the instructions at the following
link to install Docker Community Edition.
  * https://docs.docker.com/install/linux/docker-ce/ubuntu/


3) Install the docker-compose utility.

    sudo apt install docker-compose



Creating the Container
----------------------

Use the following steps to build and install the PON Controller container. Execute
docker-compose commands from the docker/ directory.

1) Edit docker/PonCntlInit.json to configure the Mongo Database and Tibit
management interface settings. This file provides the MongoDB and management
interface used by the PON Controller container for connectivity to the database
and MicroPlug OLT network.

The docker/PonCntlInit.json file is referenced by docker-compose.yaml. Alternatively,
edit docker-compose.yaml to modify the bind mount to a file of your choosing.

2) Build the docker image used by the PON Controller container using docker-compose.

    docker-compose build

3) Create, install, and start the container using docker-compose. Specify the '-d'
option to start the container in the background.

    docker-compose up -d



Managing the PON Controller Container
-------------------------------------

This section provides additional commands for managing the PON Controller docker
container. Execute docker-compose commands from the docker/ directory.

* Start the PON Controller container in the background

    docker-compose up -d

* Attaching to the PON Controller container's console to display the PON Controller
log output. See 'docker-compose logs' below for similar functionality.

    docker attach tibit-poncntl

Note: Type 'ctrl-p ctrl-q' to detach from the container's console. Alternatively,
you can override the docker default settings to use 'ctrl-c' to detach.

For example,
$ cat ~/.docker/config.json
{
    "detachKeys": "ctrl-c"
}

* Tail the container's docker logs to display the PON Controller log output

    docker-compose logs --follow tibit-poncntl


* Stop the PON Controller container

    docker-compose down



PON Controller Container with Linux Macvlan
-------------------------------------------

The instructions provided above are for running the PON Controller container with
host networking mode.  In 'host' networking mode, the container and host share the
same network interfaces.  Docker supports macvlan networking which can be used to
isolate the PON Controller from the host network. With macvlan, the PON Controller
container is assigned a unique MAC address separate from the network interfaces
defined on the host.

This section provides instructions for running the PON Controller container with
a macvlan for OLT management traffic. Execute docker-compose commands from the
docker/ directory.

1) Create a Docker macvlan network for the Tibit management traffic (typically
carried on VLAN 4090). This step is done separately from docker compose to preserve
the PON Controller MAC address between restarts of the container.

    docker network create -d macvlan -o parent=enp3s0f1.4090 tibitmgmt

2) Edit docker/PonCntlInit-macvlan.json to configure the Mongo Database and Tibit
management interface settings. This file provides the MongoDB and management
interface used by the PON Controller container for connectivity to the database
and MicroPlug OLT network. The "interface" parameter must be set to 'eth1', which
maps to the macvlan network created in step (1)

The docker/PonCntlInit-macvlan.json file is referenced by docker-compose.yaml.
Alternatively, edit docker-compose-macvlan.yaml to modify the bind mount to a file of
your choosing.

3) Build the docker image used by the PON Controller container using docker-compose.

    docker-compose -f docker-compose-macvlan.yaml build

4) Create, install, and start the container using docker-compose. Specify the '-d'
option to start the container in the background.

    docker-compose -f docker-compose-macvlan.yaml up -d