Skip to content

fix(trainer): simplify local-exec command building process#249

Open
khushiiagrawal wants to merge 2 commits intokubeflow:mainfrom
khushiiagrawal:fix-93-simplify-local-exec
Open

fix(trainer): simplify local-exec command building process#249
khushiiagrawal wants to merge 2 commits intokubeflow:mainfrom
khushiiagrawal:fix-93-simplify-local-exec

Conversation

@khushiiagrawal
Copy link

What this PR does / why we need it:

Different from the previous approach of using complex Bash script templates, this PR simplifies the local-exec command building process by introducing a generated Python runner script (runner.py). This improves maintainability, debugging, and cross-platform compatibility.

Specific changes include:

  • Refactored Command Generation: Replaced LOCAL_EXEC_JOB_TEMPLATE (Bash) with RUNNER_TEMPLATE (Python) in constants.py.
  • Updated Utils: Modified utils.py to generate the runner.py script which handles virtual environment creation, dependency installation, and training command execution using Python's subprocess.
  • Bug Fix: Corrected LocalProcessBackend.__get_job_status in backend.py to properly return TRAINJOB_COMPLETE instead of defaulting to TRAINJOB_CREATED, ensuring wait_for_job_status functions correctly.
  • Testing: Added utils_test.py to verify the command generation logic.

Fixes #93

Checklist:

  • Docs included if any changes are user facing

@google-oss-prow
Copy link

[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 kramaranya 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 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

@github-actions
Copy link

🎉 Welcome to the Kubeflow SDK! 🎉

Thanks for opening your first PR! We're happy to have you as part of our community 🚀

Here's what happens next:

  • If you haven't already, please check out our Contributing Guide for repo-specific guidelines and the Kubeflow Contributor Guide for general community standards
  • Our team will review your PR soon! cc @kubeflow/kubeflow-sdk-team

Join the community:

Feel free to ask questions in the comments if you need any help or clarification!
Thanks again for contributing to Kubeflow! 🙏

Signed-off-by: khushiiagrawal <khushisaritaagrawal@gmail.com>
@khushiiagrawal khushiiagrawal force-pushed the fix-93-simplify-local-exec branch from 1b4bb7c to 2ed9eef Compare January 29, 2026 17:30
@google-oss-prow google-oss-prow bot added size/L and removed size/XXL labels Jan 29, 2026
@khushiiagrawal khushiiagrawal changed the title refactor(trainer): simplify local-exec command building process fix(trainer): simplify local-exec command building process Jan 29, 2026
…and remove unused test imports

Signed-off-by: khushiiagrawal <khushisaritaagrawal@gmail.com>
@khushiiagrawal
Copy link
Author

hii @kramaranya @astefanutti

I noticed that the uv.lock file in the main branch seems to be corrupted. When I try to run the tests locally to verify my changes, uv lock --check fails with a syntax error (missing field version at line 921).

I haven't included the lockfile regeneration in this commit yet, but as a result, the tests are currently failing locally (and likely in CI if it checks the lockfile).

Could you please confirm if I should regenerate and commit the fixed uv.lock in this PR ? This seems necessary to get the tests passing.
Thanks!

@khushiiagrawal
Copy link
Author

@andreyvelich @akshaychitneni Please take a look.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

simply local-exec backend command building process

1 participant