You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add ONVM Dockerfile and Update Docker Resources (#38)
This change updates the docker.sh script which helps users launch NFs
inside Docker containers. It removes an unncessary argument, `-w
WORKINGDIRECTORY`, and changes it to launch containers based off of the
new sdnfv/opennetvm Docker image.
This change also provides a Dockerfile which can be used for docker
image creation. It creates a docker image based off of Ubuntu 14.04
which is what is uploaded to our [Docker Hub
account](https://hub.docker.com/r/sdnfv/opennetvm/).
With the script changes and use of our Dockerhub account, this change
also updates the Docker README in the docs directory to provide the most
up-to-date information about Docker and OpenNetVM.
Testing:
* Launched a few containers in various topologies in Docker
containers and ensured traffic flowed through the chain and
latency/throughput matched what was expected when running directly on
the host.
To run openNetVM NFs inside Docker containers, use the
5
-
included [Docker Script][docker]. This script does the following:
4
+
To run openNetVM NFs inside Docker containers, use the included [Docker Script][docker]. We provide a [Docker image on Docker Hub][onvm-docker] that is a copy of [Ubuntu 14.04][ubuntu] with a few dependencies installed. This script does the following:
6
5
7
-
- Creates a Docker container with a custom name
6
+
- Creates a Docker container off of the [sdnfv/opennetvm Docker image][onvm-docker]with a custom name
8
7
- Maps NIC devices from the host into the container
9
8
- Maps the shared hugepage region into the container
10
9
- Maps the openNetVM directory into the container
11
10
- Maps any other directories you want into the container
12
-
- Configures the container to use all of the shared memory and data
13
-
structures
14
-
- Depending on the presence of a path or not, the container starts the NF
15
-
automatically in detached mode or the terminal is connected to it to
16
-
run the NF by hand
11
+
- Configures the container to use all of the shared memory and data structures
12
+
- Depending on the presence of a command to run, the container starts the NF automatically in detached mode or the terminal is connected to it to run the NF by hand
17
13
18
14
Usage
19
15
--
20
16
21
-
To use the script, simply run it from the command line with the
22
-
following options:
17
+
To use the script, simply run it from the command line with the following options:
23
18
24
-
```
25
-
sudo ./docker.sh -h HUGEPAGES -o ONVM -n NAME [-D DEVICES] [-d DIRECTORY] [-w WORKING DIRECTORY] [-c COMMAND]
- This will start a container with two NIC devices mapped in, /dev/uio0
45
-
and /dev/uio1, the hugepage directory at `/mnt/huge` mapped in, and the
46
-
openNetVM source directory at `/root/openNetVM` mapped into the
47
-
container with the name of Basic_Monitor_NF.
34
+
- This will start a container with two NIC devices mapped in, /dev/uio0 and /dev/uio1, the hugepage directory at `/mnt/huge` mapped in, and the openNetVM source directory at `/root/openNetVM` mapped into the container with the name of Basic_Monitor_NF.
- This will start a container with one NIC device mapped in, /dev/uio0
55
-
, the hugepage directory at `/mnt/huge` mapped in, and the
56
-
openNetVM source directory at `/root/openNetVM` mapped into the
57
-
container with the name of Simple_Forward_NF. Also, the container will be
58
-
started in detached mode (no connection to it). It will have the simple_forward
59
-
subdirectory as its working directory, and it will run the go-docker script of
60
-
the simple forward NF.
61
-
Careful, the path needs to be correct inside the container (use absolute path,
62
-
here the openNetVM directory is mapped in the /).
40
+
- This will start a container with one NIC device mapped in, /dev/uio0 , the hugepage directory at `/mnt/huge` mapped in, and the openNetVM source directory at `/root/openNetVM` mapped into the container with the name of Speed_Tester_NF. Also, the container will be started in detached mode (no connection to it) and it will run the go script of the simple forward NF.
41
+
Careful, the path needs to be correct inside the container (use absolute path, here the openNetVM directory is mapped in the /).
63
42
64
43
65
44
Running NFs Inside Containers
@@ -74,48 +53,47 @@ Some prerequisites are:
74
53
75
54
Here is an example of starting a container and then running an NF inside of it:
You can also use the optional command argument to run directly the NF inside of the container (and the optional working directory argument to have more control on the command context of execution), without connecting to it. Then, to stop gracefully the NF (so it has time to notify onvm manager), use the docker stop command before docker rm the container.
84
+
You can also use the optional command argument to run directly the NF inside of the container, without connecting to it. Then, to stop gracefully the NF (so it has time to notify onvm manager), use the docker stop command before docker rm the container.
109
85
The prerequisites are the same as in the case where you connect to the container.
0 commit comments