cncws opened a new pull request, #16495:
URL: https://github.com/apache/dolphinscheduler/pull/16495
<!--Thanks very much for contributing to Apache DolphinScheduler, we are
happy that you want to help us improve DolphinScheduler! -->
## Purpose of the pull request
This pull request fix the bug #15961
## Brief change log
- Rename the attribute `pythonLauncher` to `pythonCommand` which is used in
front end.
## Verify this pull request
This pull request is already covered by existing tests: `PytorchTaskTest`.
Moreover, we can test on the running DS. (Results are expected and match
with PytorchTaskTest)
Case1: set pythonCommand in front end, PyTorch used pythonCommand path
instead of `$PYTHON_LAUNCHER`. Following text is copied from task log.
```
...
"taskParams":
"{\"localParams\":[],\"resourceList\":[],\"script\":\"main.py\",\"pythonPath\":\"/home/cws/hello-python\",\"pythonCommand\":\"/usr/bin/python3\",\"pythonEnvTool\":\"conda\",\"requirements\":\"requirements.txt\",\"condaPythonVersion\":\"3.7\"}",
"environmentConfig": "export
PYTHON_LAUNCHER=/opt/miniconda3/bin/python\nexport
PATH=/opt/miniconda3/bin:$PATH"
...
[INFO] 2024-08-20 19:30:12.404 +0800 - Final Shell file is :
#!/bin/bash
BASEDIR=$(cd `dirname $0`; pwd)
cd $BASEDIR
export PYTHON_LAUNCHER=/opt/miniconda3/bin/python
export PATH=/opt/miniconda3/bin:$PATH
export PYTHONPATH=/home/cws/hello-python
/usr/bin/python3 /home/cws/hello-python/main.py
```
Case2: pythonCommand is not set, default $PYTHON_LAUNCHER should be used
under this case.
```
...
"taskParams" :
"{\"localParams\":[],\"resourceList\":[],\"script\":\"main.py\",\"pythonPath\":\"/home/cws/hello-python\",\"pythonCommand\":\"\",\"pythonEnvTool\":\"conda\",\"requirements\":\"requirements.txt\",\"condaPythonVersion\":\"3.7\"}",
"environmentConfig" : "export
PYTHON_LAUNCHER=/opt/miniconda3/bin/python\nexport
PATH=/opt/miniconda3/bin:$PATH",
...
[INFO] 2024-08-20 19:30:12.417 +0800 - Final Shell file is :
#!/bin/bash
BASEDIR=$(cd `dirname $0`; pwd)
cd $BASEDIR
export PYTHON_LAUNCHER=/opt/miniconda3/bin/python
export PATH=/opt/miniconda3/bin:$PATH
export PYTHONPATH=/home/cws/hello-python
${PYTHON_LAUNCHER} /home/cws/hello-python/main.py
```
## Pull Request Notice
[Pull Request
Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)
If your pull request contain incompatible change, you should also add it to
`docs/docs/en/guide/upgrede/incompatible.md`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]