diff options
author | Kerim Gokarslan <kgokarsl@cisco.com> | 2017-09-26 12:15:30 -0700 |
---|---|---|
committer | Kerim Gokarslan <kgokarsl@cisco.com> | 2017-09-27 10:51:44 -0700 |
commit | c5c27a690fe8ce01f047330327e5bff3afb048bd (patch) | |
tree | ffa4abe020fead5794a82fa006dba02640e9396e /docs/testing | |
parent | 666f8c435109569e9ea643d4a59cb3b4c2f09e0b (diff) |
NFVBENCH-34 Pass configuration file to entrypoint script
Change-Id: If44d5d9fb2db58b3e1a3ebd1c8d94c1452f84409
Signed-off-by: Kerim Gokarslan <kgokarsl@cisco.com>
Diffstat (limited to 'docs/testing')
-rw-r--r-- | docs/testing/user/userguide/quickstart_docker.rst | 47 | ||||
-rw-r--r-- | docs/testing/user/userguide/server.rst | 2 |
2 files changed, 42 insertions, 7 deletions
diff --git a/docs/testing/user/userguide/quickstart_docker.rst b/docs/testing/user/userguide/quickstart_docker.rst index ccb629b..0ab657c 100644 --- a/docs/testing/user/userguide/quickstart_docker.rst +++ b/docs/testing/user/userguide/quickstart_docker.rst @@ -38,19 +38,54 @@ The NFVbench container requires the following Docker options to operate properly | | /tmp/nfvbench director in the container but any | | | other similar mapping can work as well | +------------------------------------------------------+------------------------------------------------------+ -| --net=host | (optional) needed if you run the NFVbench ok | +| --net=host | (optional) needed if you run the NFVbench ok | | | server in the container (or use any appropriate | | | docker network mode other than "host") | +------------------------------------------------------+------------------------------------------------------+ | --privileged | (optional) required if SELinux is enabled on the host| +------------------------------------------------------+------------------------------------------------------+ -| --e HOST="127.0.0.1" | (optional) required if REST server is enabled | +| -e HOST="127.0.0.1" | (optional) required if REST server is enabled | +------------------------------------------------------+------------------------------------------------------+ -| --e PORT=7556 | (optional) required if REST server is enabled | +| -e PORT=7556 | (optional) required if REST server is enabled | ++------------------------------------------------------+------------------------------------------------------+ +| -e CONFIG_FILE="/root/nfvbenchconfig.json | (optional) required if REST server is enabled | +------------------------------------------------------+------------------------------------------------------+ - It can be convenient to write a shell script (or an alias) to automatically insert the necessary options. +The minimal configuration file required must specify the openrc file to use (using in-container path), the PCI addresses of the 2 NIC ports to use +for generating traffic and the line rate (in each direction) of each of these 2 interfaces. + +Here is an example of mimimal configuration where: +the openrc file is located on the host current directory which is mapped under /tmp/nfvbench in the container (this is achieved using -v $PWD:/tmp/nfvbench) +the 2 NIC ports to use for generating traffic have the PCI addresses "04:00.0" and "04:00.1" + +.. code-block:: bash + { + "openrc_file": "/tmp/nfvbench/openrc", + "traffic_generator": { + "generator_profile": [ + { + "interfaces": [ + { + "pci": "04:00.0", + "port": 0, + }, + { + "pci": "04:00.1", + "port": 1, + } + ], + "intf_speed": "10Gbps", + "ip": "127.0.0.1", + "name": "trex-local", + "tool": "TRex" + } + ] + } + } + +The other options in the minimal configuration must be present and must have the same values as above. + 3. Start the Docker container ----------------------------- As for any Docker container, you can execute NFVbench measurement sessions using a temporary container ("docker run" - which exits after each NFVbench run) @@ -67,11 +102,11 @@ To run NFVBench without server mode docker run --detach --net=host --privileged -v $PWD:/tmp/nfvbench -v /dev:/dev -v /lib/modules/$(uname -r):/lib/modules/$(uname -r) --name nfvbench opnfv/nfvbench -To run NFVBench enabling REST server +To run NFVBench enabling REST server (mount the configuration json and the path for openrc) .. code-block:: bash - docker run --detach --net=host --privileged -e HOST="127.0.0.1" -e PORT=7556 -v $PWD:/tmp/nfvbench -v /dev:/dev -v /lib/modules/$(uname -r):/lib/modules/$(uname -r) --name nfvbench opnfv/nfvbench start_rest_server + docker run --detach --net=host --privileged -e HOST="127.0.0.1" -e PORT=7556 --e CONFIG_FILE="/tmp/nfvbench/nfvbenchconfig.json -v $PWD:/tmp/nfvbench -v /dev:/dev -v /lib/modules/$(uname -r):/lib/modules/$(uname -r) --name nfvbench opnfv/nfvbench start_rest_server The create an alias to make it easy to execute nfvbench commands directly from the host shell prompt: diff --git a/docs/testing/user/userguide/server.rst b/docs/testing/user/userguide/server.rst index e08f663..1c1e052 100644 --- a/docs/testing/user/userguide/server.rst +++ b/docs/testing/user/userguide/server.rst @@ -84,7 +84,7 @@ Example of return when the run completes: <http-url>/start_run (POST) ^^^^^^^^^^^^^^^^^^^^^ -This request starts an NFVBench run with passed configurations. +This request starts an NFVBench run with passed configurations. If no configuration is passed, a run with default configurations will be executed. Example request: curl -XPOST 'localhost:7556/start_run' -H "Content-Type: application/json" -d @nfvbenchconfig.json |