Merge lp:~lutostag/charms/trusty/jenkins-slave/trusty-jenkins-slave+executors into lp:~matsubara/charms/trusty/jenkins-slave/trusty-jenkins-slave

Proposed by Greg Lutostanski
Status: Needs review
Proposed branch: lp:~lutostag/charms/trusty/jenkins-slave/trusty-jenkins-slave+executors
Merge into: lp:~matsubara/charms/trusty/jenkins-slave/trusty-jenkins-slave
Diff against target: 36 lines (+10/-1)
2 files modified
config.yaml (+5/-0)
hooks/slave-relation-joined (+5/-1)
To merge this branch: bzr merge lp:~lutostag/charms/trusty/jenkins-slave/trusty-jenkins-slave+executors
Reviewer Review Type Date Requested Status
Diogo Matsubara Pending
Review via email: mp+280976@code.launchpad.net

Description of the change

Allow setting number of executors explicitly as a charm option

To post a comment you must log in.
29. By Greg Lutostanski

config option name change executors->slave-executors

Unmerged revisions

29. By Greg Lutostanski

config option name change executors->slave-executors

28. By Greg Lutostanski

allow explicit setting of executors for slave

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2014-03-26 03:14:41 +0000
+++ config.yaml 2016-01-12 16:30:47 +0000
@@ -1,4 +1,9 @@
1options:1options:
2 slave-executors:
3 type: int
4 description: |
5 Number of executors to configure for this slave. By default, slave will
6 get one for each core listed in /proc/cpuinfo.
2 tools:7 tools:
3 type: string8 type: string
4 default: git gcc make bzr9 default: git gcc make bzr
510
=== modified file 'hooks/slave-relation-joined'
--- hooks/slave-relation-joined 2015-09-03 15:17:43 +0000
+++ hooks/slave-relation-joined 2016-01-12 16:30:47 +0000
@@ -5,13 +5,17 @@
5# Set the slave hostname to match the juju unit5# Set the slave hostname to match the juju unit
6# in the jenkins master instance6# in the jenkins master instance
7slavehost=`echo ${JUJU_UNIT_NAME} | sed s,/,-,`7slavehost=`echo ${JUJU_UNIT_NAME} | sed s,/,-,`
8noexecutors=`cat /proc/cpuinfo | grep processor | wc -l`8noexecutors=`config-get slave-executors`
9config_labels=`config-get labels`9config_labels=`config-get labels`
10labels=`uname -p`10labels=`uname -p`
1111
12if [ -n "$config_labels" ]; then12if [ -n "$config_labels" ]; then
13 labels=$config_labels13 labels=$config_labels
14fi14fi
15if [ -z "$noexecutors" ]; then
16 noexecutors=`cat /proc/cpuinfo | grep processor | wc -l`
17fi
18
1519
16# Set all relations20# Set all relations
17relation-set executors=$noexecutors21relation-set executors=$noexecutors

Subscribers

People subscribed via source and target branches