From b033bc42c1383150b78ddee356e1eafbd40b3c70 Mon Sep 17 00:00:00 2001 From: Lihi Wishnitzer Date: Mon, 16 Jul 2018 11:52:29 +0300 Subject: [PATCH] Run Docker container without the controller service This adds the option to run the Docker container without the controller service running on the container. This is useful in order to create separation between the Dragonflow API (df-db) and the controller service. Related-Bug: #1778007 Change-Id: I4fb77ae03e47942a75d34bfb4f8c80db21a3aec6 --- doc/source/docker_install.rst | 14 ++++++++++++++ tools/run_dragonflow.sh | 7 +++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/source/docker_install.rst b/doc/source/docker_install.rst index 13582a0ca..122383800 100644 --- a/doc/source/docker_install.rst +++ b/doc/source/docker_install.rst @@ -78,3 +78,17 @@ automatically if they do not exist: If these files exist, they are used as-is, and are not overwritten. You can add these files using e.g. `-v local-dragonflow-conf.ini:/etc/dragonflow/dragonflow.ini`. + + + +Running the container without the controller service +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +This enables you to run the container without running the container service. +This is useful in order to create a standalone node for Dragonflow API, +separated from the controller node. + +* Run the following commands: + +.. code-block:: bash + + docker run --name dragonflow --net $DRAGONFLOW_NET_NAME --ip ${DRAGONFLOW_ADDRESS} -e DF_NO_CONTROLLER=1 -i -t dragonflow:latest --dragonflow_address ${DRAGONFLOW_ADDRESS} --db_address ${NODE1}:2379 diff --git a/tools/run_dragonflow.sh b/tools/run_dragonflow.sh index 8f5bc6896..a59c4ea56 100755 --- a/tools/run_dragonflow.sh +++ b/tools/run_dragonflow.sh @@ -46,5 +46,8 @@ if [ -n "$DB_INIT" ]; then df-db init fi -/usr/local/bin/df-local-controller --config-file /etc/dragonflow/dragonflow.ini - +if [ -z "$DF_NO_CONTROLLER" ]; then + /usr/local/bin/df-local-controller --config-file /etc/dragonflow/dragonflow.ini +else + /bin/bash +fi