system-config/modules/jenkins/templates/cgconfig.erb
Jeremy Stanley 4a19b54683 Restore cgroup-bin Upstart jobs on Ubuntu Quantal.
* modules/jenkins/files/cgroups/upstart_cgconfig: Very trivial
Upstart job to load /etc/cgconfig.conf once cgroup-lite has started.

* modules/jenkins/files/cgroups/upstart_cgred: Very trivial Upstart
job to start cgred once cgconfig has been loaded.

* modules/jenkins/manifests/cgroups.pp: Conditionally add Upstart
jobs cgconfig and cgred if Ubuntu >= 12.10. They used to exist, but
were dropped in the process of refactoring cgroup support after
Precise.

* modules/jenkins/manifests/params.pp: Add parameter lists for the
cgconfig and cgred dependencies since they differ between RHEL and
Ubuntu.

* modules/jenkins/templates/cgconfig.erb: Conditionally omit the
default cgroup mounts section on Ubuntu Quantal or later.

Change-Id: I16e2996387d534928a3cfa90de9159fbe02bbdd2
Reviewed-on: https://review.openstack.org/20638
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
2013-01-30 22:06:09 +00:00

54 lines
1.1 KiB
Plaintext

<% if osfamily == "RedHat" then %>
mount {
cpuset = /cgroup/cpuset;
cpu = /cgroup/cpu;
cpuacct = /cgroup/cpuacct;
memory = /cgroup/memory;
devices = /cgroup/devices;
freezer = /cgroup/freezer;
net_cls = /cgroup/net_cls;
blkio = /cgroup/blkio;
}
<% elsif ( operatingsystemrelease < '12.10' ) or ( operatingsystem != 'Ubuntu' ) then %>
mount {
cpu = /sys/fs/cgroup/cpu;
cpuacct = /sys/fs/cgroup/cpuacct;
devices = /sys/fs/cgroup/devices;
memory = /sys/fs/cgroup/memory;
freezer = /sys/fs/cgroup/freezer;
}
<% end %>
group jenkins {
perm {
task {
uid = jenkins;
gid = jenkins;
}
admin {
uid = root;
gid = root;
}
}
}
group jenkins/children {
perm {
task {
uid = jenkins;
gid = jenkins;
}
admin {
uid = root;
gid = root;
}
}
memory {
memory.soft_limit_in_bytes = <%= (memorytotalbytes.to_f * 0.75).to_i %>;
memory.limit_in_bytes = <%= (memorytotalbytes.to_f * 0.9).to_i %>;
memory.memsw.limit_in_bytes = <%= (memorytotalbytes.to_f * 0.9).to_i %>;
}
}