Skip to content

Commit

Permalink
Document that SETENV is needed with sudo, and provide error info when…
Browse files Browse the repository at this point in the history
… gauge-adapter parsing fails (#211)
  • Loading branch information
smarr committed Apr 7, 2023
2 parents 04bbd17 + 17405f3 commit 0398422
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ To reduce noise generated by the system, `rebench-denoise` depends on:

- `sudo` rights. `rebench` will attempt to determine suitable configuration
parameters and suggest them. This includes allowing the execution of `rebench-denoise`
via `sudo` without password.
via `sudo` without password and with the permission to set environment variables (`SETENV`).
- [`cpuset`](https://github.com/lpechacek/cpuset/) to reserve cores for benchmarking.
On Ubuntu: `apt install cpuset`

Expand Down
2 changes: 1 addition & 1 deletion rebench/denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def minimize_noise(show_warnings, ui, for_profiling): # pylint: disable=too-man
+ ' can be used without password.\n'
msg += '{ind}To be able to run rebench-denoise without password,\n'
msg += '{ind}add the following to the end of your sudoers file (using visudo):\n'
msg += '{ind}{ind}' + getpass.getuser() + ' ALL = (root) NOPASSWD: '\
msg += '{ind}{ind}' + getpass.getuser() + ' ALL = (root) NOPASSWD:SETENV: '\
+ denoise_cmd + '\n'
elif 'command not found' in output:
msg += '{ind}Please make sure `rebench-denoise` is on the PATH\n'
Expand Down
9 changes: 7 additions & 2 deletions rebench/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
from time import time

from . import subprocess_with_timeout as subprocess_timeout
from .interop.adapter import ExecutionDeliveredNoResults, instantiate_adapter
from .interop.adapter import ExecutionDeliveredNoResults, instantiate_adapter, OutputNotParseable, \
ResultsIndicatedAsInvalid
from .ui import escape_braces


Expand Down Expand Up @@ -551,7 +552,11 @@ def _eval_output(self, output, run_id, gauge_adapter, cmdline):

run_id.indicate_successful_execution()
self.ui.verbose_output_info(msg, run_id, cmdline)
except ExecutionDeliveredNoResults:
except ExecutionDeliveredNoResults as e:
if isinstance(e, OutputNotParseable):
self.ui.error("{ind}Output of run could not be parsed.\n", run_id, cmdline)
elif isinstance(e, ResultsIndicatedAsInvalid):
self.ui.error("{ind}Results were marked as invalid.\n", run_id, cmdline)
run_id.indicate_failed_execution()
run_id.report_run_failed(cmdline, 0, output)

Expand Down

0 comments on commit 0398422

Please sign in to comment.