Skip to content

Add Sahara barclamp#480

Merged
Itxaka merged 1 commit intocrowbar:masterfrom
Itxaka:add_sahara_barclamp
Sep 19, 2016
Merged

Add Sahara barclamp#480
Itxaka merged 1 commit intocrowbar:masterfrom
Itxaka:add_sahara_barclamp

Conversation

@Itxaka
Copy link
Copy Markdown
Member

@Itxaka Itxaka commented Aug 2, 2016

This is basically #365 fixed and improved upon.

group node[:sahara][:group]
# We only do the sync the first time, and only if we're not doing HA or if we
# are the founder of the HA cluster (so that it's really only done once).
only_if { !node[:sahara][:db_synced] && (!ha_enabled || CrowbarPacemakerHelper.is_cluster_founder?(node)) }
Copy link
Copy Markdown

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. 109/100

@Itxaka Itxaka force-pushed the add_sahara_barclamp branch from ada2163 to 639c97f Compare August 3, 2016 10:40
= t(".logging_header")
= boolean_field :verbose
= boolean_field :debug
= boolean_field :use_syslog No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Files should end with a trailing newline

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we usually expose the use_syslog setting? I think it's hidden for all other barclamps.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Indeed, other barclamps do not expose this. But we still have the switch in the configuration to enable or disable it based on node[barclamp][:use_syslog], so why not expose it to the user and set it to a default value? And if we want it to be always false (because of supportconfig?) then whyset a switch instead of setting it to false on the template directly?

Knowing that we do not have a central logging system in place for crowbar, enabling this means that there is a cheap and easy way for customers to use syslog as forwarder to set up their own centralized log management.

end

