From cbf9e191f3ea95285af948b7cef2999469f2bc7f Mon Sep 17 00:00:00 2001 From: Gunther Hagleitner Date: Wed, 1 Feb 2012 18:50:48 -0800 Subject: [PATCH] removed openstack_x started adding swift, swift_keystone --- conf/pkgs/openstackx.json | 16 ---- conf/pkgs/swift.json | 11 +-- conf/stack.ini | 16 ++-- conf/swift/proxy-server.conf.tpl | 7 +- conf/swift/rsyslog.conf.tpl | 26 +++++++ devstack/components/db.py | 2 +- devstack/components/nova.py | 4 +- devstack/components/swift.py | 75 +++++++++++++------ .../{openstack_x.py => swift_keystone.py} | 54 ++++++++----- devstack/progs/common.py | 10 +-- devstack/progs/describe.py | 4 +- devstack/settings.py | 7 +- 12 files changed, 144 insertions(+), 88 deletions(-) delete mode 100644 conf/pkgs/openstackx.json create mode 100644 conf/swift/rsyslog.conf.tpl rename devstack/components/{openstack_x.py => swift_keystone.py} (59%) diff --git a/conf/pkgs/openstackx.json b/conf/pkgs/openstackx.json deleted file mode 100644 index b434d2a1..00000000 --- a/conf/pkgs/openstackx.json +++ /dev/null @@ -1,16 +0,0 @@ -# This is a extended json package definition file -# We allow simple comments (lines starting with a hash symbol) -{ - # This is currently our "master" repo set with versions - # that we are trying to align other distributions with. - # The versions should at least be major + minor! - "ubuntu-oneiric": { - "python-httplib2": { - "version": "0.7*", - "removable": true - } - }, - "rhel-6": { - # TBD - } -} diff --git a/conf/pkgs/swift.json b/conf/pkgs/swift.json index 77080e24..384d3252 100644 --- a/conf/pkgs/swift.json +++ b/conf/pkgs/swift.json @@ -5,12 +5,7 @@ # that we are trying to align other distributions with. # The versions should at least be major + minor! "ubuntu-oneiric": { - # Is this really needed? - "gcc": { - "version": "4:4.6*", - "removable": true - }, - # This may not always be needed (maybe have code not always install this) - or add a new key in that is used for this + # installed for swift-keystone "memcached": { "version": "1.4*", "removable": true @@ -46,10 +41,6 @@ "sqlite3": { "version": "3.7*", "removable": true - }, - "xfsprogs": { - "version": "3.1*", - "removable": true } }, "rhel-6": { diff --git a/conf/stack.ini b/conf/stack.ini index 56cd18d4..6bffb316 100644 --- a/conf/stack.ini +++ b/conf/stack.ini @@ -228,11 +228,6 @@ keystoneclient_branch = master novaclient_repo = https://github.com/openstack/python-novaclient.git novaclient_branch = master -# Openstackx is a collection of extensions to openstack.compute & nova -# that is *deprecated*. The code is being moved into python-novaclient & nova. -openstackx_repo = https://github.com/cloudbuilders/openstackx.git -openstackx_branch = master - # Quantum service git repo quantum_repo = https://github.com/openstack/quantum.git quantum_branch = master @@ -273,6 +268,15 @@ apache_group = ${APACHE_GROUP:-$(horizon:apache_user)} # Port horizon should run on port = ${HORIZON_PORT:-80} +[swift] + +# default is APP_DIR/data +data_location = ${SWIFT_DATA_LOCATION:-data} + +loopback_disk_size = ${SWIFT_LOOPBACK_DISK_SIZE:-1000000} + +partition_power_size = ${SWIFT_PARTITION_POWER_SIZE:-9} + [ci] # CI test suite @@ -328,3 +332,5 @@ service_token = ${SERVICE_TOKEN:-} # The xen api connection password xenapi_connection = ${XENAPI_CONNECTION:-} +# swift password (random unique string) +swift_hash = ${SWIFT_HASH:-} diff --git a/conf/swift/proxy-server.conf.tpl b/conf/swift/proxy-server.conf.tpl index d7ed4851..da6b1fa2 100644 --- a/conf/swift/proxy-server.conf.tpl +++ b/conf/swift/proxy-server.conf.tpl @@ -1,8 +1,11 @@ [DEFAULT] bind_port = 8080 user = %USER% -log_facility = LOG_LOCAL1 swift_dir = %SWIFT_CONFIG_LOCATION% +workers = 1 +log_name = swift +log_facility = LOG_LOCAL1 +log_level = DEBUG [pipeline:main] pipeline = healthcheck cache %AUTH_SERVER% proxy-server @@ -16,7 +19,7 @@ account_autocreate = true use = egg:swiftkeystone2#keystone2 keystone_admin_token = %SERVICE_TOKEN% keystone_url = http://localhost:35357/v2.0 -keystone_swift_operator_roles = Member +keystone_swift_operator_roles = Member,Admin [filter:tempauth] use = egg:swift#tempauth diff --git a/conf/swift/rsyslog.conf.tpl b/conf/swift/rsyslog.conf.tpl new file mode 100644 index 00000000..011c893b --- /dev/null +++ b/conf/swift/rsyslog.conf.tpl @@ -0,0 +1,26 @@ +# Uncomment the following to have a log containing all logs together +#local1,local2,local3,local4,local5.* %SWIFT_LOGDIR%/all.log + +# Uncomment the following to have hourly proxy logs for stats processing +#$template HourlyProxyLog,"%SWIFT_LOGDIR%/hourly/%$YEAR%%$MONTH%%$DAY%%$HOUR%" +#local1.*;local1.!notice ?HourlyProxyLog + +local1.*;local1.!notice %SWIFT_LOGDIR%/proxy.log +local1.notice %SWIFT_LOGDIR%/proxy.error +local1.* ~ + +local2.*;local2.!notice %SWIFT_LOGDIR%/storage1.log +local2.notice %SWIFT_LOGDIR%/storage1.error +local2.* ~ + +local3.*;local3.!notice %SWIFT_LOGDIR%/storage2.log +local3.notice %SWIFT_LOGDIR%/storage2.error +local3.* ~ + +local4.*;local4.!notice %SWIFT_LOGDIR%/storage3.log +local4.notice %SWIFT_LOGDIR%/storage3.error +local4.* ~ + +local5.*;local5.!notice %SWIFT_LOGDIR%/storage4.log +local5.notice %SWIFT_LOGDIR%/storage4.error +local5.* ~ diff --git a/devstack/components/db.py b/devstack/components/db.py index 3870707d..160d55d2 100644 --- a/devstack/components/db.py +++ b/devstack/components/db.py @@ -111,7 +111,7 @@ class DBUninstaller(comp.PkgUninstallComponent): utils.execute_template(*cmds, params=params, shell=True) except IOError: LOG.warn(("Could not reset the database password. You might have to manually " - "reset the password to \"%s\" before the next install") % (RESET_BASE_PW), exc_info=True) + "reset the password to \"%s\" before the next install") % (RESET_BASE_PW)) LOG.info("To aid in this check out: [%s]", " or ".join(SQL_RESET_PW_LINKS)) diff --git a/devstack/components/nova.py b/devstack/components/nova.py index 683073cf..8a60f3b8 100644 --- a/devstack/components/nova.py +++ b/devstack/components/nova.py @@ -483,9 +483,7 @@ class NovaConfigurator(object): instance_template = self._getstr('instance_name_prefix') + self._getstr('instance_name_postfix') nova_conf.add('instance_name_template', instance_template) - if settings.OPENSTACK_X in self.instances: - nova_conf.add('osapi_compute_extension', 'nova.api.openstack.compute.contrib.standard_extensions') - nova_conf.add('osapi_compute_extension', 'extensions.admin.Admin') + nova_conf.add('osapi_compute_extension', 'nova.api.openstack.compute.contrib.standard_extensions') if settings.NOVNC in self.instances: vncproxy_url = self._getstr('vncproxy_url') diff --git a/devstack/components/swift.py b/devstack/components/swift.py index 56570b01..6be4c1c9 100644 --- a/devstack/components/swift.py +++ b/devstack/components/swift.py @@ -14,6 +14,9 @@ # License for the specific language governing permissions and limitations # under the License. +import os +import os.path + from devstack import component as comp from devstack import log as logging from devstack import settings @@ -22,44 +25,68 @@ from devstack import utils LOG = logging.getLogger("devstack.components.swift") -#id +# id TYPE = settings.SWIFT +SWIFT_CONF = 'swift.conf' +PROXY_SERVER_CONF = 'proxy-server.conf' +ACCOUNT_SERVER_CONF = 'account-server.conf' +CONTAINER_SERVER_CONF = 'container-server.conf' +OBJECT_SERVER_CONF = 'object-server.conf' +RSYNC_CONF = 'rsyncd.conf' +SYSLOG_CONF = 'rsyslog.conf' +SWIFT_MAKERINGS = 'swift-remakerings' +SWIFT_STARTMAIN = 'swift-startmain' +CONFIGS = [SWIFT_CONF, PROXY_SERVER_CONF, ACCOUNT_SERVER_CONF, + CONTAINER_SERVER_CONF, OBJECT_SERVER_CONF, RSYNC_CONF, + SYSLOG_CONF, SWIFT_MAKERINGS, SWIFT_STARTMAIN] -class SwiftUninstaller(comp.ComponentBase): +SWIFT_NAME = 'swift' + +# subdirs of the git checkout +BIN_DIR = 'bin' +CONFIG_DIR = 'etc' + +# what to start +APP_OPTIONS = { +} + +#the pkg json files swift requires for installation +REQ_PKGS = ['general.json', 'swift.json'] + + +class SwiftUninstaller(comp.PythonUninstallComponent): def __init__(self, *args, **kargs): - comp.ComponentBase.__init__(self, TYPE, *args, **kargs) - - def unconfigure(self): - raise NotImplementedError() - - def uninstall(self): - raise NotImplementedError() + comp.PythonUninstallComponent.__init__(self, TYPE, *args, **kargs) -class SwiftInstaller(comp.ComponentBase): +class SwiftInstaller(comp.PythonInstallComponent): def __init__(self, *args, **kargs): - comp.ComponentBase.__init__(self, TYPE, *args, **kargs) + comp.PythonInstallComponent.__init__(self, TYPE, *args, **kargs) + self.cfgdir = sh.joinpths(self.appdir, CONFIG_DIR) + self.bindir = sh.joinpths(self.appdir, BIN_DIR) + self.datadir = sh.joinpths(self.appdir, self.cfg.get('swift', 'data_location')) - def download(self): - raise NotImplementedError() + def _get_download_locations(self): + return comp.PythonInstallComponent._get_download_locations(self) + [ + { + 'uri': ('git', 'swift_repo'), + 'branch': ('git', 'swift_branch') + }] - def configure(self): - raise NotImplementedError() + def _get_config_files(self): + return CONFIGS - def pre_install(self): - raise NotImplementedError() + def _get_pkgs(self): + return REQ_PKGS - def install(self): - raise NotImplementedError() - - def post_install(self): - raise NotImplementedError() + def _post_install(self): + pass -class SwiftRuntime(comp.EmptyRuntime): +class SwiftRuntime(comp.PythonRuntime): def __init__(self, *args, **kargs): - comp.EmptyRuntime.__init__(self, TYPE, *args, **kargs) + comp.PythonRuntime.__init__(self, TYPE, *args, **kargs) def describe(opts=None): diff --git a/devstack/components/openstack_x.py b/devstack/components/swift_keystone.py similarity index 59% rename from devstack/components/openstack_x.py rename to devstack/components/swift_keystone.py index 7a234dc8..5e8c32c7 100644 --- a/devstack/components/openstack_x.py +++ b/devstack/components/swift_keystone.py @@ -14,45 +14,65 @@ # License for the specific language governing permissions and limitations # under the License. +import os +import os.path + from devstack import component as comp from devstack import log as logging from devstack import settings from devstack import shell as sh from devstack import utils -LOG = logging.getLogger("devstack.components.openstackx") +LOG = logging.getLogger("devstack.components.swift_keystone") -#id -TYPE = settings.OPENSTACK_X +# id +TYPE = settings.SWIFT_KEYSTONE -#the pkg json files novnc requires for installation -REQ_PKGS = ['general.json', 'openstackx.json'] +# subdirs of the git checkout +BIN_DIR = 'bin' +CONFIG_DIR = 'etc' + +CONFIGS = [] + +# what to start +APP_OPTIONS = { +} + +#the pkg json files swift_keystone requires for installation +REQ_PKGS = ['general.json', 'swift.json'] -class OpenstackXUninstaller(comp.PythonUninstallComponent): +class SwiftKeystoneUninstaller(comp.PythonUninstallComponent): def __init__(self, *args, **kargs): comp.PythonUninstallComponent.__init__(self, TYPE, *args, **kargs) -class OpenstackXInstaller(comp.PythonInstallComponent): +class SwiftKeystoneInstaller(comp.PythonInstallComponent): def __init__(self, *args, **kargs): comp.PythonInstallComponent.__init__(self, TYPE, *args, **kargs) + self.cfgdir = sh.joinpths(self.appdir, CONFIG_DIR) + self.bindir = sh.joinpths(self.appdir, BIN_DIR) def _get_download_locations(self): - places = list() - places.append({ - 'uri': ("git", "openstackx_repo"), - 'branch': ("git", "openstackx_branch"), - }) - return places + return comp.PythonInstallComponent._get_download_locations(self) + [ + { + 'uri': ('git', 'swift_keystone_repo'), + 'branch': ('git', 'swift_keystone_branch') + }] + + def _get_config_files(self): + return CONFIGS def _get_pkgs(self): - return list(REQ_PKGS) + return REQ_PKGS + + def _post_install(self): + pass -class OpenstackXRuntime(comp.EmptyRuntime): +class SwiftKeystoneRuntime(comp.PythonRuntime): def __init__(self, *args, **kargs): - comp.EmptyRuntime.__init__(self, TYPE, *args, **kargs) + comp.PythonRuntime.__init__(self, TYPE, *args, **kargs) def describe(opts=None): @@ -66,6 +86,6 @@ def describe(opts=None): params = dict() params['component_opts'] = "TBD" params['module_name'] = __name__ - params['description'] = __doc__ or "Handles actions for the no-vnc component." + params['description'] = __doc__ or "Handles actions for the swift keystone component." out = description.format(**params) return out.strip("\n") diff --git a/devstack/progs/common.py b/devstack/progs/common.py index 99493534..553e6ab5 100644 --- a/devstack/progs/common.py +++ b/devstack/progs/common.py @@ -28,11 +28,11 @@ from devstack.components import keystone_client from devstack.components import nova from devstack.components import nova_client from devstack.components import novnc -from devstack.components import openstack_x from devstack.components import quantum from devstack.components import quantum_client from devstack.components import rabbit from devstack.components import swift +from devstack.components import swift_keystone # This determines what classes to use to install/uninstall/... ACTION_CLASSES = { @@ -41,13 +41,13 @@ ACTION_CLASSES = { settings.GLANCE: glance.GlanceInstaller, settings.QUANTUM: quantum.QuantumInstaller, settings.SWIFT: swift.SwiftInstaller, + settings.SWIFT: swift_keystone.SwiftKeystoneInstaller, settings.HORIZON: horizon.HorizonInstaller, settings.KEYSTONE: keystone.KeystoneInstaller, settings.DB: db.DBInstaller, settings.RABBIT: rabbit.RabbitInstaller, settings.KEYSTONE_CLIENT: keystone_client.KeyStoneClientInstaller, settings.NOVA_CLIENT: nova_client.NovaClientInstaller, - settings.OPENSTACK_X: openstack_x.OpenstackXInstaller, settings.NOVNC: novnc.NoVNCInstaller, settings.QUANTUM_CLIENT: quantum_client.QuantumClientInstaller, }, @@ -56,13 +56,13 @@ ACTION_CLASSES = { settings.GLANCE: glance.GlanceUninstaller, settings.QUANTUM: quantum.QuantumUninstaller, settings.SWIFT: swift.SwiftUninstaller, + settings.SWIFT: swift_keystone.SwiftKeystoneUninstaller, settings.HORIZON: horizon.HorizonUninstaller, settings.KEYSTONE: keystone.KeystoneUninstaller, settings.DB: db.DBUninstaller, settings.RABBIT: rabbit.RabbitUninstaller, settings.KEYSTONE_CLIENT: keystone_client.KeyStoneClientUninstaller, settings.NOVA_CLIENT: nova_client.NovaClientUninstaller, - settings.OPENSTACK_X: openstack_x.OpenstackXUninstaller, settings.NOVNC: novnc.NoVNCUninstaller, settings.QUANTUM_CLIENT: quantum_client.QuantumClientUninstaller, }, @@ -71,13 +71,13 @@ ACTION_CLASSES = { settings.GLANCE: glance.GlanceRuntime, settings.QUANTUM: quantum.QuantumRuntime, settings.SWIFT: swift.SwiftRuntime, + settings.SWIFT: swift_keystone.SwiftKeystoneRuntime, settings.HORIZON: horizon.HorizonRuntime, settings.KEYSTONE: keystone.KeystoneRuntime, settings.DB: db.DBRuntime, settings.RABBIT: rabbit.RabbitRuntime, settings.KEYSTONE_CLIENT: keystone_client.KeyStoneClientRuntime, settings.NOVA_CLIENT: nova_client.NovaClientRuntime, - settings.OPENSTACK_X: openstack_x.OpenstackXRuntime, settings.NOVNC: novnc.NoVNCRuntime, settings.QUANTUM_CLIENT: quantum_client.QuantumClientRuntime, }, @@ -86,13 +86,13 @@ ACTION_CLASSES = { settings.GLANCE: glance.GlanceRuntime, settings.QUANTUM: quantum.QuantumRuntime, settings.SWIFT: swift.SwiftRuntime, + settings.SWIFT: swift_keystone.SwiftKeystoneRuntime, settings.HORIZON: horizon.HorizonRuntime, settings.KEYSTONE: keystone.KeystoneRuntime, settings.DB: db.DBRuntime, settings.RABBIT: rabbit.RabbitRuntime, settings.KEYSTONE_CLIENT: keystone_client.KeyStoneClientRuntime, settings.NOVA_CLIENT: nova_client.NovaClientRuntime, - settings.OPENSTACK_X: openstack_x.OpenstackXRuntime, settings.NOVNC: novnc.NoVNCRuntime, settings.QUANTUM_CLIENT: quantum_client.QuantumClientRuntime, }, diff --git a/devstack/progs/describe.py b/devstack/progs/describe.py index 57642ca5..0696e9a3 100644 --- a/devstack/progs/describe.py +++ b/devstack/progs/describe.py @@ -27,11 +27,11 @@ from devstack.components import keystone_client from devstack.components import nova from devstack.components import nova_client from devstack.components import novnc -from devstack.components import openstack_x from devstack.components import quantum from devstack.components import quantum_client from devstack.components import rabbit from devstack.components import swift +from devstack.components import swift_keystone PROG_NAME = "Describer" @@ -44,10 +44,10 @@ _DESCR_MAP = { settings.KEYSTONE_CLIENT: keystone_client.describe, settings.NOVA: nova.describe, settings.NOVA_CLIENT: nova_client.describe, - settings.OPENSTACK_X: openstack_x.describe, settings.QUANTUM: quantum.describe, settings.RABBIT: rabbit.describe, settings.SWIFT: swift.describe, + settings.SWIFT_KEYSTONE: swift_keystone.describe, settings.NOVNC: novnc.describe, settings.QUANTUM_CLIENT: quantum_client.describe, } diff --git a/devstack/settings.py b/devstack/settings.py index 84ee6b41..853ea011 100644 --- a/devstack/settings.py +++ b/devstack/settings.py @@ -40,21 +40,21 @@ GLANCE = "glance" QUANTUM = "quantum" QUANTUM_CLIENT = 'quantum-client' SWIFT = "swift" +SWIFT_KEYSTONE = "swift_keystone" HORIZON = "horizon" KEYSTONE = "keystone" KEYSTONE_CLIENT = 'keystone-client' DB = "db" RABBIT = "rabbit" -OPENSTACK_X = 'openstack-x' NOVNC = 'novnc' COMPONENT_NAMES = [ NOVA, NOVA_CLIENT, GLANCE, QUANTUM, QUANTUM_CLIENT, SWIFT, + SWIFT_KEYSTONE, HORIZON, KEYSTONE, KEYSTONE_CLIENT, - OPENSTACK_X, DB, RABBIT, NOVNC, @@ -71,8 +71,9 @@ COMPONENT_DEPENDENCIES = { KEYSTONE: [DB], NOVA: [KEYSTONE, GLANCE, DB, RABBIT, NOVA_CLIENT], SWIFT: [], + SWIFT_KEYSTONE: [SWIFT], NOVA_CLIENT: [], - HORIZON: [KEYSTONE_CLIENT, GLANCE, NOVA_CLIENT, OPENSTACK_X], + HORIZON: [KEYSTONE_CLIENT, GLANCE, NOVA_CLIENT], #the db isn't always a dependency (depending on the quantum component to be activated) #for now assume it is (TODO make it better?) #the client isn't always needed either (TODO make it better?)