Added CommandWrapLauncher to easily append/prepend to launch commands.#111
Added CommandWrapLauncher to easily append/prepend to launch commands.#111johannesbulin wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new ComposeLauncher wrapper to modify an existing launcher’s final command by prepending and/or appending additional command fragments, and adds tests to validate the wrapper’s behavior across supported launchers and environment setups.
Changes:
- Added
ComposeLauncher(LauncherWrapper) that rewritesLaunchData.cmdas:prepend_flags + base_cmd + flags + append_flags. - Exported the new launcher wrapper from
ifsbench.launch. - Added parametrized tests covering
run_dir,env, andcmdbehavior for the wrapper.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
ifsbench/launch/composelauncher.py |
Adds the new ComposeLauncher wrapper that composes command lists around an existing prepared command. |
ifsbench/launch/__init__.py |
Exposes ComposeLauncher as part of the ifsbench.launch public API. |
ifsbench/launch/tests/test_composelauncher.py |
Adds sanity tests validating that wrapping preserves run_dir/env and composes cmd as intended. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #111 +/- ##
==========================================
+ Coverage 91.90% 92.20% +0.29%
==========================================
Files 77 81 +4
Lines 4495 4706 +211
==========================================
+ Hits 4131 4339 +208
- Misses 364 367 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
d2d3c68 to
1e08b0a
Compare
|
@awnawab : This would give you a rather easy way to append/prepend flags/commands to a launch command, so would become Is this what you want? Or do you need something that appends/prepends to the actual command that you want to launch, for example to transform to |
|
More the latter. I can't think of a use case for prepend_flags, and am mainly looking for a hook to add in debugger/profiler invocations. |
Thanks! I'll try to work on a solution for this! |
…mpositeLauncher * Add CommandOverride, CommandWrapOverride, and command_overrides to CompositeLauncher Agent-Logs-Url: https://github.com/johannesbulin/ifsbench/sessions/be8b4c6e-00f4-40ac-9afd-098097a2aece Co-authored-by: johannesbulin <141238457+johannesbulin@users.noreply.github.com> * Address review comments: use List (capitalized) in docstring, #: for attribute docs Agent-Logs-Url: https://github.com/johannesbulin/ifsbench/sessions/6d8ba124-163b-4c1b-9dae-c4812dbda20e Co-authored-by: johannesbulin <141238457+johannesbulin@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: johannesbulin <141238457+johannesbulin@users.noreply.github.com>
commandoverride.py.
|
Hi @awnawab , I've added a Is this what you need? |
|
Yes this is exactly what I was after, thanks! In fact, the |
Description
Added a
CommandWrapLauncherthat basically appends or prepends some additional flags/commands to the launch command.Contributor Declaration
By opening this pull request, I affirm the following: