From 6c80ac7ca497424ec867c86e43159b3e7f5800c0 Mon Sep 17 00:00:00 2001 From: agardner Date: Thu, 30 Mar 2017 15:16:55 -0400 Subject: bring danube branch up to date with master Gerrit doesn't like merge commits eg: this wont work git merge origin/master --no-commit git commit -sv git review stable/danube So I took the diff git diff origin/stable/danube..master and checked out the files that were changed git checkout origin/master -- featureconfig.rst normally you should checkout the change sets and resolve the merge conflitcs, but in this case we dont care. Change-Id: I2a02e8ae7237825911f22663a5c65cdb9f5c5e4f Signed-off-by: agardner --- docs/development/overview/feature.overview.rst | 1 + docs/development/overview/index.rst | 11 +- docs/release/configguide/featureconfig.rst | 36 ++++++ docs/release/configguide/index.rst | 14 +++ docs/release/index.rst | 20 +++ docs/release/installation/featureconfig.rst | 43 ------- docs/release/installation/index.rst | 22 ++-- docs/release/userguide/feature.userguide.rst | 1 + docs/release/userguide/index.rst | 5 +- tests/run_on_remotenodes.sh | 168 +++++++++++++++++++++++++ 10 files changed, 256 insertions(+), 65 deletions(-) create mode 100644 docs/release/configguide/featureconfig.rst create mode 100644 docs/release/configguide/index.rst create mode 100644 docs/release/index.rst delete mode 100644 docs/release/installation/featureconfig.rst create mode 100755 tests/run_on_remotenodes.sh diff --git a/docs/development/overview/feature.overview.rst b/docs/development/overview/feature.overview.rst index 4ef8d16..7980459 100644 --- a/docs/development/overview/feature.overview.rst +++ b/docs/development/overview/feature.overview.rst @@ -1,5 +1,6 @@ .. This work is licensed under a Creative Commons Attribution 4.0 International License. .. http://creativecommons.org/licenses/by/4.0 +.. (c) 2017 OPNFV ================== Domino Description diff --git a/docs/development/overview/index.rst b/docs/development/overview/index.rst index 84b729f..6790b6c 100644 --- a/docs/development/overview/index.rst +++ b/docs/development/overview/index.rst @@ -1,11 +1,12 @@ -.. _domino-overview: - .. This work is licensed under a Creative Commons Attribution 4.0 International License. .. http://creativecommons.org/licenses/by/4.0 +.. (c) 2017 OPNFV + +.. _domino-overview: -***************** -Domino User Guide -***************** +*********************** +Domino Project Overview +*********************** .. toctree:: :maxdepth: 3 diff --git a/docs/release/configguide/featureconfig.rst b/docs/release/configguide/featureconfig.rst new file mode 100644 index 0000000..6d2056c --- /dev/null +++ b/docs/release/configguide/featureconfig.rst @@ -0,0 +1,36 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) 2017 OPNFV + +Domino Configuration +==================== +Domino Server and Clients can be configured via (i) passing command line options +(see API documentation) and (ii) the configuration file "domino_conf.py" under the +main directory. + +* The default file for logging is set as none and log level set as "WARNING". + +Domino Server +------------- +* The default server unique user ID is set as 0 in the configuration file. + +* The default TCP port for RPC calls is set as 9090 in the configuration file. + +* The default database file for Domino Server is set as "dominoserver.db" under the main directory + +* The default folder for keeping published TOSCA files and pushed parts is set as "toscafiles" in the configuration file via variable TOSCADIR. + +* The default log level (WARNING) can be changed by passing the flags --log or -l followed by a log level, e.g., ERROR, WARNING, INFO, or DEBUG. + +Domino Client +------------- +* The default mode of CLI is non-interactive (i.e., Domino CLI Utility is used). Passing --iac=TRUE would begin the client in interactive mode. + +* The default log level (WARNING) can be changed by passing the flags --log or -l followed by a log level, e.g., ERROR, WARNING, INFO, or DEBUG. + +* The default Domino Server IP is set as "localhost". This can be overwritten at the time of launching DominoClient via the option flags -i or --ipaddr followed by the IP address of the actual server hosting the Domino Server. + +* The default Domino Client TCP port for RPC calls is set as 9091 in the configuration file. It can be overwritten when the DominoClient is launched by passing the flags --port or -p followed by the port number. + +* The default folder for keeping preceived TOSCA files is set as "toscafiles" in the configuration file via variable TOSCA_RX_DIR. + diff --git a/docs/release/configguide/index.rst b/docs/release/configguide/index.rst new file mode 100644 index 0000000..c240a91 --- /dev/null +++ b/docs/release/configguide/index.rst @@ -0,0 +1,14 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) 2017 OPNFV + +.. _domino-configguide: + +************************** +Domino Configuration Guide +************************** + +.. toctree:: + :maxdepth: 2 + + featureconfig.rst diff --git a/docs/release/index.rst b/docs/release/index.rst new file mode 100644 index 0000000..eb21134 --- /dev/null +++ b/docs/release/index.rst @@ -0,0 +1,20 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) 2017 OPNFV + + +====== +Domino +====== + +.. toctree:: + :maxdepth: 2 + :numbered: + + ./installation/index.rst + ./configguide/index.rst + ./userguide/index.rst + +Indices +======= +* :ref:`search` diff --git a/docs/release/installation/featureconfig.rst b/docs/release/installation/featureconfig.rst deleted file mode 100644 index e47e0c0..0000000 --- a/docs/release/installation/featureconfig.rst +++ /dev/null @@ -1,43 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. -.. http://creativecommons.org/licenses/by/4.0 - -.. image:: ../etc/opnfv-logo.png - :height: 40 - :width: 200 - :alt: OPNFV - :align: left -.. these two pipes are to seperate the logo from the first title -| -| -Domino Configuration -==================== -Domino Server and Clients can be configured via (i) passing command line options -(see API documentation) and (ii) the configuration file "domino_conf.py" under the -main directory. - -* The default file for logging is set as none and log level set as "WARNING". - -Domino Server -------------- -* The default server unique user ID is set as 0 in the configuration file. - -* The default TCP port for RPC calls is set as 9090 in the configuration file. - -* The default database file for Domino Server is set as "dominoserver.db" under the main directory - -* The default folder for keeping published TOSCA files and pushed parts is set as "toscafiles" in the configuration file via variable TOSCADIR. - -* The default log level (WARNING) can be changed by passing the flags --log or -l followed by a log level, e.g., ERROR, WARNING, INFO, or DEBUG. - -Domino Client -------------- -* The default mode of CLI is non-interactive (i.e., Domino CLI Utility is used). Passing --iac=TRUE would begin the client in interactive mode. - -* The default log level (WARNING) can be changed by passing the flags --log or -l followed by a log level, e.g., ERROR, WARNING, INFO, or DEBUG. - -* The default Domino Server IP is set as "localhost". This can be overwritten at the time of launching DominoClient via the option flags -i or --ipaddr followed by the IP address of the actual server hosting the Domino Server. - -* The default Domino Client TCP port for RPC calls is set as 9091 in the configuration file. It can be overwritten when the DominoClient is launched by passing the flags --port or -p followed by the port number. - -* The default folder for keeping preceived TOSCA files is set as "toscafiles" in the configuration file via variable TOSCA_RX_DIR. - diff --git a/docs/release/installation/index.rst b/docs/release/installation/index.rst index a8a0a0a..db9f506 100644 --- a/docs/release/installation/index.rst +++ b/docs/release/installation/index.rst @@ -1,23 +1,15 @@ -.. _domino-installation: - .. This work is licensed under a Creative Commons Attribution 4.0 International License. .. http://creativecommons.org/licenses/by/4.0 +.. (c) 2017 OPNFV + +.. _domino-installation: -.. image:: ../etc/opnfv-logo.png - :height: 40 - :width: 200 - :alt: OPNFV - :align: left -| -| -********************** -Installation procedure -********************** -Colorado 1.0 ------------- +******************************* +Domino Installation Instruction +******************************* .. toctree:: :maxdepth: 2 + :numbered: installation.instructions.rst - featureconfig.rst diff --git a/docs/release/userguide/feature.userguide.rst b/docs/release/userguide/feature.userguide.rst index 6187a22..8705a77 100644 --- a/docs/release/userguide/feature.userguide.rst +++ b/docs/release/userguide/feature.userguide.rst @@ -1,5 +1,6 @@ .. This work is licensed under a Creative Commons Attribution 4.0 International License. .. http://creativecommons.org/licenses/by/4.0 +.. (c) 2017 OPNFV ======================================== Domino API Usage Guidelines and Examples diff --git a/docs/release/userguide/index.rst b/docs/release/userguide/index.rst index 510fb38..7372cb3 100644 --- a/docs/release/userguide/index.rst +++ b/docs/release/userguide/index.rst @@ -1,7 +1,8 @@ -.. _domino-userguide: - .. This work is licensed under a Creative Commons Attribution 4.0 International License. .. http://creativecommons.org/licenses/by/4.0 +.. (c) 2017 OPNFV + +.. _domino-userguide: ***************** Domino User Guide diff --git a/tests/run_on_remotenodes.sh b/tests/run_on_remotenodes.sh new file mode 100755 index 0000000..f60f469 --- /dev/null +++ b/tests/run_on_remotenodes.sh @@ -0,0 +1,168 @@ +#!/bin/bash -ex + +#Copyright 2016 Open Platform for NFV Project, Inc. and its contributors +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +IS_IPandKEY_CONFIGURED=true +USERNAME=ubuntu +#SSH_KEY_PATH=/home/opnfv/repos/domino/tests/testkeys/id_rsa +#DOMINO_CODE_PATH=/home/opnfv/repos/domino +SSH_KEY_PATH=./tests/testkeys/id_rsa +DOMINO_CODE_PATH=../domino +CONTROLLER_NODE_1=192.168.2.165 +CONTROLLER_NODE_2=192.168.2.180 +CONTROLLER_NODE_3=192.168.2.181 + +CLIENT1_PORT=9091 +CLIENT2_PORT=9092 +CLIENT1_CLIPORT=9100 +CLIENT2_CLIPORT=9200 +LOGLEVEL=DEBUG + +toscafile_test1=./tosca-templates/tosca_helloworld_nfv.yaml +test1_reffile1=./tests/refdata/test1_client1.ref +test1_reffile2=./tests/refdata/test1_client2.ref +client1_log=./tests/logdata/client1.log +client2_log=./tests/logdata/client2.log +server_log=./tests/logdata/server.log +ssh_opts="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + +install_dependency() { + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_1" 'sudo pip install tosca-parser' + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_1" 'sudo pip install heat-translator' + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" 'sudo pip install tosca-parser' + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" 'sudo pip install heat-translator' + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" 'sudo pip install tosca-parser' + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" 'sudo pip install heat-translator' +} + +remove_codes(){ + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_1" 'rm -rf domino' + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" 'rm -rf domino' + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" 'rm -rf domino' +} + +deploy_codes(){ + scp $ssh_opts -i "$SSH_KEY_PATH" -r "$DOMINO_CODE_PATH" "$USERNAME"@"$CONTROLLER_NODE_1":. + scp $ssh_opts -i "$SSH_KEY_PATH" -r "$DOMINO_CODE_PATH" "$USERNAME"@"$CONTROLLER_NODE_2":. + scp $ssh_opts -i "$SSH_KEY_PATH" -r "$DOMINO_CODE_PATH" "$USERNAME"@"$CONTROLLER_NODE_3":. +} + +start_server() { + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_1" 'pgrep -f "python DominoServer.py"' && return 0 + ssh $ssh_opts -f -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_1" "sh -c 'cd ./domino; nohup python DominoServer.py --log "$LOGLEVEL" > "$server_log" > /dev/null 2>&1 &'" +} + +start_client1() { + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" 'pgrep -f "python DominoClient.py"' && return 0 + ssh $ssh_opts -f -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd ./domino; nohup python DominoClient.py -p $CLIENT1_PORT --cliport $CLIENT1_CLIPORT --ipaddr $CONTROLLER_NODE_1 --log "$LOGLEVEL" > "$client1_log" > /dev/null 2>&1 &'" +} + +start_client2() { + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" 'pgrep -f "python DominoClient.py"' && return 0 + ssh $ssh_opts -f -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" "sh -c 'cd ./domino; nohup python DominoClient.py -p $CLIENT2_PORT --cliport $CLIENT2_CLIPORT --ipaddr $CONTROLLER_NODE_1 --log "$LOGLEVEL" > "$client2_log" > /dev/null 2>&1 &'" +} + +stop_server() { + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_1" 'pgrep -f "python DominoServer.py"' || return 0 + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_1" 'kill $(pgrep -f "python DominoServer.py")' +} + +stop_client1() { + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" 'pgrep -f "python DominoClient.py"' || return 0 + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" 'kill $(pgrep -f "python DominoClient.py")' +} + +stop_client2() { + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" 'pgrep -f "python DominoClient.py"' || return 0 + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" 'kill $(pgrep -f "python DominoClient.py")' +} + +cleanup() { + chmod 600 "$SSH_KEY_PATH" + set +e + echo "cleanup..." + + echo "Stopping Domino Clients..." + stop_client1 + sleep 1 + stop_client2 + sleep 1 + + echo "Stopping Domino Server..." + stop_server + sleep 1 +} + +prepare_testenv() { + chmod 600 "$SSH_KEY_PATH" + install_dependency + remove_codes + deploy_codes +} + +launch_domino() { + echo "Launching Domino Server..." + start_server + sleep 1 + echo "Launching Domino Client 1..." + start_client1 + sleep 1 + echo "Launching Domino Client 2..." + start_client2 + sleep 1 +} + +echo "domino/tests/run_multinode.sh has been executed." + +if [ "$IS_IPandKEY_CONFIGURED" = "true" ]; then + trap cleanup EXIT + + cleanup + prepare_testenv + launch_domino + + + echo "Test Heartbeat" + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT heartbeat'" + sleep 1 + + echo "Test Subscribe API" + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -t hot -l tosca.policies.Placement:properties:region:nova-1'" + sleep 1 + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top OVERWRITE'" + sleep 1 + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -t dummy1,dummy2 --top DELETE'" + sleep 1 + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement:properties:region:nova-2'" + sleep 1 + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement:properties:region:nova-3 --lop OVERWRITE'" + sleep 1 + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement:properties:region:nova-3 --lop DELETE'" + sleep 1 + + echo "Test Publish API" + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" "sh -c 'cd domino; python domino-cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1"'" + + sleep 1 + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_2" "sh -c 'cd domino; python domino-cli.py $CLIENT1_CLIPORT subscribe -l tosca.policies.Placement.Geolocation:properties:region:us-west-1'" + sleep 1 + ssh $ssh_opts -i "$SSH_KEY_PATH" "$USERNAME"@"$CONTROLLER_NODE_3" "sh -c 'cd domino; python domino-cli.py $CLIENT2_CLIPORT publish -t "$toscafile_test1"'" + + echo "done" + +else + + echo "set IS_IPandKEY_CONFIGURED as true to run the test" + +fi + + -- cgit 1.2.3-korg