-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version command #242
base: master
Are you sure you want to change the base?
Version command #242
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
Some initial thoughts as individual comments.
rebench/configurator.py
Outdated
def _parse_executor(self, executor_name, executor_config): | ||
path = executor_config.get('path') | ||
executable = executor_config.get('executable') | ||
cores = executor_config.get('cores') | ||
version_command = executor_config.get('version_command') | ||
|
||
executor = Executor([], False, self.ui, config_dir=self.config_dir) | ||
if version_command: | ||
executor.set_version_command(version_command) | ||
return executor | ||
|
||
def _compile_experiment(self, exp_name, experiment): | ||
experiment['executors'] = {name: self._parse_executor(name, config) for name, config in | ||
experiment.get('executors', {}).items()} | ||
return Experiment.compile(exp_name, experiment, self) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate a bit what this code is doing?
Isn't this what model.executor.Executor.compile()
is doing?
rebench/configurator.py
Outdated
executor_config = self._executors[executor_name] | ||
executor = Executor.compile( | ||
executor_name, self._executors[executor_name], | ||
executor_name, executor_config, | ||
run_details, variables, self.build_commands, action) | ||
|
||
version_command = executor_config.get('version_command') | ||
if version_command: | ||
executor.version_command = version_command | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also looks like it should be handled in model.executor.Executor.compile()
rebench/model/executor.py
Outdated
"""Specializing the executor details in the run definitions with the settings from | ||
the executor definitions | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for removing this docstring?
rebench/model/executor.py
Outdated
except subprocess.CalledProcessError as e: | ||
return e.stderr.strip() | ||
else: | ||
return "Unknown version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use None
instead of a string here? Otherwise, we won't be able to programmatically tell apart the cases of not having a version and having a string with arbitrary text.
executors: | ||
TestRunner1: | ||
path: ~/PycharmProjects/ReBench/rebench/tests | ||
executable: test-vm1.py %(cores)s | ||
cores: [1] | ||
version_command: "python --version" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need three new config files for this? Could this perhaps be solved with having 3 different executors in the same config file and testing directly for those?
Handle version: _command, _string, _git. Removed code from configurator.py, which duplicates executor.py. Joined all separate “version” configuration files into a single one. Also, in the executor.py get_version function returns None instead of string, if version is not found.
Handle version: _command, _string, _git. Removed code from configurator.py, which duplicates executor.py. Joined all separate “version” configuration files into a single one. Also, in the executor.py get_version function returns None instead of string, if version is not found. Also fixed the code in order to make it pass the pylit tests (line too long, etc.)
Handle version_string, version_git.