Skip to content

Configure monasca-ui plugin#6

Merged
samirjorina merged 6 commits intoFujitsuEnablingSoftwareTechnologyGmbH:monascafrom
samirjorina:monasca_ui_config
Feb 20, 2017
Merged

Configure monasca-ui plugin#6
samirjorina merged 6 commits intoFujitsuEnablingSoftwareTechnologyGmbH:monascafrom
samirjorina:monasca_ui_config

Conversation

@samirjorina
Copy link

No description provided.

end
end


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

variables config
owner 'root'
group 'root'
mode '0644'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

variables config
owner 'root'
group 'root'
mode '0644'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [116/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)

@samirjorina samirjorina force-pushed the monasca_ui_config branch 2 times, most recently from 481c31b to d560cc8 Compare January 20, 2017 10:36
end
end

#TODO extract this all to a separate reciepe

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@samirjorina samirjorina force-pushed the monasca_ui_config branch 3 times, most recently from fc01b00 to 93598f5 Compare January 23, 2017 09:31
@kornicameister kornicameister force-pushed the monasca branch 2 times, most recently from d78d8db to 9208ba5 Compare January 25, 2017 06:32
protocol = node[:monasca][:grafana][:ssl] ? "https" : "http"
port = node[:monasca][:grafana][:bind_port]
"#{protocol}://#{host}:#{port}/grafana"
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/TrailingWhitespace: Trailing whitespace detected. (https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace)

@@ -0,0 +1,14 @@
module MonascaUiHelper
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright

@@ -0,0 +1,18 @@
include_recipe "apache2::mod_proxy"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright

DocumentRoot <%= @horizon_dir %>
Alias /media <%= @horizon_dir %>/media
Alias /static <%= @horizon_dir %>/static
<% if @grafana_available %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you actually need grafana_available variable?
You just need checking if grafana_url is not empty to include into template.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright

# See the License for the specific language governing permissions and
# limitations under the License.


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/EmptyLines: Extra blank line detected.

Copy link

@jgrassler jgrassler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this point to the load balancer the Monasca cluster is behind?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@samirjorina samirjorina merged commit 3f03764 into FujitsuEnablingSoftwareTechnologyGmbH:monasca Feb 20, 2017
@samirjorina samirjorina deleted the monasca_ui_config branch February 28, 2017 10:09
samirjorina added a commit that referenced this pull request Mar 28, 2017
* Configure monasca-ui plugin

* Refactor the code

* Addresing review comments

* Deploy grafana alongside horizon

* Remove obsolete changes to monasca schema

* Removing extra blank line
samirjorina added a commit to samirjorina/crowbar-openstack that referenced this pull request Mar 30, 2017
* Configure monasca-ui plugin

* Refactor the code

* Addresing review comments

* Deploy grafana alongside horizon

* Remove obsolete changes to monasca schema

* Removing extra blank line
samirjorina added a commit that referenced this pull request Mar 30, 2017
* Configure monasca-ui plugin

* Refactor the code

* Addresing review comments

* Deploy grafana alongside horizon

* Remove obsolete changes to monasca schema

* Removing extra blank line
dirkmueller pushed a commit that referenced this pull request Apr 18, 2017
* Configure monasca-ui plugin

* Refactor the code

* Addresing review comments

* Deploy grafana alongside horizon

* Remove obsolete changes to monasca schema

* Removing extra blank line
dirkmueller pushed a commit that referenced this pull request Apr 18, 2017
* Configure monasca-ui plugin

* Refactor the code

* Addresing review comments

* Deploy grafana alongside horizon

* Remove obsolete changes to monasca schema

* Removing extra blank line
dirkmueller pushed a commit that referenced this pull request Apr 19, 2017
* Configure monasca-ui plugin

* Refactor the code

* Addresing review comments

* Deploy grafana alongside horizon

* Remove obsolete changes to monasca schema

* Removing extra blank line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants