From 222ea5c3cde6edc20fd6a9c22ae21c9a7fbef8ff Mon Sep 17 00:00:00 2001 From: bharath Date: Mon, 5 Nov 2018 20:37:04 +0530 Subject: [PATCH] Fix common issues for deploy model Change-Id: I29a88bf0ed0ea445ad7f280cb8dc9943f6593c5e --- devstack/lib/gyan | 10 ++++++++-- gyan/common/utils.py | 3 ++- requirements.txt | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/devstack/lib/gyan b/devstack/lib/gyan index ad5c525..cb25c7a 100644 --- a/devstack/lib/gyan +++ b/devstack/lib/gyan @@ -154,6 +154,7 @@ function create_gyan_conf { iniset $GYAN_CONF DEFAULT debug "$ENABLE_DEBUG_LOG_LEVEL" iniset $GYAN_CONF DEFAULT my_ip "$HOST_IP" iniset $GYAN_CONF DEFAULT host "$HOST_IP" + iniset $GYAN_CONF DEFAULT transport_url "rabbit://stackrabbit:$RABBIT_PASSWORD@$SERVICE_HOST/" iniset $GYAN_CONF oslo_messaging_rabbit rabbit_userid $RABBIT_USERID iniset $GYAN_CONF oslo_messaging_rabbit rabbit_password $RABBIT_PASSWORD iniset $GYAN_CONF oslo_messaging_rabbit rabbit_host $RABBIT_HOST @@ -180,6 +181,7 @@ function create_gyan_conf { iniset $GYAN_CONF keystone_authtoken www_authenticate_uri $KEYSTONE_SERVICE_URI_V3 iniset $GYAN_CONF keystone_authtoken auth_url $KEYSTONE_AUTH_URI_V3 iniset $GYAN_CONF keystone_authtoken auth_version v3 + iniset $GYAN_CONF comput host $HOST_IP if is_fedora || is_suse; then @@ -306,8 +308,12 @@ function start_gyan { # ``run_process`` checks ``is_service_enabled``, it is not needed here mkdir -p /opt/stack/data/gyan - start_gyan_api - start_gyan_compute + if is_service_enabled gyan-api; then + start_gyan_api + fi + if is_service_enabled gyan-compute; then + start_gyan_compute + fi } # stop_gyan() - Stop running processes (non-screen) diff --git a/gyan/common/utils.py b/gyan/common/utils.py index 289cbbf..f97cea5 100644 --- a/gyan/common/utils.py +++ b/gyan/common/utils.py @@ -24,6 +24,7 @@ import inspect import json import mimetypes import os +import zipfile from oslo_concurrency import processutils from oslo_context import context as common_context @@ -270,4 +271,4 @@ def save_model(path, model): f.write(model.ml_data) zip_ref = zipfile.ZipFile(file_path+'.zip', 'r') zip_ref.extractall(file_path) - zip_ref.close() \ No newline at end of file + zip_ref.close() diff --git a/requirements.txt b/requirements.txt index 035de03..aed1030 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,5 +26,5 @@ SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT stevedore>=1.20.0 # Apache-2.0 pypng numpy -tensorflow +tensorflow==1.5 idx2numpy