Code Monkey home page Code Monkey logo

ion-dtn-docker's Introduction

ION-DTN Docker Container

The ION-DTN container is a pre-built ION image solution designed to support rapid ION node deployment and extend testing capabilities. In addition, through the extension of this container image with Docker Compose, multi-node testing environments are available in a matter of seconds.

Table of Contents

  1. Installation
  2. Usage
  3. Multi-Node Environments
  4. Makefile

Quick Start

This repository includes a Makefile to simplify the deployment of the following multi-node demonstrations:

2-Node ION Ping

make up-example1

5-Node ION Exit Node

make up-example2

Installation

Requirements

  • Docker (latest recommended)
  • Docker Compose (for multi-node operation)

DockerHub

Pull image directly from DockerHub.

docker pull rtmoran/ion-dtn

Build Source

Clone repository and build from Dockerfile.

docker clone [email protected]:rtmor/ion-container.git
cd ion-container
docker build -t local/ion-dtn:latest -f build/Dockerfile .

Usage

Configuration

By default, ION-DTN container will look to /usr/local/etc/ion/ion.rc to load the node's configuration file unless other wise defined through the use of the ION_CONFIG_PATH environment variable.

Local ION configuration files may be passed to a ION container on run through the use of a Docker mount point. This can be achieved by specifiying the -v | [--volume] Docker flag on run.

Environment Variables

Variable Default Description
ION_CONFIG_PATH /usr/local/etc/ion/ion.rc ION-DTN configuration file path

Examples

Start Node:
docker run -v ${LOCAL_CONFIG_DIR}:/usr/local/etc/ion -it --rm local/ion-dtn:latest /usr/local/etc/ion/${CONFIG_NAME}.rc

Start Node & Run Command:
docker run -v ${LOCAL_CONFIG_DIR}:/usr/local/etc/ion -it --rm local/ion-dtn:latest bping ipn:10.1 ipn:11.1 -C

Multi-Node with Docker Compose

Multi-node testing environments can be achieved through the use of Docker-Compose configuration files. Included within this repository are several such examples residing within the deploy directory.

Configuration

Basic requirements for a functional ION DTN container service includes the definition of a local mount point, from which an ION configuration file may be loaded with the use of the ION_CONFIG_PATH environment variable.

For instance, the following is a simple Docker-Compose configuration for two nodes taken from deploy/example1:

services:
  ion-node-1:
    image: local/ion-dtn:latest
    ports:
      - "1113/udp"
    environment:
      ION_CONFIG_PATH: "/usr/local/etc/ion/host10.rc"
    volumes:
      - ../../config/two-node:/usr/local/etc/ion:ro
    command:
      [
        "bpecho", "ipn:10.1", "-C"
      ]
    networks:
      - ion-net
  ion-node-2:
    image: local/ion-dtn:latest
    ports:
      - "1113/udp"
    environment:
      ION_CONFIG_PATH: "/usr/local/etc/ion/host11.rc"
    volumes:
      - ../../config/two-node:/usr/local/etc/ion:ro
    command:
      [
        "bping", "-C", "ipn:11.1", "ipn:10.1"
      ]
    networks:
      - ion-net
networks:
  ion-net:

Networking

A Docker-Compose networking interface can be defined for node services through the use of the networks configuration object.

Multi-node resolving is accomplished through the addressing of foreign nodes by their hostname within the local node's ION configuration file contact plans. A node's hostname is, by default, assigned to match the Docker-Compose configuration service key-value under which it resides.

docker-compose.yaml

...
services:
  ion-node-1:
    image: local/ion-dtn:latest
...

node-2.rc

...
## begin ltpadmin
1 32

a span 11 32 32 1400 10000 1 'udplso ion-node-2:1113' 300
a span 10 32 32 1400 10000 1 'udplso ion-node-1:1113' 300

s 'udplsi ion-node-2:1113'
## end ltpadmin
...

Makefile

A Makefile has been included with this repository to simplify many of the Docker and Docker Compose tasks: build, up, tag, push, login.

To use, ensure the make package is installed.

Information on available features can be found by typing make.

deploy.env

For integration with a personal DockerHub repository, the following must be defined within a deploy.env file at the root of the project.

  • DOCKER_USER
  • DOCKER_ACCESS_TOKEN

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.