Commit 701e972
run par as an entrypoint if there is no patch or jetter patch. (#994)
Summary:
Pull Request resolved: #994
# Context:
Currently, when running torchx local job, we are using penv_python as entrypoint. That means we pass the actual .par or .xar file as argument to penv_python. within penv_python, the par/xar is executed as a new process.
# Old way to run torchx local job.
For example, if the local job is running "jetter --help", torchx runs it like:
PENV_PAR='/data/users/yikai/fbsource/buck-out/v2/gen/fbcode/a6cb9616985b22b0/jetter/__jetter-bin__/jetter-bin-inplace.par' penv_python -m jetter.main --help
It passes the par file as an environment variable called "PENV_PAR"(There is another way to pass this to penv_python, which is passing 'PENV_PARNAME' as env variable then get the par file's path using it. But it is very very rare, only 0.1% of total usage.)
# New way to run torchx local job
After migration, We will run it like:
PAR_MAIN_OVERRIDE=jetter.main /data/users/yikai/fbsource/buck-out/v2/gen/fbcode/a6cb9616985b22b0/jetter/__jetter-bin__/jetter-bin-inplace.par --help
NOTE: This diff only migrates one of the most common use cases, which: 1. There are no patch or jetter patch. 2. it's a par not xar. 3. the par file is passed via "PENV_PAR" env variable. For other use cases, we still run penv_python as entrypoint.
Reviewed By: Sanjay-Ganeshan
Differential Revision: D666216491 parent ff22758 commit 701e972
1 file changed
+19
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
696 | 697 | | |
697 | 698 | | |
698 | 699 | | |
699 | | - | |
| 700 | + | |
700 | 701 | | |
701 | 702 | | |
702 | 703 | | |
703 | 704 | | |
704 | | - | |
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
| |||
714 | 714 | | |
715 | 715 | | |
716 | 716 | | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
717 | 734 | | |
718 | 735 | | |
719 | 736 | | |
| |||
0 commit comments