From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] [autobuild] autobuild: add config option to set niceness
Date: Wed, 25 Nov 2015 18:08:33 +0100 [thread overview]
Message-ID: <20151125170833.GA3987@free.fr> (raw)
In-Reply-To: <1448403978-22104-1-git-send-email-yann.morin.1998@free.fr>
Thomas, All,
On 2015-11-24 23:26 +0100, Yann E. MORIN spake thusly:
> When the machine running the autobuilder is shared, it is important
> that the autobuilder instances do not hog all of the CPU.
>
> Add an option to the configuration, so that the user can set the
> niceness to run the instances with. By default, the niceness is 0,
> which means the current niceness.
>
> Properly doing so would require setting up a container with proper
> CPU cgroup, but it's a bit complicated.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Forget about that one, I'll submit an updated version later tonight,
with the docopt help fixed with the real default value, like isdone for
the other default values.
Regards,
Yann E. MORIN.
> ---
> scripts/autobuild-run | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/autobuild-run b/scripts/autobuild-run
> index 76b7201..fb48950 100755
> --- a/scripts/autobuild-run
> +++ b/scripts/autobuild-run
> @@ -64,6 +64,7 @@ defaults = {
> '--njobs': '1',
> '--submitter': 'N/A',
> '--make-opts': '',
> + '--nice': 0,
> }
>
> doc = """autobuild-run - run Buildroot autobuilder
> @@ -77,6 +78,8 @@ Options:
> Defaults to %(--ninstances)s.
> -j, --njobs NJOBS number of parallel jobs
> Defaults to %(--njobs)s.
> + --nice N Niceness, positive number
> + No default.
> -s, --submitter SUBMITTER name/machine of submitter
> Defaults to %(--submitter)s.
> --http-login LOGIN username to send results with
> @@ -101,6 +104,7 @@ Format of the configuration file:
> [main]
> ninstances = <value>
> njobs = <value>
> + nice = <value>
> http-login = <value>
> http-password = <value>
> submitter = <value>
> @@ -540,6 +544,7 @@ def do_build(**kwargs):
>
> idir = "instance-%d" % kwargs['instance']
> log = kwargs['log']
> + nice = kwargs['nice']
>
> # We need the absolute path to use with O=, because the relative
> # path to the output directory here is not relative to the
> @@ -551,7 +556,9 @@ def do_build(**kwargs):
> f = open(os.path.join(outputdir, "logfile"), "w+")
> log_write(log, "INFO: build started")
>
> - cmd = ["timeout", str(MAX_DURATION), "make", "O=%s" % outputdir,
> + cmd = ["timeout", str(MAX_DURATION),
> + "nice", "-n", nice,
> + "make", "O=%s" % outputdir,
> "-C", srcdir, "BR2_DL_DIR=%s" % dldir,
> "BR2_JLEVEL=%s" % kwargs['njobs']] \
> + kwargs['make_opts'].split()
> @@ -851,6 +858,7 @@ def main():
> http_password = args['--http-password'],
> submitter = args['--submitter'],
> make_opts = (args['--make-opts'] or ''),
> + nice = (args['--nice'] or 0),
> upload = upload,
> buildpid = buildpid
> ))
> --
> 1.9.1
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
prev parent reply other threads:[~2015-11-25 17:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 22:26 [Buildroot] [PATCH] [autobuild] autobuild: add config option to set niceness Yann E. MORIN
2015-11-25 17:08 ` Yann E. MORIN [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151125170833.GA3987@free.fr \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox