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
1=== modified file 'config.yaml'
2--- config.yaml 2015-12-03 23:02:21 +0000
3+++ config.yaml 2016-01-11 12:21:21 +0000
4@@ -25,6 +25,11 @@
5 description: |
6 Key ID to import to the apt keyring to support use with arbitary source
7 configuration from outside of Launchpad archives or PPA's.
8+ port:
9+ type: int
10+ default: 80
11+ description: |
12+ The port that the RADOS Gateway will listen on.
13 # Keystone integration
14 operator-roles:
15 default: "Member,Admin"
16
17=== modified file 'hooks/ceph_radosgw_context.py'
18--- hooks/ceph_radosgw_context.py 2016-01-11 11:21:53 +0000
19+++ hooks/ceph_radosgw_context.py 2016-01-11 12:21:21 +0000
20@@ -22,18 +22,17 @@
21
22 def __call__(self):
23 ctxt = super(HAProxyContext, self).__call__()
24+ port = config('port')
25
26 # Apache ports
27- a_cephradosgw_api = determine_apache_port(80,
28- singlenode_mode=True)
29+ a_cephradosgw_api = determine_apache_port(port, singlenode_mode=True)
30
31 port_mapping = {
32- 'cephradosgw-server': [
33- 80, a_cephradosgw_api]
34+ 'cephradosgw-server': [port, a_cephradosgw_api]
35 }
36
37 ctxt['cephradosgw_bind_port'] = determine_api_port(
38- 80,
39+ port,
40 singlenode_mode=True,
41 )
42
43@@ -101,6 +100,8 @@
44 'use_syslog': str(config('use-syslog')).lower(),
45 'embedded_webserver': config('use-embedded-webserver'),
46 'loglevel': config('loglevel'),
47+ 'port': determine_apache_port(config('port'),
48+ singlenode_mode=True)
49 }
50
51 certs_path = '/var/lib/ceph/nss'
52
53=== modified file 'hooks/hooks.py'
54--- hooks/hooks.py 2015-12-27 00:21:00 +0000
55+++ hooks/hooks.py 2016-01-11 12:21:21 +0000
56@@ -39,6 +39,9 @@
57 lsb_release,
58 restart_on_change,
59 )
60+from charmhelpers.contrib.hahelpers.cluster import (
61+ determine_apache_port,
62+)
63 from utils import (
64 render_template,
65 enable_pocket,
66@@ -65,6 +68,9 @@
67 from charmhelpers.contrib.openstack.utils import (
68 set_os_workload_status,
69 )
70+
71+APACHE_PORTS_CONF = '/etc/apache2/ports.conf'
72+
73 hooks = Hooks()
74 CONFIGS = register_configs()
75
76@@ -137,7 +143,8 @@
77
78 def emit_apacheconf():
79 apachecontext = {
80- "hostname": unit_get('private-address')
81+ "hostname": unit_get('private-address'),
82+ "port": determine_apache_port(config('port'), singlenode_mode=True)
83 }
84 site_conf = '/etc/apache2/sites-available/rgw'
85 if is_apache_24():
86@@ -164,7 +171,11 @@
87
88
89 def apache_ports():
90- shutil.copy('files/ports.conf', '/etc/apache2/ports.conf')
91+ portscontext = {
92+ "port": determine_apache_port(config('port'), singlenode_mode=True)
93+ }
94+ with open(APACHE_PORTS_CONF, 'w') as portsconf:
95+ portsconf.write(render_template('ports.conf', portscontext))
96
97
98 def setup_keystone_certs(unit=None, rid=None):
99@@ -294,22 +305,22 @@
100 @hooks.hook('gateway-relation-joined')
101 def gateway_relation():
102 relation_set(hostname=unit_get('private-address'),
103- port=80)
104+ port=config('port'))
105
106
107 def start():
108 subprocess.call(['service', 'radosgw', 'start'])
109- open_port(port=80)
110+ open_port(port=config('port'))
111
112
113 def stop():
114 subprocess.call(['service', 'radosgw', 'stop'])
115- open_port(port=80)
116+ open_port(port=config('port'))
117
118
119 def restart():
120 subprocess.call(['service', 'radosgw', 'restart'])
121- open_port(port=80)
122+ open_port(port=config('port'))
123
124
125 @hooks.hook('identity-service-relation-joined')
126@@ -318,7 +329,7 @@
127 log('Integration with keystone requires ceph >= 0.55')
128 sys.exit(1)
129
130- port = 80
131+ port = config('port')
132 admin_url = '%s:%i/swift' % (canonical_url(None, ADMIN), port)
133 internal_url = '%s:%s/swift/v1' % \
134 (canonical_url(None, INTERNAL), port)
135
136=== modified file 'templates/ceph.conf'
137--- templates/ceph.conf 2016-01-11 11:21:53 +0000
138+++ templates/ceph.conf 2016-01-11 12:21:21 +0000
139@@ -18,7 +18,7 @@
140 rgw socket path = /tmp/radosgw.sock
141 log file = /var/log/ceph/radosgw.log
142 {% if embedded_webserver %}
143-rgw frontends = civetweb port=70
144+rgw frontends = civetweb port={{ port }}
145 {% elif disable_100_continue %}
146 # Turn off 100-continue optimization as stock mod_fastcgi
147 # does not support it
148
149=== renamed file 'files/ports.conf' => 'templates/ports.conf'
150--- files/ports.conf 2015-01-15 11:10:34 +0000
151+++ templates/ports.conf 2016-01-11 12:21:21 +0000
152@@ -1,4 +1,4 @@
153-Listen 70
154+Listen {{ port }}
155
156 <IfModule ssl_module>
157 Listen 443
158
159=== modified file 'templates/rgw'
160--- templates/rgw 2015-01-14 16:48:07 +0000
161+++ templates/rgw 2016-01-11 12:21:21 +0000
162@@ -2,7 +2,7 @@
163 FastCgiExternalServer /var/www/s3gw.fcgi -socket /tmp/radosgw.sock
164 </IfModule>
165
166-<VirtualHost *:70>
167+<VirtualHost *:{{ port }}>
168 ServerName {{ hostname }}
169 ServerAdmin ceph@ubuntu.com
170 DocumentRoot /var/www
171
172=== modified file 'unit_tests/test_ceph_radosgw_context.py'
173--- unit_tests/test_ceph_radosgw_context.py 2015-12-02 11:09:50 +0000
174+++ unit_tests/test_ceph_radosgw_context.py 2016-01-11 12:21:21 +0000
175@@ -168,6 +168,7 @@
176 'old_auth': False,
177 'use_syslog': 'false',
178 'loglevel': 1,
179+ 'port': 70
180 }
181 self.assertEqual(expect, mon_ctxt())
182
183@@ -202,6 +203,7 @@
184 'old_auth': False,
185 'use_syslog': 'false',
186 'loglevel': 1,
187+ 'port': 70
188 }
189 self.assertEqual(expect, mon_ctxt())
190
191@@ -228,5 +230,6 @@
192 'old_auth': False,
193 'use_syslog': 'false',
194 'loglevel': 1,
195+ 'port': 70
196 }
197 self.assertEqual(expect, mon_ctxt())
198
199=== modified file 'unit_tests/test_hooks.py'
200--- unit_tests/test_hooks.py 2015-12-27 00:21:00 +0000
201+++ unit_tests/test_hooks.py 2016-01-11 12:21:21 +0000
202@@ -127,6 +127,7 @@
203 self.unit_get.return_value = '10.0.0.1'
204 apachecontext = {
205 "hostname": '10.0.0.1',
206+ "port": 70,
207 }
208 vhost_file = '/etc/apache2/sites-available/rgw.conf'
209 with patch_open() as (_open, _file):
210@@ -167,6 +168,7 @@
211 ]
212 self.subprocess.call.assert_has_calls(calls)
213
214+ @patch.object(ceph_hooks, 'apache_ports', lambda *args: True)
215 @patch.object(ceph_hooks, 'mkdir', lambda *args: None)
216 def test_config_changed(self):
217 _install_packages = self.patch('install_packages')

Subscribers

People subscribed via source and target branches