From a308525d388f3051f38e797112f0b3f0b0295bf7 Mon Sep 17 00:00:00 2001 From: Shaohe Feng Date: Fri, 27 Apr 2018 12:51:27 +0000 Subject: [PATCH] bug fix: endpoint register, import and devstack broken issues. 1. amend keyston endpoint register info Service type should acceleration instead of cyborg. For cyborg is just the service name. We do not support uwsgi at present, so we must indicate service port explicitly. 2. Fix package import error Add full path to import module, so that the reference can be resolved. Story: 2001887 Task: 14368 3. devstack broken TypeError: launch_service() got an unexpected keyword argument 'restart_method' When initialize cyborg api service launcher, we already pass restart_method. So no need to pass restart_method to launcher.launch_service, and it has not restart_method argument. Co-Authored-By: jiapei Co-Authored-By: Zhipeng Huang Change-Id: Ic69e76b7bf86bbd1382aff07694ea9fbafd0862a --- cyborg/accelerator/drivers/generic_driver.py | 2 +- cyborg/cmd/api.py | 3 +-- devstack/lib/cyborg | 9 +++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cyborg/accelerator/drivers/generic_driver.py b/cyborg/accelerator/drivers/generic_driver.py index 2e13ecc2..d8a9ec68 100644 --- a/cyborg/accelerator/drivers/generic_driver.py +++ b/cyborg/accelerator/drivers/generic_driver.py @@ -17,7 +17,7 @@ Cyborg Generic driver implementation. """ -from modules import generic +from cyborg.accelerator.drivers.modules import generic from oslo_config import cfg from oslo_log import log diff --git a/cyborg/cmd/api.py b/cyborg/cmd/api.py index a1001569..7199e7b6 100644 --- a/cyborg/cmd/api.py +++ b/cyborg/cmd/api.py @@ -32,6 +32,5 @@ def main(): # Build and start the WSGI app launcher = cyborg_service.process_launcher() server = cyborg_service.WSGIService('cyborg_api', CONF.api.enable_ssl_api) - launcher.launch_service(server, workers=server.workers, - restart_method='mutate') + launcher.launch_service(server, workers=server.workers) launcher.wait() diff --git a/devstack/lib/cyborg b/devstack/lib/cyborg index f389eb09..dd570790 100644 --- a/devstack/lib/cyborg +++ b/devstack/lib/cyborg @@ -40,6 +40,7 @@ CYBORG_CONF_FILE=$CYBORG_CONF_DIR/cyborg.conf CYBORG_ROOTWRAP_CONF=$CYBORG_CONF_DIR/rootwrap.conf CYBORG_POLICY_JSON=$CYBORG_CONF_DIR/policy.json CYBORG_SERVICE_HOST=${CYBORG_SERVICE_HOST:-$SERVICE_HOST} +CYBORG_SERVICE_PORT=${CYBORG_SERVICE_PORT:-6666} CYBORG_SERVICE_PROTOCOL=${CYBORG_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL} if [[ -d ${CYBORG_DIR}/bin ]]; then CYBORG_BIN_DIR=${CYBORG_DIR}/bin @@ -99,12 +100,12 @@ function configure_cyborg_dirs { # service cyborg admin function create_cyborg_accounts { create_service_user "cyborg" "admin" - get_or_create_service "cyborg" "cyborg" "Cyborg Accelerators Service" + get_or_create_service "cyborg" "acceleration" "Cyborg Accelerators Service" get_or_create_endpoint "cyborg" \ "$REGION_NAME" \ - "${CYBORG_SERVICE_PROTOCOL}://${CYBORG_SERVICE_HOST}/cyborg/v1" \ - "${CYBORG_SERVICE_PROTOCOL}://${CYBORG_SERVICE_HOST}/cyborg/v1" \ - "${CYBORG_SERVICE_PROTOCOL}://${CYBORG_SERVICE_HOST}/cyborg/v1" + "${CYBORG_SERVICE_PROTOCOL}://${CYBORG_SERVICE_HOST}:${CYBORG_SERVICE_PORT}/v1" \ + "${CYBORG_SERVICE_PROTOCOL}://${CYBORG_SERVICE_HOST}:${CYBORG_SERVICE_PORT}/v1" \ + "${CYBORG_SERVICE_PROTOCOL}://${CYBORG_SERVICE_HOST}:${CYBORG_SERVICE_PORT}/v1" }