Merge lp:~james-page/charms/trusty/glance/worker-config into lp:~openstack-charmers-archive/charms/trusty/glance/next

Proposed by James Page
Status: Merged
Merged at revision: 71
Proposed branch: lp:~james-page/charms/trusty/glance/worker-config
Merge into: lp:~openstack-charmers-archive/charms/trusty/glance/next
Diff against target: 99 lines (+32/-1)
6 files modified
config.yaml (+7/-0)
hooks/charmhelpers/contrib/openstack/context.py (+19/-0)
hooks/glance_utils.py (+3/-1)
templates/icehouse/glance-api.conf (+1/-0)
templates/icehouse/glance-registry.conf (+1/-0)
templates/juno/glance-api.conf (+1/-0)
To merge this branch: bzr merge lp:~james-page/charms/trusty/glance/worker-config
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+237414@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Liam Young (gnuoy) wrote :

Approve

review: Approve
70. By James Page

Rebase

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2014-10-06 21:26:18 +0000
+++ config.yaml 2014-10-07 19:33:37 +0000
@@ -146,3 +146,10 @@
146 order for this charm to function correctly, the privacy extension must be146 order for this charm to function correctly, the privacy extension must be
147 disabled and a non-temporary address must be configured/available on147 disabled and a non-temporary address must be configured/available on
148 your network interface.148 your network interface.
149 worker-multiplier:
150 type: int
151 default: 2
152 description: |
153 The CPU core multiplier to use when configuring worker processes for
154 Glance. By default, the number of workers for each daemon is set to
155 twice the number of CPU cores a service unit has.
149156
=== modified file 'hooks/charmhelpers/contrib/openstack/context.py'
--- hooks/charmhelpers/contrib/openstack/context.py 2014-10-07 09:02:12 +0000
+++ hooks/charmhelpers/contrib/openstack/context.py 2014-10-07 19:33:37 +0000
@@ -903,3 +903,22 @@
903 return {903 return {
904 'bind_host': '0.0.0.0'904 'bind_host': '0.0.0.0'
905 }905 }
906
907
908class WorkerConfigContext(OSContextGenerator):
909
910 @property
911 def num_cpus(self):
912 try:
913 from psutil import NUM_CPUS
914 except ImportError:
915 apt_install('python-psutil', fatal=True)
916 from psutil import NUM_CPUS
917 return NUM_CPUS
918
919 def __call__(self):
920 multiplier = config('worker-multiplier') or 1
921 ctxt = {
922 "workers": self.num_cpus * multiplier
923 }
924 return ctxt
906925
=== modified file 'hooks/glance_utils.py'
--- hooks/glance_utils.py 2014-10-07 14:47:14 +0000
+++ hooks/glance_utils.py 2014-10-07 19:33:37 +0000
@@ -83,7 +83,8 @@
83 context.IdentityServiceContext(),83 context.IdentityServiceContext(),
84 context.SyslogContext(),84 context.SyslogContext(),
85 glance_contexts.LoggingConfigContext(),85 glance_contexts.LoggingConfigContext(),
86 glance_contexts.GlanceIPv6Context()],86 glance_contexts.GlanceIPv6Context(),
87 context.WorkerConfigContext()],
87 'services': ['glance-registry']88 'services': ['glance-registry']
88 }),89 }),
89 (GLANCE_API_CONF, {90 (GLANCE_API_CONF, {
@@ -97,6 +98,7 @@
97 context.SyslogContext(),98 context.SyslogContext(),
98 glance_contexts.LoggingConfigContext(),99 glance_contexts.LoggingConfigContext(),
99 glance_contexts.GlanceIPv6Context(),100 glance_contexts.GlanceIPv6Context(),
101 context.WorkerConfigContext(),
100 glance_contexts.MultiStoreContext()],102 glance_contexts.MultiStoreContext()],
101 'services': ['glance-api']103 'services': ['glance-api']
102 }),104 }),
103105
=== modified file 'templates/icehouse/glance-api.conf'
--- templates/icehouse/glance-api.conf 2014-10-07 09:19:09 +0000
+++ templates/icehouse/glance-api.conf 2014-10-07 19:33:37 +0000
@@ -2,6 +2,7 @@
2verbose = {{ verbose }}2verbose = {{ verbose }}
3use_syslog = {{ use_syslog }}3use_syslog = {{ use_syslog }}
4debug = {{ debug }}4debug = {{ debug }}
5workers = {{ workers }}
56
6{% if rbd_pool -%}7{% if rbd_pool -%}
7default_store = rbd8default_store = rbd
89
=== modified file 'templates/icehouse/glance-registry.conf'
--- templates/icehouse/glance-registry.conf 2014-08-06 12:32:10 +0000
+++ templates/icehouse/glance-registry.conf 2014-10-07 19:33:37 +0000
@@ -2,6 +2,7 @@
2verbose = {{ verbose }}2verbose = {{ verbose }}
3use_syslog = {{ use_syslog }}3use_syslog = {{ use_syslog }}
4debug = {{ debug }}4debug = {{ debug }}
5workers = {{ workers }}
56
6bind_host = {{ bind_host }}7bind_host = {{ bind_host }}
7bind_port = 91918bind_port = 9191
89
=== modified file 'templates/juno/glance-api.conf'
--- templates/juno/glance-api.conf 2014-10-07 15:19:08 +0000
+++ templates/juno/glance-api.conf 2014-10-07 19:33:37 +0000
@@ -2,6 +2,7 @@
2verbose = {{ verbose }}2verbose = {{ verbose }}
3use_syslog = {{ use_syslog }}3use_syslog = {{ use_syslog }}
4debug = {{ debug }}4debug = {{ debug }}
5workers = {{ workers }}
56
6known_stores = {{ known_stores }}7known_stores = {{ known_stores }}
7{% if rbd_pool -%}8{% if rbd_pool -%}

Subscribers

People subscribed via source and target branches