Skip to content
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

RHEL7/CentOS7 support + 5 more #30

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

clehene
Copy link

@clehene clehene commented Apr 2, 2015

I'd like to discuss these changes on the PR and see how much we can integrate :)

  • Add support for RHEL7/CentOS7
  • Minor refactoring to remove (some) duplication in .pp files
  • Added / changed some configs/defaults
  • Forced yum cache expiry to actually get updates
  • Changed configuration templates so that config files could be sourced directly by service units

MESOS_cluster="<%= @cluster %>"
MESOS_log_dir="<%= @log_dir %>"
MESOS_logbufsecs=1
MESOS_logging_level="INFO"
Copy link
Owner

Choose a reason for hiding this comment

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

I don't like default that you can't change. Though, in this case you could override this value in @env_var with same key.

Copy link
Author

Choose a reason for hiding this comment

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

@deric I hope I understand your comment correctly.
As this is a template it could be used to generate defaults or other files.
I'm suggesting it should be based on the environment variables and, hence could be sourced (e.g. by systemd).

The current one relies on variables that are replaced with environment variables by a script that is not versioned with mesos (not even source if it's available).

IMHO there are too many ways to configure things (this, defaults, configs, files, env vars and cli args) and this could be confusing and also unneeded in Puppet managed environments.

Copy link
Owner

Choose a reason for hiding this comment

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

We should decide whether we want to configure Mesos via properties (/etc/mesos-master/* and /etc/mesos-slave/*) or by using ENV MESOS_{variables}. I think supporting both at the same time is very confusing. CLI arguments are out of questions, we expect people run Mesos as service using systemd, sysvinit or whatever else. When someone checks Mesos machine configuration will he look into /etc/default/mesos-slave or /etc/mesos-slave? Each Mesos version adds new parameters, it's problematic to add new variables each time this happens.

@deric
Copy link
Owner

deric commented Apr 2, 2015

Generally I like the changes, don't be mistaken by too many comments. Definitely we have to fix the tests and try not to break current behaviour. If the changes would come in separate PR, it would be much easier to merge them. Anyway, we should probably bump the version at least to 0.6 or 1.0.

@clehene
Copy link
Author

clehene commented Apr 5, 2015

Thanks @deric I'll address the comments and make multiple PRs

@felixb
Copy link
Contributor

felixb commented Nov 26, 2015

Is there any update on this?
I just wanted to implement the same thing. Native systemd support would be very nice.

@deric
Copy link
Owner

deric commented Nov 26, 2015

It would be nice to separate this into multiple PR, or create at least an issue for systemd support.

@felixb
Copy link
Contributor

felixb commented Nov 27, 2015

@clehene: are you working on this?

@clehene
Copy link
Author

clehene commented Dec 1, 2015

@felixb @deric yes, we use this internally and had very recently made a few more changes we'd like to push upstream.
This said, @deric please see my questions above

ping @adragomir

@clehene
Copy link
Author

clehene commented Dec 12, 2015

We've rebased on top of master, need to cleanup patches and will make new PRs

@felixb
Copy link
Contributor

felixb commented Jan 13, 2016

any updates?

@clehene
Copy link
Author

clehene commented Jan 28, 2016

@felixb I rebased everything we have on top of current master and will make separate PRs for each one CentOS7 will come as a single commit/PR but I recommend we discuss the whole group.

@deric there are a few questions which you still haven't answered. I think it's worth discussing them, can you please take a look over the comments on the PR. Thanks!

@@ -27,14 +27,15 @@
$conf_dir = '/etc/mesos',
# e.g. zk://localhost:2181/mesos
$zookeeper = '',
$quorum = 1,
Copy link
Owner

Choose a reason for hiding this comment

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

Until now quorum variable could have been set via options:

  options => {
    quorum   => 4
  }

But which one should take precedence? We don't want to break existing installations, so from this point of view it should be overridden by options value, if defined.

@blsmth
Copy link

blsmth commented Mar 16, 2016

any status on this? I'm currently trying to use this module on CentOS7 since puppet forge advertises it as compatible, but i'm slowly finding it's not fully. some strange issues that may be resolved by this fix

@deric
Copy link
Owner

deric commented Mar 16, 2016

@blsmth What kind of issues you're having? Could you create a separate issue, so that we can address then individually?

@blsmth
Copy link

blsmth commented Mar 16, 2016

thanks @deric see this issue

@clehene clehene force-pushed the master branch 2 times, most recently from 4a81e73 to 15d3549 Compare March 26, 2016 23:33
@clehene
Copy link
Author

clehene commented Mar 26, 2016

@felixb @blsmth @deric ping rebased to master and updated
Sorry it took forever, but every time I wanted to push this and rebased it got into another round of conflicts with master...

@clehene clehene changed the title 5 PRs in one (for discussion)... RHEL7/CentOS7 support + 5 more Mar 26, 2016
@deric
Copy link
Owner

deric commented Mar 27, 2016

@clehene cool, looks much better! What's the reasoning for introducing mesos::common::mkdir_p? Can't we just use:

file{'/some/path':
  ensure  => present,
  recurse => true,
} 

otherwise we have to handle various duplicate declaration conflicts. The exec should contain at least creates:

exec { "mkdir_p-${name}":
  creates => $name,
  command => "mkdir -p ${name}",
  unless  => "test -d ${name}",
  path    => '/bin:/usr/bin',
}

But it would be better if we could manage it just with default file resource.

@clehene
Copy link
Author

clehene commented Mar 27, 2016

@deric ensure => directory, recurse => true will only affect ownership (and probably other properties) but won't create the parent directories. It was decided that that's too complicated (https://projects.puppetlabs.com/issues/86)
Note that mkdir_p should have a reference to the original author (did I lose it during rebase?) https://github.com/ghoneycutt/puppet-module-common/blob/master/manifests/mkdir_p.pp
I'll add creates

@clehene
Copy link
Author

clehene commented Mar 27, 2016

The commit "Changed templates to set MESOS_ env vars" should have been squashed (at least partially) into the main RHEL7 support as it's required because SystemD EnvironmentFile doesn't work with export

@clehene clehene force-pushed the master branch 3 times, most recently from 4c43b12 to fcdeb51 Compare March 27, 2016 21:23
Cosmin Lehene added 4 commits March 27, 2016 14:47
Ensure the directories are created with mkdir -p
This may cause conflicts, but it's better than
relying on Mesosphere script that all it seems to
do is to replace these with MESOS prefixed vars
anyway.
@clehene
Copy link
Author

clehene commented Mar 28, 2016

Question: this is currently sourcing EnvironmentFile=/etc/default/mesos-<%= @name %>
If you'd like to maintain the previous functionality based on env vars (not sure it's needed), we could probably have both files created and the template could add "export" optionally, based on a variable or something.

@felixb
Copy link
Contributor

felixb commented Mar 28, 2016

Imho, the config should live in /etc/sysconfig/ on centos.

@clehene
Copy link
Author

clehene commented Mar 30, 2016

thanks @felixb for pointing that. I'll fix it.

@clehene
Copy link
Author

clehene commented Mar 30, 2016

Quick note. I'm seeing some issues (yum list doesn't return anything because the repo is not being installed.) I'll dig into that and fix it. It's likely a missing dependency.

@deric
Copy link
Owner

deric commented Mar 30, 2016

@clehene What is the reason for removing all:

  owner  => $owner,
  group  => $group,

does it cause problems on RHEL7? Can't we just set $owner = undef, so that we don't break existing feature?

@clehene
Copy link
Author

clehene commented Mar 30, 2016

@deric I'm not removing them, I'm just setting them globally

  File {
    owner   => $owner,
    group   => $group,
  }

(resource default statements - https://docs.puppetlabs.com/puppet/latest/reference/lang_defaults.html) so that we avoid having them set everywhere

@deric
Copy link
Owner

deric commented Mar 31, 2016

Ok, sorry. I've overlooked that.


[Service]
Delegate=yes
ExecStart=/usr/sbin/mesos-<%= @name %> <% if @name=='slave' -%>-containerizers=docker,mesos<% end -%>
Copy link
Owner

Choose a reason for hiding this comment

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

If you're using Mesosphere packages it would be easier to use:

ExecStart=/usr/bin/mesos-init-wrapper <%= @name %>

if you want to execute directly mesos binaries, we have to make sure, that all environment variables are defined.
Either way -containerizers=docker,mesos should not be hardcoded.

@deric
Copy link
Owner

deric commented Mar 31, 2016

We should introduce some parameter configure_via => env_vars (or files for using /etc/mesos-slave, /etc/mesos-master) which would avoid having same configuration at two places.

@deric
Copy link
Owner

deric commented Jul 21, 2016

This PR is getting too old and some of the issues mentioned are probably already solved, please let me know if any of the issues still persists. I'll try to track the discussion as separate issues:

  • Add support for RHEL7/CentOS7
  • Minor refactoring to remove (some) duplication in .pp files Remove code duplication #75
  • Added / changed some configs/defaults
  • Forced yum cache expiry to actually get updates Expire yum cache #76
  • Changed configuration templates so that config files could be sourced directly by service units

This was referenced Jul 21, 2016
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.

5 participants