Add a new service wsproxy to Zun

Implements: blueprint stream-via-rest-api

Change-Id: I22dc9e39a2133d1cb2951f54c76edee286582ad0
Signed-off-by: Kevin Zhao <kevin.zhao@linaro.org>
This commit is contained in:
Kevin Zhao 2017-05-04 14:51:01 +08:00
parent 763e6a300d
commit 24c37bce01
3 changed files with 11 additions and 0 deletions

View File

@ -81,6 +81,8 @@ ZUN_DB_TYPE=${ZUN_DB_TYPE:-sql}
ZUN_ETCD_VERSION=${ZUN_ETCD_VERSION:-v3.0.13}
ZUN_ETCD_PORT=${ZUN_ETCD_PORT:-2379}
ZUN_WEBSOCKET_PROXY_PORT=${ZUN_WEBSOCKET_PROXY_PORT:-6784}
ZUN_WEBSOCKET_PROXY_IP=${ZUN_WEBSOCKET_PROXY_IP:-0.0.0.0}
if is_ubuntu; then
UBUNTU_RELEASE_BASE_NUM=`lsb_release -r | awk '{print $2}' | cut -d '.' -f 1`
fi
@ -262,6 +264,8 @@ function create_zun_conf {
iniset $ZUN_CONF database connection `database_connection_url zun`
iniset $ZUN_CONF etcd etcd_host "$HOST_IP"
iniset $ZUN_CONF etcd etcd_port "$ZUN_ETCD_PORT"
iniset $ZUN_CONF websocket_proxy wsproxy_port "$ZUN_WEBSOCKET_PROXY_PORT"
iniset $ZUN_CONF websocket_proxy wsproxy_host "$ZUN_WEBSOCKET_PROXY_IP"
iniset $ZUN_CONF api host_ip 0.0.0.0
iniset $ZUN_CONF api port "$ZUN_SERVICE_PORT"
@ -424,6 +428,11 @@ function start_zun_api {
if is_service_enabled tls-proxy; then
start_tls_proxy '*' $ZUN_SERVICE_PORT $ZUN_SERVICE_HOST $ZUN_SERVICE_PORT_INT &
fi
# Start websocket proxy for interactive mode
if is_service_enabled zun-wsproxy; then
run_process zun-wsproxy "$ZUN_BIN_DIR/zun-wsproxy"
fi
}
# start_zun_compute() - Start Zun compute agent

View File

@ -18,6 +18,7 @@
# Enable Zun services
enable_service zun-api
enable_service zun-compute
enable_service zun-wsproxy
if [[ ${ZUN_DB_TYPE} == "etcd" ]]; then
enable_service zun-etcd

View File

@ -49,6 +49,7 @@ console_scripts =
zun-api = zun.cmd.api:main
zun-compute = zun.cmd.compute:main
zun-db-manage = zun.cmd.db_manage:main
zun-wsproxy = zun.cmd.wsproxy:main
oslo.config.opts =
zun = zun.opts:list_opts