Fedora cgroups support.

* modules/jenkins/manifests/cgroups.pp
* modules/jenkins/manifests/params.pp: Fedora separates the cgroups
management utilities into an additional package.

* modules/jenkins/templates/cgconfig.erb: Fedora already automounts
cgroups subsystems. Also, because of Red Hat bug 918951, swap
management doesn't work in Fedora 18.

Change-Id: I2366261d64c11fdc8e65a39481e8db9d589ca2de
Reviewed-on: https://review.openstack.org/34083
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Jeremy Stanley 2013-06-22 02:03:20 +00:00 committed by Jenkins
parent f82f2fd6ac
commit 89a92bfb3d
3 changed files with 31 additions and 3 deletions

View File

@ -4,6 +4,12 @@ class jenkins::cgroups {
include jenkins::params
if ($::jenkins::params::cgroups_tools_package != '') {
package { 'cgroups-tools':
ensure => present,
name => $::jenkins::params::cgroups_tools_package,
}
}
package { 'cgroups':
ensure => present,
name => $::jenkins::params::cgroups_package,

View File

@ -50,8 +50,21 @@ class jenkins::params {
$xslt_package = 'libxslt'
$xvfb_package = 'xorg-x11-server-Xvfb'
$cgroups_package = 'libcgroup'
$cgconfig_require = Package['cgroups']
$cgred_require = Package['cgroups']
if ($::operatingsystem == 'Fedora') {
$cgroups_tools_package = 'libcgroup-tools'
$cgconfig_require = [
Package['cgroups'],
Package['cgroups-tools'],
]
$cgred_require = [
Package['cgroups'],
Package['cgroups-tools'],
]
} else {
$cgroups_tools_package = ''
$cgconfig_require = Package['cgroups']
$cgred_require = Package['cgroups']
}
}
'Debian': {
# common packages
@ -99,6 +112,7 @@ class jenkins::params {
$xslt_package = 'xsltproc'
$xvfb_package = 'xvfb'
$cgroups_package = 'cgroup-bin'
$cgroups_tools_package = ''
$cgconfig_require = [
Package['cgroups'],
File['/etc/init/cgconfig.conf'],

View File

@ -1,4 +1,7 @@
<% if osfamily == "RedHat" then %>
<% if operatingsystem == "Fedora" then %>
# Fedora auto-mounts subsystems under /sys/fs/cgroup/ already, so no
# mount section is needed.
<% elsif osfamily == "RedHat" then %>
mount {
cpuset = /cgroup/cpuset;
@ -48,6 +51,11 @@ group jenkins/children {
memory {
memory.soft_limit_in_bytes = <%= (memorytotalbytes.to_f * 0.75).to_i %>;
memory.limit_in_bytes = <%= (memorytotalbytes.to_f * 0.9).to_i %>;
<% if (operatingsystem == "Fedora") and (operatingsystemrelease == "18") then %>
# Because of Red Hat bug 918951, swap management doesn't
# work in Fedora 18 but should be fixed in 19.
<% else %>
memory.memsw.limit_in_bytes = <%= (memorytotalbytes.to_f * 0.9).to_i %>;
<% end %>
}
}