fix(trainer): build container paths with POSIX separators #849
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign andreyvelich for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
<details open>
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
</details>
<!-- META={"approvers":["andreyvelich"]} -->
/ok-to-test
Could we add an OS-independent regression assertion for MODEL_PATH as well? The new Windows simulation protects the MPI and dataset paths, but changing this line back to os.path.join() would still leave the focused tests passing. Existing container tests compare OUTPUT_PATH with constants.MODEL_PATH, so both values would be wrong together on Windows. A direct assertion that the Windows simulation still produces "/workspace/model" would cover the remaining requirement from issue #848.
Hi @singhharsh1708 thanks for the contribution, left a comment, PTAL
Added a test for both DATASET_PATH and MODEL_PATH. It fails if either one goes back to os.path.join.
/lgtm
Could you extend these tests:
You can just extend the TestCase[config] to add client type, and monkeypatch when Windows is set.
Thank you for fixing our SDK on Windows platforms @singhharsh1708!
New changes are detected. LGTM label has been removed.
Done, they're TestCases with client_os: windows now and the standalone ones are gone.
RobuRishabh
singhharsh1708
What this PR does / why we need it:
DATASET_PATH,MODEL_PATH, the TorchTune dataset args and the MPI function file path point inside the Linux container but were joined withos.path.join, so a Windows client sent/workspace\datasetand/home/mpiuser\train.pyin the TrainJob. This joins them withposixpath. Nothing changes on Linux or macOS.The new tests swap
os.pathforntpathin the module under test, so they fail without the fix on any OS.Which issue(s) this PR fixes _(optional, in
Fixes #<issue number>, #<issue number>, ...format, will close the issue(s) when PR gets merged)_:Fixes #848
Checklist: