From c22f5c237de50c176d6aa76ea9b416392647a64a Mon Sep 17 00:00:00 2001 From: Hong Hui Xiao Date: Thu, 29 Mar 2018 10:54:13 +0800 Subject: Add bootscript of pecan and uwsgi to vio Change-Id: I4904f15f20c0890a7a3bed37ebc5806178f78de6 Issue-ID: MULTICLOUD-150 Signed-off-by: Hong Hui Xiao --- vio/requirements.txt | 10 +++++++++- vio/run.sh | 17 +++++++++++------ vio/stop.sh | 3 ++- vio/vio/settings.py | 4 ++-- 4 files changed, 24 insertions(+), 10 deletions(-) (limited to 'vio') diff --git a/vio/requirements.txt b/vio/requirements.txt index f2c9800..f237334 100644 --- a/vio/requirements.txt +++ b/vio/requirements.txt @@ -26,4 +26,12 @@ unittest_xml_reporting==1.12.0 onappylog>=1.0.6 # for event -oslo_messaging \ No newline at end of file +oslo_messaging + +# for pecan framework +pecan>=1.2.1 +oslo.concurrency>=3.21.0 +oslo.config>=4.11.0 +oslo.service>=1.25.0 +eventlet>=0.20.0 +PyYAML>=3.1.0 diff --git a/vio/run.sh b/vio/run.sh index f3ba7a1..4b58fe5 100755 --- a/vio/run.sh +++ b/vio/run.sh @@ -26,11 +26,16 @@ sed -i "s/MR_PORT =.*/MR_PORT = \"${MR_PORT}\"/g" vio/pub/config/config.py logDir="/var/log/onap/multicloud/vio" -nohup python manage.py runserver 0.0.0.0:9004 2>&1 & -nohup python vio/event_listener/server.py 2>&1 & - -while [ ! -f $logDir/vio.log ]; do - sleep 1 -done +if [ "$WEB_FRAMEWORK" == "pecan" ] +then + python multivimbroker/scripts/api.py +else + # nohup python manage.py runserver 0.0.0.0:9004 2>&1 & + nohup uwsgi --http :9004 --module vio.wsgi --master --processes 4 & + nohup python vio/event_listener/server.py 2>&1 & + while [ ! -f $logDir/vio.log ]; do + sleep 1 + done tail -F $logDir/vio.log +fi diff --git a/vio/stop.sh b/vio/stop.sh index 718b3cb..e07394a 100755 --- a/vio/stop.sh +++ b/vio/stop.sh @@ -11,4 +11,5 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -ps auxww | grep 'manage.py runserver 0.0.0.0:9004' | awk '{print $2}' | xargs kill -9 +# ps auxww | grep 'manage.py runserver 0.0.0.0:9004' | awk '{print $2}' | xargs kill -9 +ps auxww |grep 'uwsgi --http :9004 --module vio.wsgi --master' |awk '{print $2}' |xargs kill -9 diff --git a/vio/vio/settings.py b/vio/vio/settings.py index f1dad0f..68411ea 100644 --- a/vio/vio/settings.py +++ b/vio/vio/settings.py @@ -26,9 +26,9 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = '3o-wney!99y)^h3v)0$j16l9=fdjxcb+a8g+q3tfbahcnu2b0o' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +# DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['*'] # Application definition -- cgit 1.2.3-korg