saharas = search(:node, "roles:sahara-server") || []
use_sahara = saharas.empty? ? false: true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Style/SpaceAroundOperators: Surrounding space missing for operator :. (https://github.com/bbatsov/ruby-style-guide#spaces-operators)

@Itxaka Itxaka force-pushed the add_sahara_barclamp branch from 440c9fc to 0e1531c Compare August 5, 2016 11:50

api: {
bind_host: !node[:sahara][:ha][:enabled] && node[:sahara][:api][:bind_open_address] ? "0.0.0.0" : @ip,
bind_port: node[:sahara][:ha][:enabled] ? node[:sahara][:ha][:ports][:api_port].to_i : node[:sahara][:api][:bind_port].to_i,
Copy link
Copy Markdown

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. 138/100

@Itxaka Itxaka force-pushed the add_sahara_barclamp branch from 441b902 to 4b44a47 Compare September 8, 2016 11:04
api: {
bind_host: !node[:sahara][:ha][:enabled] &&
node[:sahara][:api][:bind_open_address] ? "0.0.0.0" : @ip,
bind_port: node[:sahara][:ha][:enabled] ?
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Style/MultilineTernaryOperator: Avoid multi-line ternary operators, use if or unless instead. (https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary)

@Itxaka Itxaka force-pushed the add_sahara_barclamp branch from 4b44a47 to eab9fc2 Compare September 8, 2016 11:05
@Itxaka
Copy link
Copy Markdown
Member Author

Itxaka commented Sep 8, 2016

goddammit hound

@Itxaka Itxaka force-pushed the add_sahara_barclamp branch 2 times, most recently from c0aec6b to bd96e27 Compare September 8, 2016 11:14
@Itxaka
Copy link
Copy Markdown
Member Author

Itxaka commented Sep 8, 2016

waiting for #523


transaction_objects = []

api_primitive = "sahara-api"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Continuing the discussion from #480 (comment):

@vuntz I thougth that while we need the API to be HA with a VIP and everything, we dont really need the engine to have a VIP as we can deploy it to X nodes without any repercussions so there is really no need to have it checked out and controlled by pacemaker?

I may be wrong in this, but as far as I undertand the arch of sahara, there should be no need for the engine to be controlled under pacemaker.

So that's based on a wrong assumption: we don't put services in pacemaker for the VIP, but because we want pacemaker to manage the service, restart it when needed and do something when things are awfully wrong.

So yes, we want sahara-engine to be handled in pacemaker (but not part of haproxy).

Btw, that's what we do in other barclamps too. Look at nova-scheduler, for instance.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So that's based on a wrong assumption: we don't put services in pacemaker for the VIP, but because we want pacemaker to manage the service, restart it when needed and do something when things are awfully wrong.

I see. So pacemaker is our service watchdog only when the cloud is on HA.

Will change this to get the engine in pacemaker and run the HA recipe from the role instead.

@Itxaka Itxaka force-pushed the add_sahara_barclamp branch 2 times, most recently from 2589db6 to a067483 Compare September 8, 2016 11:52
default[:sahara][:ha][:engine][:ra] = if ["rhel", "suse"].include? node[:platform_family]
"lsb:openstack-sahara-engine"
else
"lsb:sahara-engine"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Style/IndentationWidth: Use 2 (not 1) spaces for indentation. (https://github.com/bbatsov/ruby-style-guide#spaces-indentation)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Style/IndentationWidth: Use 2 (not 1) spaces for indentation. (https://github.com/bbatsov/ruby-style-guide#spaces-indentation)

@Itxaka Itxaka force-pushed the add_sahara_barclamp branch from a067483 to ec3d0f5 Compare September 8, 2016 11:54
@toabctl
Copy link
Copy Markdown
Contributor

toabctl commented Sep 9, 2016

@Itxaka Error: Committing the crowbar 'default' proposal for 'sahara' failed (1)..:

[2016-09-08T18:13:30+00:00] WARN: Current  execute[a2enmod deflate]: /var/chef/cache/cookbooks/apache2/definitions/apache_module.rb:28:in `block in from_file'
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/sahara/recipes/role_sahara_server.rb
================================================================================
NameError
---------
uninitialized constant Chef::Recipe::SaharaHelper
Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/sahara/recipes/common.rb:18:in `from_file'
  /var/chef/cache/cookbooks/sahara/recipes/role_sahara_server.rb:18:in `from_file'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/sahara/recipes/common.rb:
 11:  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12:  # See the License for the specific language governing permissions and
 13:  # limitations under the License.
 14:  #
 15:  
 16:  package "openstack-sahara"
 17:  
 18>> network_settings = SaharaHelper.network_settings(node)
 19:  db_settings = fetch_database_settings
 20:  
 21:  include_recipe "database::client"
 22:  include_recipe "#{db_settings[:backend_name]}::client"
 23:  include_recipe "#{db_settings[:backend_name]}::python-client"
 24:  
 25:  # get Database data
 26:  db_password = node[:sahara][:db][:password]
 27:  sql_connection = "#{db_settings[:url_scheme]}://#{node[:sahara][:db][:user]}:"\
[2016-09-08T18:13:30+00:00] ERROR: Running exception handlers

@Itxaka Itxaka force-pushed the add_sahara_barclamp branch from ec3d0f5 to 4b7587a Compare September 9, 2016 09:46
@Itxaka
Copy link
Copy Markdown
Member Author

Itxaka commented Sep 9, 2016

Thanks @toabctl should be fixed. That was a very dumb mistake :D

@toabctl
Copy link
Copy Markdown
Contributor

toabctl commented Sep 9, 2016

I retriggered gating with want_sahara=1...

@nicolasbock
Copy link
Copy Markdown
Contributor

+1

@Itxaka Itxaka force-pushed the add_sahara_barclamp branch from 4b7587a to 1a4b3ed Compare September 12, 2016 12:13
@Itxaka Itxaka force-pushed the add_sahara_barclamp branch from 1a4b3ed to 198e5fa Compare September 13, 2016 09:00
@Itxaka
Copy link
Copy Markdown
Member Author

Itxaka commented Sep 13, 2016

Retriggered with want_sahara. Did a mistake and set the port to the host and the host to the port so the service wasnt coming up :D

@dguitarbite
Copy link
Copy Markdown
Contributor

+1

@Itxaka
Copy link
Copy Markdown
Member Author

Itxaka commented Sep 13, 2016

@vuntz @aspiers Any last comments before I merge? I think I covered all your requests :)

@Itxaka Itxaka merged commit 82ee315 into crowbar:master Sep 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.