Configure monasca-ui plugin#6
Configure monasca-ui plugin#6samirjorina merged 6 commits intoFujitsuEnablingSoftwareTechnologyGmbH:monascafrom
Conversation
e7d45b3 to
671b1a5
Compare
| end | ||
| end | ||
|
|
||
|
|
There was a problem hiding this comment.
Style/EmptyLines: Extra blank line detected.
| config["kibana_host"] = monasca_public_host | ||
| config["grafana_url"] = "#{monasca_protocol}://#{monasca_public_host}:#{grafana_port}/" | ||
| config["os_region"] = keystone_settings["endpoint_region"] | ||
| template "/srv/www/openstack-dashboard/openstack_dashboard/local/local_settings.d/_80_monasca_ui_settings.py" do |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [116/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)
| end | ||
|
|
||
| monasca_server = monasca_servers[0] | ||
| #TODO get the grafana port from data bag? |
There was a problem hiding this comment.
Style/LeadingCommentSpace: Missing space after #. (https://github.com/bbatsov/ruby-style-guide#hash-space)
Style/CommentAnnotation: Annotation keywords like TODO should be all upper case, followed by a colon, and a space, then a note describing the problem. (https://github.com/bbatsov/ruby-style-guide#annotate-keywords)
671b1a5 to
1fabee8
Compare
| variables config | ||
| owner 'root' | ||
| group 'root' | ||
| mode '0644' |
There was a problem hiding this comment.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. (https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylestringliterals)
| source "monasca_ui_local_settings.py.erb" | ||
| variables config | ||
| owner 'root' | ||
| group 'root' |
There was a problem hiding this comment.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. (https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylestringliterals)
| template "/srv/www/openstack-dashboard/openstack_dashboard/local/local_settings.d/_80_monasca_ui_settings.py" do | ||
| source "monasca_ui_local_settings.py.erb" | ||
| variables config | ||
| owner 'root' |
There was a problem hiding this comment.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. (https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylestringliterals)
1fabee8 to
153681d
Compare
| variables config | ||
| owner 'root' | ||
| group 'root' | ||
| mode '0644' |
There was a problem hiding this comment.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. (https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylestringliterals)
| source "_80_monasca_ui_settings.py.erb" | ||
| variables config | ||
| owner 'root' | ||
| group 'root' |
There was a problem hiding this comment.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. (https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylestringliterals)
| template "/srv/www/openstack-dashboard/openstack_dashboard/local/local_settings.d/_80_monasca_ui_settings.py" do | ||
| source "_80_monasca_ui_settings.py.erb" | ||
| variables config | ||
| owner 'root' |
There was a problem hiding this comment.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. (https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylestringliterals)
| config["kibana_enabled"] = true | ||
| config["kibana_host"] = monasca_public_host | ||
|
|
||
| template "/srv/www/openstack-dashboard/openstack_dashboard/local/local_settings.d/_80_monasca_ui_settings.py" do |
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [116/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)
481c31b to
d560cc8
Compare
| end | ||
| end | ||
|
|
||
| #TODO extract this all to a separate reciepe |
There was a problem hiding this comment.
Style/LeadingCommentSpace: Missing space after #. (https://github.com/bbatsov/ruby-style-guide#hash-space)
Style/CommentAnnotation: Annotation keywords like TODO should be all upper case, followed by a colon, and a space, then a note describing the problem. (https://github.com/bbatsov/ruby-style-guide#annotate-keywords)
fc01b00 to
93598f5
Compare
d78d8db to
9208ba5
Compare
93598f5 to
07ffd6f
Compare
| protocol = node[:monasca][:grafana][:ssl] ? "https" : "http" | ||
| port = node[:monasca][:grafana][:bind_port] | ||
| "#{protocol}://#{host}:#{port}/grafana" | ||
| end |
There was a problem hiding this comment.
Style/TrailingWhitespace: Trailing whitespace detected. (https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace)
| monasca_servers = search(:node, "roles:monasca-server") | ||
| monasca_server = monasca_servers[0] | ||
| grafana_available = true | ||
| grafana_url = MonascaUiHelper.grafana_public_url(monasca_server) |
There was a problem hiding this comment.
Lint/UselessAssignment: Useless assignment to variable - grafana_url. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
|
|
||
| monasca_servers = search(:node, "roles:monasca-server") | ||
| monasca_server = monasca_servers[0] | ||
| grafana_available = true |
There was a problem hiding this comment.
Lint/UselessAssignment: Useless assignment to variable - grafana_available. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
| protocol = node[:monasca][:grafana][:ssl] ? "https" : "http" | ||
| port = node[:monasca][:grafana][:bind_port] | ||
| "#{protocol}://#{host}:#{port}/grafana" | ||
| end |
There was a problem hiding this comment.
Style/TrailingWhitespace: Trailing whitespace detected. (https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace)
1b9cf7f to
61931fd
Compare
| @@ -0,0 +1,14 @@ | |||
| module MonascaUiHelper | |||
| @@ -0,0 +1,18 @@ | |||
| include_recipe "apache2::mod_proxy" | |||
| DocumentRoot <%= @horizon_dir %> | ||
| Alias /media <%= @horizon_dir %>/media | ||
| Alias /static <%= @horizon_dir %>/static | ||
| <% if @grafana_available %> |
There was a problem hiding this comment.
I would do it the same way that is already done at line 33:
<% unless @ssl_crt_chain_file.nil? or @ssl_crt_chain_file.empty? %>
| ExpiresActive on | ||
| ExpiresDefault "access plus 1 month" | ||
| </Location> | ||
| <% if @grafana_available %> |
There was a problem hiding this comment.
I would do it the same way that is already done at line 33:
<% unless @ssl_crt_chain_file.nil? or @ssl_crt_chain_file.empty? %>
| action :install | ||
| notifies :reload, resources(service: "apache2") | ||
| end | ||
| grafana_available = true |
There was a problem hiding this comment.
Do you actually need grafana_available variable?
You just need checking if grafana_url is not empty to include into template.
There was a problem hiding this comment.
Where is grafana_url coming from? Maybe we can use it, but monasca_servers.empty? is a very reliable test. In doubt I'd go for using that as a drop-in replacement for grafana_available rather than the contents of grafana_url (I agree that grafana_available itself is rather redundant).
| @@ -0,0 +1,52 @@ | |||
| from django.conf import settings | |||
6a7c685 to
c02f9aa
Compare
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
|
|
There was a problem hiding this comment.
Style/EmptyLines: Extra blank line detected.
jgrassler
left a comment
There was a problem hiding this comment.
Apart from the two small inline comments this looks good as far as I can tell right now. Once they're fixed we can merge this and fix anything that's still broken once we have all the ingredients for testing this (i.e. the Grafana package and Kibana host it can talk to).
|
|
||
|
|
||
| monasca_servers = search(:node, "roles:monasca-server") | ||
| monasca_server = monasca_servers[0] |
There was a problem hiding this comment.
Shouldn't this point to the load balancer the Monasca cluster is behind?
There was a problem hiding this comment.
I'm sorry, but I simply can't make much sense from the github review process...
It seems to me that your comments refer to some older version of this PR - I have already updated the code, so that right now grafana is deployed on the dashboard node(s). And, as a result, there is no more need to have any URLs to grafana
There was a problem hiding this comment.
Github sometimes does that, yeah. I directly checked out your repository and there it looks fine. So ignore these two comments and feel free to merge as far as I'm concerned :-)
| action :install | ||
| notifies :reload, resources(service: "apache2") | ||
| end | ||
| grafana_available = true |
There was a problem hiding this comment.
Where is grafana_url coming from? Maybe we can use it, but monasca_servers.empty? is a very reliable test. In doubt I'd go for using that as a drop-in replacement for grafana_available rather than the contents of grafana_url (I agree that grafana_available itself is rather redundant).
* Configure monasca-ui plugin * Refactor the code * Addresing review comments * Deploy grafana alongside horizon * Remove obsolete changes to monasca schema * Removing extra blank line
* Configure monasca-ui plugin * Refactor the code * Addresing review comments * Deploy grafana alongside horizon * Remove obsolete changes to monasca schema * Removing extra blank line
* Configure monasca-ui plugin * Refactor the code * Addresing review comments * Deploy grafana alongside horizon * Remove obsolete changes to monasca schema * Removing extra blank line
* Configure monasca-ui plugin * Refactor the code * Addresing review comments * Deploy grafana alongside horizon * Remove obsolete changes to monasca schema * Removing extra blank line
* Configure monasca-ui plugin * Refactor the code * Addresing review comments * Deploy grafana alongside horizon * Remove obsolete changes to monasca schema * Removing extra blank line
* Configure monasca-ui plugin * Refactor the code * Addresing review comments * Deploy grafana alongside horizon * Remove obsolete changes to monasca schema * Removing extra blank line
No description provided.