...
sudo vi /etc/environment
...
OPENNSA=/data/dev/opennsa
TESTOPENNSA=/data/dev/testopennsa
OPENNSAMNGMT=/data/dev/opennsamngmt
Now clone these repositories in the correct place and switch to valid branches:
cd /data/dev
git clone ssh://git@code.geant.net:7999/ccs/opennsa.git opennsa
git clone ssh://git@code.geant.net:7999/ccs/onsa-tests.git testopennsa
git clone ssh://git@code.geant.net:7999/ccs/onsa-mngmt.git opennsamngmt
cd opennsa
git checkout domainaggregate
cd ../testopennsa
git checkout develop
Next, we need to provide PostgreSQL some credentials (passwords). You do not want to have to enter the password every time you start the database! So create a file ~/.pgpass, and give it the following content:
# ~/.pgpass
# hostname:port:database:username:password
10.50.0.100:5432:*:opennsa:secretpassword
localhost:5432:*:opennsa:secretpassword
...
The last command will verify if your docker installation is up-and-running. It will download the 'hello-world' image from the central Docker image repository, create a container using that image and start that container.
Info | ||
---|---|---|
| ||
In order to be able to run docker and docker-compose commands without sudo it is needed to add current user do docker group (the first step is optional, the docker group should already exists at this step): sudo groupadd docker sudo gpasswd -a $USER docker This step may be necessary if we want to use setup scripts (with sudo it is need to set e.g. environment variables for root also) |
Creating an OpenNSA image from a Dockerfile
...
This Docker setup simulates a simple three nodes, one aggregator setup.
![Network drawing](nwlayout.png)##
Sample usage
Suppose we want to create a connection between node11 and node12, and we are a user in domain1 with access to nsi1.
We are going to use onsa tool to reserve and provision this connection.
The complete command sequence will be:```bash
$ $TESTOPENNSA/docker/intradomain/setup init
$ $OPENNSA/onsa reserve \
-p domain1:nsa \
-u http://10.50.0.2:9445/NSI/services/CS2 \
--source node11.domain1:topology:port1?vlan=123 \
--dest node12.domain1:topology:port2?vlan=123
$ $OPENNSA/onsa provision \
-p domain1:nsa \
-u http://10.50.0.2:9445/NSI/services/CS2 \
-c DO-015774acaa
$ $OPENNSA/onsa queryrec \
-p domain1:nsa \
-u http://10.50.0.2:9445/NSI/services/CS2 \
-c DO-e0b4f25a66
$ $OPENNSA/onsa terminate \
-p domain1:nsa \
-u http://10.50.0.2:9445/NSI/services/CS2 \
-c DO-e0b4f25a66
$ $TESTOPENNSA/docker/intradomain/setup exit