New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mgr/dashboard: RGW page #19512
mgr/dashboard: RGW page #19512
Conversation
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
@liuchang0812 looks reasonable offhand, thanks very much; note that this area may evolve quickly |
@mattbenjamin thank you. as we discussed last CDM, we are going to create a RGW page. actually this is a early version, and a lot of work need to do. I wonder that we could show more information :
|
I find that we have already implemented |
@liuchang0812 for things like user and bucket info--and day2 mgmt operations, the consensus within the RGW team was to delegate to a running instance of the RGW restful admin server, rather than to embed an RGW instance in ceph-mgr via librgw; There are already community bindings to the currently exported methods here: #19164 |
this is indeed terrifying :) ideally we would just send s3 requests to a running gateway for this similarly, we have admin apis that can serve sync status for 3. |
Of course. I'm very glad to discuss it with you all. My colleague @Leeshine is also working on it. We will prepare a simple slide. Would you mind giving me more information about the meeting? what time is the meeting and how could we join it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, I just have minor suggested changes
src/pybind/mgr/dashboard/base.html
Outdated
|
||
<li class="{%if path_info.startswith('/rgw')%}active{%endif%}"> | ||
<a href="{{ url_prefix }}/rgw"> | ||
<i class="fa fa-files-o" aria-hidden="true"></i> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no "right" icon for RGW (as far as I know), but what about cloud-download (http://fontawesome.io/icon/cloud-download/) instead of a file-related icon?
src/pybind/mgr/dashboard/rgw.py
Outdated
'server': server, | ||
'metadata': metadata, | ||
'status': status, | ||
'url': "/rgw/detail/{0}".format(service['id']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest leaving out the /detail/ part, and just use /rgw for the list and /rgw/<id>
for the detail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, John, how could I get this <id>
in RGWEndpoint::index
function. I tested with index(self, rgw_id=None)
and index(self, rgw_id)
, cherrypy could not dispatch request correctly as expected. we use /osd/perf/<id>
in OSDEndpoint, not /osd/<id>
. I wonder whether cherrypy could support this url pattern. I 'm looking cherrypy's document.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little awkward, but I think in this case you can prefix a @cherrypy.popargs('rgw_id')
to the RGWEndpoint
class (http://docs.cherrypy.org/en/latest/advanced.html#restful-style-dispatching), and then the rgw_id argument to index
will work.
rgw.{rgw_id} | ||
</h1> | ||
</section> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start a section class="content"
here, to get proper padding/margins on the main part with the tables.
}); | ||
}); | ||
|
||
if (content_data.rgw_status_list.length() == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use rv-show="rgw_status_list | length"
in the markup, to avoid the need to explicitly set a _show variable up here (the length
helper is defined in base.html so you can use it anywhere)
var post_load = function() { | ||
content_data.rgw_metadata_list = []; | ||
content_data.rgw_status_list = []; | ||
_.each(content_data.rgw_metadata, function(v, k) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be fine to do this on the python side, so that the javascript just gets the data in the form that it prefers (a list).
These items are currently coming out in arbitrary order, which makes it a bit difficult to scan visually -- it would be nice to sort them alphabetically by key (could also do this server side if passing a list instead of a dict)
If you choose to keep it on the javascript side, you'll also need to make sure that post_load is called after each refresh()
var refresh = function() { | ||
$.get("{{ url_prefix }}/rgw/rgw_data/" + content_data.rgw_id + "/", function(data) { | ||
content_data = data; | ||
setTimeout(refresh, 3000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this period the same as the one on line 16 (probably both 5000)
src/pybind/mgr/dashboard/rgw.py
Outdated
|
||
log = logging.getLogger("dashboard") | ||
|
||
class RGWDaemons(RemoteViewCache): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please leave two blank lines before class definition for PEP8 style
src/pybind/mgr/dashboard/rgw.py
Outdated
|
||
import json | ||
import re | ||
import rados |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the re
and rados
imports are unused and can be removed
src/pybind/mgr/dashboard/rgw.py
Outdated
try: | ||
status = json.loads(status['json']) | ||
except: | ||
status = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do a log.warn
here to say the service['id']
which had invalid status json
the rgw team does informal 15-20min standup meetings in https://bluejeans.com/3919548994. they happen on Monday at 9:45am EST, and Tues/Thurs/Fri at 11:45am EST (sorry, we need to publish this stuff on ceph.com somewhere). you're all welcome to join as often as you like! |
src/pybind/mgr/dashboard/base.html
Outdated
<li class="{%if path_info.startswith('/rgw')%}active{%endif%}"> | ||
<a href="{{ url_prefix }}/rgw"> | ||
<i class="fa fa-files-o" aria-hidden="true"></i> | ||
<span>RGW</span></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the "official" name "Object Store" or "Object Gateway"? At least that's what the documentation refers to nowadays (albeit not consistently).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs do have object gateway. I think that's pretty formal, and RGW is the shortform everywhere. Just offhand, what do you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've settled to using "Object Gateway" in our project - we found "RGW" or "RADOS Gateway" to be too non-descriptive in a Web UI.
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
9230bc5
to
ffdc050
Compare
@jcsp aha. |
src/pybind/mgr/dashboard/rgw.py
Outdated
'server': server, | ||
'metadata': metadata, | ||
'status': status, | ||
'url': "/rgw/{0}".format(service['id']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems that I missed url_prefix
here
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
Tested this locally with a vstart cluster and it looks good! |
Thank you @liuchang0812 |
Signed-off-by: Chang Liu liuchang0812@gmail.com