Merge lp:~hopem/charms/trusty/ceph-radosgw/lp1517551 into lp:~openstack-charmers-archive/charms/trusty/ceph-radosgw/next

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 58
Proposed branch: lp:~hopem/charms/trusty/ceph-radosgw/lp1517551
Merge into: lp:~openstack-charmers-archive/charms/trusty/ceph-radosgw/next
Diff against target: 217 lines (+37/-15)
8 files modified
config.yaml (+5/-0)
hooks/ceph_radosgw_context.py (+6/-5)
hooks/hooks.py (+18/-7)
templates/ceph.conf (+1/-1)
templates/ports.conf (+1/-1)
templates/rgw (+1/-1)
unit_tests/test_ceph_radosgw_context.py (+3/-0)
unit_tests/test_hooks.py (+2/-0)
To merge this branch: bzr merge lp:~hopem/charms/trusty/ceph-radosgw/lp1517551
Reviewer Review Type Date Requested Status
James Page Approve
Chris MacNaughton (community) Needs Fixing
OpenStack Charmers Pending
Review via email: mp+277882@code.launchpad.net
To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #14365 ceph-radosgw-next for hopem mp277882
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/14365/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #13390 ceph-radosgw-next for hopem mp277882
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/13390/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8032 ceph-radosgw-next for hopem mp277882
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
Timeout occurred (2700s), printing juju status...environment: osci-sv08
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/13501909/
Build: http://10.245.162.77:8080/job/charm_amulet_test/8032/

Revision history for this message
Ryan Beisner (1chb1n) wrote :

Rerunning amulet test...

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8052 ceph-radosgw-next for hopem mp277882
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/13581819/
Build: http://10.245.162.77:8080/job/charm_amulet_test/8052/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8056 ceph-radosgw-next for hopem mp277882
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/13584216/
Build: http://10.245.162.77:8080/job/charm_amulet_test/8056/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8057 ceph-radosgw-next for hopem mp277882
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
Timeout occurred (2700s), printing juju status...environment: osci-sv08
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/13586064/
Build: http://10.245.162.77:8080/job/charm_amulet_test/8057/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8064 ceph-radosgw-next for hopem mp277882
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/13600378/
Build: http://10.245.162.77:8080/job/charm_amulet_test/8064/

53. By Edward Hope-Morley

synced /next

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #15769 ceph-radosgw-next for hopem mp277882
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/15769/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #14717 ceph-radosgw-next for hopem mp277882
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/14717/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8383 ceph-radosgw-next for hopem mp277882
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/8383/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #15485 ceph-radosgw-next for hopem mp277882
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/15485/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #16584 ceph-radosgw-next for hopem mp277882
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/16584/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8500 ceph-radosgw-next for hopem mp277882
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/8500/

Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

Thanks for the help, Edward! It looks like this merge proposal merges the two ports that the RadosGW uses currently, both the web server port and the civetweb port. Generally, when using civitweb, port 80 ends up load balanced between ALL RadosGW instances and port 70 is the port used to directly access the targeted machine. Maybe there should be two settings to direct that?

review: Needs Fixing
Revision history for this message
James Page (james-page) wrote :

Chris

I think this update is OK - the way the port funnel works means that the configuration option is applied as the port which should be used to access the service, whether in hamode or node - Ed's change just makes this configurable - so if the normal 80 port is used then haproxy listens on 80, civetweb or apache on 70.

Likewise for 8080 - haproxy on 8080, civetweb on 8070.

As the amulet test is passing, we're not regressing function here, so +1 for me on this MP.

review: Approve
Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

I'm only concerned that we seem to be merging port 70 and port 80 in this change. It doesn't kill me as accessing port 70 currently is only useful if trying to reduce interference in performance testing and shouldn't be done in a production setting.

Revision history for this message
James Page (james-page) wrote :

> On 9 Jan 2016, at 15:32, Chris MacNaughton <email address hidden> wrote:
>
> I'm only concerned that we seem to be merging port 70 and port 80 in this change. It doesn't kill me as accessing port 70 currently is only useful if trying to reduce interference in performance testing and shouldn't be done in a production setting.

Maybe I missed something - I'll take another look

> --
> https://code.launchpad.net/~hopem/charms/trusty/ceph-radosgw/lp1517551/+merge/277882
> You are reviewing the proposed merge of lp:~hopem/charms/trusty/ceph-radosgw/lp1517551 into lp:~openstack-charmers/charms/trusty/ceph-radosgw/next.

Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

These are the two different ports merging that I see

54. By Edward Hope-Morley

sync /next

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #17076 ceph-radosgw-next for hopem mp277882
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/17076/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #15951 ceph-radosgw-next for hopem mp277882
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/15951/

Revision history for this message
James Page (james-page) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2015-12-03 23:02:21 +0000
+++ config.yaml 2016-01-11 12:21:21 +0000
@@ -25,6 +25,11 @@
25 description: |25 description: |
26 Key ID to import to the apt keyring to support use with arbitary source26 Key ID to import to the apt keyring to support use with arbitary source
27 configuration from outside of Launchpad archives or PPA's.27 configuration from outside of Launchpad archives or PPA's.
28 port:
29 type: int
30 default: 80
31 description: |
32 The port that the RADOS Gateway will listen on.
28 # Keystone integration33 # Keystone integration
29 operator-roles:34 operator-roles:
30 default: "Member,Admin"35 default: "Member,Admin"
3136
=== modified file 'hooks/ceph_radosgw_context.py'
--- hooks/ceph_radosgw_context.py 2016-01-11 11:21:53 +0000
+++ hooks/ceph_radosgw_context.py 2016-01-11 12:21:21 +0000
@@ -22,18 +22,17 @@
2222
23 def __call__(self):23 def __call__(self):
24 ctxt = super(HAProxyContext, self).__call__()24 ctxt = super(HAProxyContext, self).__call__()
25 port = config('port')
2526
26 # Apache ports27 # Apache ports
27 a_cephradosgw_api = determine_apache_port(80,28 a_cephradosgw_api = determine_apache_port(port, singlenode_mode=True)
28 singlenode_mode=True)
2929
30 port_mapping = {30 port_mapping = {
31 'cephradosgw-server': [31 'cephradosgw-server': [port, a_cephradosgw_api]
32 80, a_cephradosgw_api]
33 }32 }
3433
35 ctxt['cephradosgw_bind_port'] = determine_api_port(34 ctxt['cephradosgw_bind_port'] = determine_api_port(
36 80,35 port,
37 singlenode_mode=True,36 singlenode_mode=True,
38 )37 )
3938
@@ -101,6 +100,8 @@
101 'use_syslog': str(config('use-syslog')).lower(),100 'use_syslog': str(config('use-syslog')).lower(),
102 'embedded_webserver': config('use-embedded-webserver'),101 'embedded_webserver': config('use-embedded-webserver'),
103 'loglevel': config('loglevel'),102 'loglevel': config('loglevel'),
103 'port': determine_apache_port(config('port'),
104 singlenode_mode=True)
104 }105 }
105106
106 certs_path = '/var/lib/ceph/nss'107 certs_path = '/var/lib/ceph/nss'
107108
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2015-12-27 00:21:00 +0000
+++ hooks/hooks.py 2016-01-11 12:21:21 +0000
@@ -39,6 +39,9 @@
39 lsb_release,39 lsb_release,
40 restart_on_change,40 restart_on_change,
41)41)
42from charmhelpers.contrib.hahelpers.cluster import (
43 determine_apache_port,
44)
42from utils import (45from utils import (
43 render_template,46 render_template,
44 enable_pocket,47 enable_pocket,
@@ -65,6 +68,9 @@
65from charmhelpers.contrib.openstack.utils import (68from charmhelpers.contrib.openstack.utils import (
66 set_os_workload_status,69 set_os_workload_status,
67)70)
71
72APACHE_PORTS_CONF = '/etc/apache2/ports.conf'
73
68hooks = Hooks()74hooks = Hooks()
69CONFIGS = register_configs()75CONFIGS = register_configs()
7076
@@ -137,7 +143,8 @@
137143
138def emit_apacheconf():144def emit_apacheconf():
139 apachecontext = {145 apachecontext = {
140 "hostname": unit_get('private-address')146 "hostname": unit_get('private-address'),
147 "port": determine_apache_port(config('port'), singlenode_mode=True)
141 }148 }
142 site_conf = '/etc/apache2/sites-available/rgw'149 site_conf = '/etc/apache2/sites-available/rgw'
143 if is_apache_24():150 if is_apache_24():
@@ -164,7 +171,11 @@
164171
165172
166def apache_ports():173def apache_ports():
167 shutil.copy('files/ports.conf', '/etc/apache2/ports.conf')174 portscontext = {
175 "port": determine_apache_port(config('port'), singlenode_mode=True)
176 }
177 with open(APACHE_PORTS_CONF, 'w') as portsconf:
178 portsconf.write(render_template('ports.conf', portscontext))
168179
169180
170def setup_keystone_certs(unit=None, rid=None):181def setup_keystone_certs(unit=None, rid=None):
@@ -294,22 +305,22 @@
294@hooks.hook('gateway-relation-joined')305@hooks.hook('gateway-relation-joined')
295def gateway_relation():306def gateway_relation():
296 relation_set(hostname=unit_get('private-address'),307 relation_set(hostname=unit_get('private-address'),
297 port=80)308 port=config('port'))
298309
299310
300def start():311def start():
301 subprocess.call(['service', 'radosgw', 'start'])312 subprocess.call(['service', 'radosgw', 'start'])
302 open_port(port=80)313 open_port(port=config('port'))
303314
304315
305def stop():316def stop():
306 subprocess.call(['service', 'radosgw', 'stop'])317 subprocess.call(['service', 'radosgw', 'stop'])
307 open_port(port=80)318 open_port(port=config('port'))
308319
309320
310def restart():321def restart():
311 subprocess.call(['service', 'radosgw', 'restart'])322 subprocess.call(['service', 'radosgw', 'restart'])
312 open_port(port=80)323 open_port(port=config('port'))
313324
314325
315@hooks.hook('identity-service-relation-joined')326@hooks.hook('identity-service-relation-joined')
@@ -318,7 +329,7 @@
318 log('Integration with keystone requires ceph >= 0.55')329 log('Integration with keystone requires ceph >= 0.55')
319 sys.exit(1)330 sys.exit(1)
320331
321 port = 80332 port = config('port')
322 admin_url = '%s:%i/swift' % (canonical_url(None, ADMIN), port)333 admin_url = '%s:%i/swift' % (canonical_url(None, ADMIN), port)
323 internal_url = '%s:%s/swift/v1' % \334 internal_url = '%s:%s/swift/v1' % \
324 (canonical_url(None, INTERNAL), port)335 (canonical_url(None, INTERNAL), port)
325336
=== modified file 'templates/ceph.conf'
--- templates/ceph.conf 2016-01-11 11:21:53 +0000
+++ templates/ceph.conf 2016-01-11 12:21:21 +0000
@@ -18,7 +18,7 @@
18rgw socket path = /tmp/radosgw.sock18rgw socket path = /tmp/radosgw.sock
19log file = /var/log/ceph/radosgw.log19log file = /var/log/ceph/radosgw.log
20{% if embedded_webserver %}20{% if embedded_webserver %}
21rgw frontends = civetweb port=7021rgw frontends = civetweb port={{ port }}
22{% elif disable_100_continue %}22{% elif disable_100_continue %}
23# Turn off 100-continue optimization as stock mod_fastcgi23# Turn off 100-continue optimization as stock mod_fastcgi
24# does not support it24# does not support it
2525
=== renamed file 'files/ports.conf' => 'templates/ports.conf'
--- files/ports.conf 2015-01-15 11:10:34 +0000
+++ templates/ports.conf 2016-01-11 12:21:21 +0000
@@ -1,4 +1,4 @@
1Listen 701Listen {{ port }}
22
3<IfModule ssl_module>3<IfModule ssl_module>
4 Listen 4434 Listen 443
55
=== modified file 'templates/rgw'
--- templates/rgw 2015-01-14 16:48:07 +0000
+++ templates/rgw 2016-01-11 12:21:21 +0000
@@ -2,7 +2,7 @@
2 FastCgiExternalServer /var/www/s3gw.fcgi -socket /tmp/radosgw.sock2 FastCgiExternalServer /var/www/s3gw.fcgi -socket /tmp/radosgw.sock
3</IfModule>3</IfModule>
44
5<VirtualHost *:70>5<VirtualHost *:{{ port }}>
6 ServerName {{ hostname }}6 ServerName {{ hostname }}
7 ServerAdmin ceph@ubuntu.com7 ServerAdmin ceph@ubuntu.com
8 DocumentRoot /var/www8 DocumentRoot /var/www
99
=== modified file 'unit_tests/test_ceph_radosgw_context.py'
--- unit_tests/test_ceph_radosgw_context.py 2015-12-02 11:09:50 +0000
+++ unit_tests/test_ceph_radosgw_context.py 2016-01-11 12:21:21 +0000
@@ -168,6 +168,7 @@
168 'old_auth': False,168 'old_auth': False,
169 'use_syslog': 'false',169 'use_syslog': 'false',
170 'loglevel': 1,170 'loglevel': 1,
171 'port': 70
171 }172 }
172 self.assertEqual(expect, mon_ctxt())173 self.assertEqual(expect, mon_ctxt())
173174
@@ -202,6 +203,7 @@
202 'old_auth': False,203 'old_auth': False,
203 'use_syslog': 'false',204 'use_syslog': 'false',
204 'loglevel': 1,205 'loglevel': 1,
206 'port': 70
205 }207 }
206 self.assertEqual(expect, mon_ctxt())208 self.assertEqual(expect, mon_ctxt())
207209
@@ -228,5 +230,6 @@
228 'old_auth': False,230 'old_auth': False,
229 'use_syslog': 'false',231 'use_syslog': 'false',
230 'loglevel': 1,232 'loglevel': 1,
233 'port': 70
231 }234 }
232 self.assertEqual(expect, mon_ctxt())235 self.assertEqual(expect, mon_ctxt())
233236
=== modified file 'unit_tests/test_hooks.py'
--- unit_tests/test_hooks.py 2015-12-27 00:21:00 +0000
+++ unit_tests/test_hooks.py 2016-01-11 12:21:21 +0000
@@ -127,6 +127,7 @@
127 self.unit_get.return_value = '10.0.0.1'127 self.unit_get.return_value = '10.0.0.1'
128 apachecontext = {128 apachecontext = {
129 "hostname": '10.0.0.1',129 "hostname": '10.0.0.1',
130 "port": 70,
130 }131 }
131 vhost_file = '/etc/apache2/sites-available/rgw.conf'132 vhost_file = '/etc/apache2/sites-available/rgw.conf'
132 with patch_open() as (_open, _file):133 with patch_open() as (_open, _file):
@@ -167,6 +168,7 @@
167 ]168 ]
168 self.subprocess.call.assert_has_calls(calls)169 self.subprocess.call.assert_has_calls(calls)
169170
171 @patch.object(ceph_hooks, 'apache_ports', lambda *args: True)
170 @patch.object(ceph_hooks, 'mkdir', lambda *args: None)172 @patch.object(ceph_hooks, 'mkdir', lambda *args: None)
171 def test_config_changed(self):173 def test_config_changed(self):
172 _install_packages = self.patch('install_packages')174 _install_packages = self.patch('install_packages')

Subscribers

People subscribed via source and target branches