diff options
author | Hong Hui Xiao <honghui_xiao@yeah.net> | 2018-03-29 10:54:13 +0800 |
---|---|---|
committer | Liang Ke <lokyse@163.com> | 2018-03-29 03:11:15 +0000 |
commit | c22f5c237de50c176d6aa76ea9b416392647a64a (patch) | |
tree | ecc87513f4e931fda011fb4850d02a0fa2e86cf0 /vio | |
parent | 1ce731bc5f3e47fbf3bb49a81760a809e9077aed (diff) |
Add bootscript of pecan and uwsgi to vio
Change-Id: I4904f15f20c0890a7a3bed37ebc5806178f78de6
Issue-ID: MULTICLOUD-150
Signed-off-by: Hong Hui Xiao <honghui_xiao@yeah.net>
Diffstat (limited to 'vio')
-rw-r--r-- | vio/requirements.txt | 10 | ||||
-rwxr-xr-x | vio/run.sh | 17 | ||||
-rwxr-xr-x | vio/stop.sh | 3 | ||||
-rw-r--r-- | vio/vio/settings.py | 4 |
4 files changed, 24 insertions, 10 deletions
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 @@ -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 |