fix: remove unexpected side effect in get_srun_flags #408
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, if
nemo_run_diris falsy, this function will append mounts to theself.executor.container_mountslist, resulting in unexpected extension of the list with every call.This function is called by materialize, which it turns out is even called by the
__repr__ofSlurmRayRequestand as such one would expect it not to have any side effects (especially since the name of the offending function suggests its a getter).Found while debugging an issue that turned out to not be caused by NeMo Run, but finding increasing number of duplicate mounts as my debugger helpfully displayed the repr of the class when I was looking at it.
Considering how simple the fix is (and that I already tested it locally when trying to debug the issue) I decided not to create an issue before this PR, hopefully that's acceptable here.