Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

cd $OPENNSA
docker build -t opennsa_img -f docker/Dockerfile .

...

docker run -p 9080:9080 opennsa_img
wget http://localhost:9080/NSI/discovery.xml

However, normally you want do start multiple containers
with a more advanced configuration per container. For
this, we use docker-compose (a python module):

...

A simple docker-compose.yml (it runs only one container) looks like this:

...

cd /data/opennsa
docker-compose up

...

Note that this creates an image which contains the correct Python prerequisites, but the source code ($OPENNSA in /opennsa and $TESTOPENNSA in /testopennsa) will be mounted by the docker-compose command that starts the container as well as the correct command (CMD) which will be executed by this container.

Run openNSA Docker containers

We start OpenNSA containers by running the 'setup' script of one of the pre-fabricated openNSA simulation setups. In this document we use the Intra-domain setup which can be found in $TESTOPENNSA/docker/intradomain.

The intra-domain setup is started as follows

$TESTOPENNSA/docker/intradomain/setup init

The setup script will create a virtual bridge connected to the 10.50.x.y network, start a Postgresql docker container in IP address 10.50.0.100 and three openNSA containers. The setup script can be used for multiple purposes:

  • setup init  – initialise and start the complete setup (bridge, dbms, opennsa nodes)
  • setup exit – stops and destroys the setup (removes bridge, dbms and opennsa nodes)
  • setup start – starts an already created (but stopped) setup
  • setup stop – stops a created setup
  • setup prepare – -reinitialise the databases

...

Some configuration is needed for the nodes defined above (using opennsa-ams as an example).

Each of the OpenNSA nodes need their own database:

cd /data/opennsa
sudo -u postgres createdb -O opennsa opennsa-ams
sudo -u postgres psql -U opennsa -W opennsa-ams < datafiles/schema.sql

...

  • opennsa-ams-dud.tac: The twisted startup file, points to .conf
  • opennsa-ams-dud.conf: Node configuration, points to .nrm
  • opennsa-ams-top.nrm: Node topology