Deploy fuxi-server via uwsgi
Implements: blueprint goal-deploy-api-in-wsgi Change-Id: Ie601c8a02c0ce7e87254cf6546ff40ae673abae9
This commit is contained in:
parent
b840cd652c
commit
8d759150e3
|
@ -15,8 +15,6 @@
|
||||||
XTRACE=$(set +o | grep xtrace)
|
XTRACE=$(set +o | grep xtrace)
|
||||||
set +o xtrace
|
set +o xtrace
|
||||||
|
|
||||||
FUXI_BIN_DIR=$(get_python_exec_prefix)
|
|
||||||
|
|
||||||
function check_docker {
|
function check_docker {
|
||||||
if is_ubuntu; then
|
if is_ubuntu; then
|
||||||
dpkg -s docker-engine > /dev/null 2>&1
|
dpkg -s docker-engine > /dev/null 2>&1
|
||||||
|
@ -58,6 +56,8 @@ function configure_fuxi {
|
||||||
iniset $FUXI_CONFIG cinder multiattach false
|
iniset $FUXI_CONFIG cinder multiattach false
|
||||||
iniset $FUXI_CONFIG cinder fstype ext4
|
iniset $FUXI_CONFIG cinder fstype ext4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
write_uwsgi_config "$FUXI_UWSGI_CONF" "$FUXI_UWSGI" "" ":7879"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -97,12 +97,13 @@ if is_service_enabled fuxi; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
||||||
run_process fuxi "$FUXI_BIN_DIR/fuxi-server --config-file $FUXI_CONFIG" "" "root"
|
run_process fuxi "$FUXI_BIN_DIR/uwsgi --ini $FUXI_UWSGI_CONF" "" "root"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$1" == "unstack" ]]; then
|
if [[ "$1" == "unstack" ]]; then
|
||||||
stop_process fuxi-server
|
stop_process fuxi
|
||||||
|
remove_uwsgi_config "$FUXI_UWSGI_CONF" "$FUXI_UWSGI"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,10 @@ FUXI_AUTH_CACHE_DIR=${FUXI_AUTH_CACHE_DIR:-/var/cache/fuxi}
|
||||||
FUXI_DOCKER_ENGINE_PORT=${FUXI_DOCKER_ENGINE_PORT:-2375}
|
FUXI_DOCKER_ENGINE_PORT=${FUXI_DOCKER_ENGINE_PORT:-2375}
|
||||||
FUXI_VOLUME_PROVIDERS=${FUXI_VOLUME_PROVIDERS:-cinder,manila}
|
FUXI_VOLUME_PROVIDERS=${FUXI_VOLUME_PROVIDERS:-cinder,manila}
|
||||||
|
|
||||||
|
FUXI_BIN_DIR=$(get_python_exec_prefix)
|
||||||
|
FUXI_UWSGI=$FUXI_BIN_DIR/fuxi-server-wsgi
|
||||||
|
FUXI_UWSGI_CONF=$FUXI_CONFIG_DIR/fuxi-server-uwsgi.ini
|
||||||
|
|
||||||
DOCKER_CLUSTER_STORE=${DOCKER_CLUSTER_STORE:-etcd://localhost:$ETCD_PORT}
|
DOCKER_CLUSTER_STORE=${DOCKER_CLUSTER_STORE:-etcd://localhost:$ETCD_PORT}
|
||||||
|
|
||||||
GITREPO["kuryr"]=${KURYR_REPO:-${GIT_BASE}/openstack/kuryr.git}
|
GITREPO["kuryr"]=${KURYR_REPO:-${GIT_BASE}/openstack/kuryr.git}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from fuxi import app
|
||||||
|
from fuxi.common import config
|
||||||
|
from fuxi import controllers
|
||||||
|
|
||||||
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
|
||||||
|
def init_application():
|
||||||
|
config.init(sys.argv[1:])
|
||||||
|
logging.setup(config.CONF, 'fuxi')
|
||||||
|
|
||||||
|
controllers.init_app_conf()
|
||||||
|
|
||||||
|
return app
|
|
@ -25,6 +25,8 @@ oslo.config.opts =
|
||||||
console_scripts =
|
console_scripts =
|
||||||
fuxi-server = fuxi.server:start
|
fuxi-server = fuxi.server:start
|
||||||
fuxi-rootwrap = oslo_rootwrap.cmd:main
|
fuxi-rootwrap = oslo_rootwrap.cmd:main
|
||||||
|
wsgi_scripts =
|
||||||
|
fuxi-server-wsgi = fuxi.wsgi:init_application
|
||||||
|
|
||||||
[files]
|
[files]
|
||||||
packages =
|
packages =
|
||||||
|
|
Loading…
Reference in New Issue