diff options
-rw-r--r-- | vio/requirements.txt | 11 | ||||
-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, 25 insertions, 10 deletions
diff --git a/vio/requirements.txt b/vio/requirements.txt index f2c9800..1e2334c 100644 --- a/vio/requirements.txt +++ b/vio/requirements.txt @@ -26,4 +26,13 @@ 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 +uwsgi +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 |