You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/06/02 04:43:54 UTC
[GitHub] [dolphinscheduler] EricGao888 opened a new pull request, #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
EricGao888 opened a new pull request, #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337
## Purpose of the pull request
* Enable users to switch and install conda env in `jupyter task`. If the conda environment user needs for his/her jupyter task is not too large like bigger than 100M, the user could upload the packed conda environment to `resource center` and select it when creating `jupyter task`, `jupyter task plugin` will automatically install the conda env on target worker before executing jupyter notes.
* Also, users could upload multiple packed conda environments to `resource center` and select the one needed for a specific task.
* This feature will save users quite a lot of time from installing multiple environments on multiple workers and greatly better the experience of using `jupyter task plugin`

* This PR closes: #10302
## Brief change log
* Already described above.
## Verify this pull request
* Verified by unit tests and manual tests.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] zhongjiajie commented on pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#issuecomment-1156416505
and we still have discussion in https://github.com/apache/dolphinscheduler/pull/10337#discussion_r896857846, I wonder whether conda have some command like `import` same as docker's `docker import` to import and then `conda activate`?
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#discussion_r896857846
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterConstants.java:
##########
@@ -33,6 +33,18 @@ private JupyterConstants() {
*/
public static final String CONDA_ACTIVATE = "conda activate";
+ /**
+ * create and activate conda env from tar
+ */
+ public static final String CREATE_ENV_FROM_TAR = "mkdir jupyter_env && " +
+ "tar -xzf %s -C jupyter_env && " +
+ "source jupyter_env/bin/activate";
Review Comment:
> > > It's better. But what i mean is if the user's the compressed tar package path after decompression is inconsistent with this hard code path.
> >
> >
> > Seems if users use `conda pack` to pack their environment, when they run `tar` they will get the same directory structure. 
>
> I test locally, and it is 👍. but should we add some docs to tell use run `conda pack` to create the conda tarball?
@zhongjiajie Sure, that's a good idea. I will add some docs to instruct users on `conda pack`. BTW, is there any substitute for `source jupyter_env/bin/activate`? @SbloodyS and I discussed about this and it is possible that some companies ban developers from using `source` cmd.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#discussion_r893242034
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterConstants.java:
##########
@@ -33,6 +33,18 @@ private JupyterConstants() {
*/
public static final String CONDA_ACTIVATE = "conda activate";
+ /**
+ * create and activate conda env from tar
+ */
+ public static final String CREATE_ENV_FROM_TAR = "mkdir jupyter_env && " +
+ "tar -xzf %s -C jupyter_env && " +
+ "source jupyter_env/bin/activate";
Review Comment:
Currently, `env tar` will be downloaded from `resource center` before task execution and removed when task execution completed. https://github.com/apache/dolphinscheduler/blob/f90f0f8490d8f4cd87d2368cd0264a4837918c7d/dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java#L141-L145
https://github.com/apache/dolphinscheduler/blob/f90f0f8490d8f4cd87d2368cd0264a4837918c7d/dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/runner/TaskExecuteThread.java#L199-L203
However, I think it is a good idea to give a choice to define the path and install the env on workers without getting removed after task execution. In this way, the same env will not need to be downloaded every time.
WDYT @SbloodyS @zhongjiajie
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] EricGao888 commented on pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#issuecomment-1159457643
> SGTM, So please add some docs to hint users about the`source` command
Caveats to `source` command usage have been added in the latest commit, PTAL @zhongjiajie @SbloodyS Thx!
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#issuecomment-1144474450
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10337)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=CODE_SMELL) [1 Code Smell](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_coverage&view=list) [88.9% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_duplicated_lines_density&view=list)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#discussion_r896876584
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterConstants.java:
##########
@@ -33,6 +33,18 @@ private JupyterConstants() {
*/
public static final String CONDA_ACTIVATE = "conda activate";
+ /**
+ * create and activate conda env from tar
+ */
+ public static final String CREATE_ENV_FROM_TAR = "mkdir jupyter_env && " +
+ "tar -xzf %s -C jupyter_env && " +
+ "source jupyter_env/bin/activate";
Review Comment:
> > However, I think it is a good idea to give a choice to define the path and install the env on workers without getting removed after task execution. In this way, the same env will not need to be downloaded every time.
>
> but I do not think so, I think they can use shell task to do that. It is odd if we do not remove resources after the task execute finish, using two cases:
>
> * we only support not deleting resources after task is done: although the worker has already installed the env, but we still have resource configurated in task definition, So it means worker will re-install the conda env to worker. Or maybe users have to change the task definition and remove the resource after the first time they ran the task.(it is odd)
> * We have given users an option about resources install and delete. then have to change the option after they ran the task first time too.
Alright. This makes sense to me. Since the tasks are usually triggered multiple times, considering persisting the env could be complicated and might cause unexpected issues. If users want to persist the env, it is better to use a shell task and only trigger it once at the very beginning.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] zhongjiajie commented on a diff in pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on code in PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#discussion_r897921423
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterConstants.java:
##########
@@ -33,6 +33,18 @@ private JupyterConstants() {
*/
public static final String CONDA_ACTIVATE = "conda activate";
+ /**
+ * create and activate conda env from tar
+ */
+ public static final String CREATE_ENV_FROM_TAR = "mkdir jupyter_env && " +
+ "tar -xzf %s -C jupyter_env && " +
+ "source jupyter_env/bin/activate";
Review Comment:
yup, that what I mean
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] EricGao888 commented on pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#issuecomment-1146964656
Discussed with @SbloodyS, it seems using `source` may cause security issue. I'm trying to find a workaround to avoid using `source`.

--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] SbloodyS commented on a diff in pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
SbloodyS commented on code in PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#discussion_r893234612
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterConstants.java:
##########
@@ -33,6 +33,18 @@ private JupyterConstants() {
*/
public static final String CONDA_ACTIVATE = "conda activate";
+ /**
+ * create and activate conda env from tar
+ */
+ public static final String CREATE_ENV_FROM_TAR = "mkdir jupyter_env && " +
+ "tar -xzf %s -C jupyter_env && " +
+ "source jupyter_env/bin/activate";
Review Comment:
Is it better to let users to define this path if the user's path is different from this?
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#issuecomment-1159456994
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10337)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=CODE_SMELL) [1 Code Smell](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_coverage&view=list) [88.9% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_duplicated_lines_density&view=list)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] zhongjiajie merged pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
zhongjiajie merged PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#discussion_r893250708
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterConstants.java:
##########
@@ -33,6 +33,18 @@ private JupyterConstants() {
*/
public static final String CONDA_ACTIVATE = "conda activate";
+ /**
+ * create and activate conda env from tar
+ */
+ public static final String CREATE_ENV_FROM_TAR = "mkdir jupyter_env && " +
+ "tar -xzf %s -C jupyter_env && " +
+ "source jupyter_env/bin/activate";
Review Comment:
> It's better. But what i mean is if the user's the compressed tar package path after decompression is inconsistent with this hard code path.
Seems if users use `conda pack` to pack their environment, when they run `tar` they will get the same directory structure.

--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#issuecomment-1155973485
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10337)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=CODE_SMELL) [1 Code Smell](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_coverage&view=list) [88.9% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_duplicated_lines_density&view=list)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] EricGao888 commented on pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#issuecomment-1155974170
Related docs added in the latest commit : )
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] zhongjiajie commented on a diff in pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on code in PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#discussion_r896848633
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterConstants.java:
##########
@@ -33,6 +33,18 @@ private JupyterConstants() {
*/
public static final String CONDA_ACTIVATE = "conda activate";
+ /**
+ * create and activate conda env from tar
+ */
+ public static final String CREATE_ENV_FROM_TAR = "mkdir jupyter_env && " +
+ "tar -xzf %s -C jupyter_env && " +
+ "source jupyter_env/bin/activate";
Review Comment:
> > It's better. But what i mean is if the user's the compressed tar package path after decompression is inconsistent with this hard code path.
>
> Seems if users use `conda pack` to pack their environment, when they run `tar` they will get the same directory structure. 
I test locally, and it is :+1:. but should we add some docs to tell use run `conda pack` to create the conda tarball?
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] zhongjiajie commented on pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#issuecomment-1159364391
> > and we still have discussion in [#10337 (comment)](https://github.com/apache/dolphinscheduler/pull/10337#discussion_r896857846), I wonder whether conda have some command like `import` same as docker's `docker import` to import and then `conda activate`?
>
> I haven't found such things so far. However, using `source` for unpacked conda env seems to be the only way I could find on [Conda-Pack](https://conda.github.io/conda-pack/) official page.
>
> 
Yeah, I can not find either, I think maybe we should use `source` to activate the env template, WDYT @EricGao888 @SbloodyS
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] SbloodyS commented on a diff in pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
SbloodyS commented on code in PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#discussion_r893244768
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterConstants.java:
##########
@@ -33,6 +33,18 @@ private JupyterConstants() {
*/
public static final String CONDA_ACTIVATE = "conda activate";
+ /**
+ * create and activate conda env from tar
+ */
+ public static final String CREATE_ENV_FROM_TAR = "mkdir jupyter_env && " +
+ "tar -xzf %s -C jupyter_env && " +
+ "source jupyter_env/bin/activate";
Review Comment:
It's better. But what i mean is if the user's the compressed tar package path after decompression is inconsistent with this hard code path. If we hard code this. We should put this to the docs.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] SbloodyS commented on a diff in pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
SbloodyS commented on code in PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#discussion_r893244768
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterConstants.java:
##########
@@ -33,6 +33,18 @@ private JupyterConstants() {
*/
public static final String CONDA_ACTIVATE = "conda activate";
+ /**
+ * create and activate conda env from tar
+ */
+ public static final String CREATE_ENV_FROM_TAR = "mkdir jupyter_env && " +
+ "tar -xzf %s -C jupyter_env && " +
+ "source jupyter_env/bin/activate";
Review Comment:
It's better. But what i mean is if the user's the compressed tar package path after decompression is inconsistent with this hard code path.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] SbloodyS commented on a diff in pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
SbloodyS commented on code in PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#discussion_r893253263
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterConstants.java:
##########
@@ -33,6 +33,18 @@ private JupyterConstants() {
*/
public static final String CONDA_ACTIVATE = "conda activate";
+ /**
+ * create and activate conda env from tar
+ */
+ public static final String CREATE_ENV_FROM_TAR = "mkdir jupyter_env && " +
+ "tar -xzf %s -C jupyter_env && " +
+ "source jupyter_env/bin/activate";
Review Comment:
I'm not quite sure about it. Could you take a look? @zhongjiajie
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#issuecomment-1149872772
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10337)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=CODE_SMELL) [1 Code Smell](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10337&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_coverage&view=list) [88.9% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10337&metric=new_duplicated_lines_density&view=list)
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] zhongjiajie commented on a diff in pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on code in PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#discussion_r896861533
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterConstants.java:
##########
@@ -33,6 +33,18 @@ private JupyterConstants() {
*/
public static final String CONDA_ACTIVATE = "conda activate";
+ /**
+ * create and activate conda env from tar
+ */
+ public static final String CREATE_ENV_FROM_TAR = "mkdir jupyter_env && " +
+ "tar -xzf %s -C jupyter_env && " +
+ "source jupyter_env/bin/activate";
Review Comment:
> However, I think it is a good idea to give a choice to define the path and install the env on workers without getting removed after task execution. In this way, the same env will not need to be downloaded every time.
but I do not think so, I think they can use shell task to do that. It is odd if we do not remove resources after the task execute finish, using two cases:
* we only support not deleting resources after task is done: although the worker has already installed the env, but we still have resource configurated in task definition, So it means worker will re-install the conda env to worker. Or maybe users have to change the task definition and remove the resource after the first time they ran the task.(it is odd)
* We have given users an option about resources install and delete. then have to change the option after they ran the task first time too.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] codecov-commenter commented on pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#issuecomment-1155970045
# [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/10337?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#10337](https://codecov.io/gh/apache/dolphinscheduler/pull/10337?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a5ece00) into [dev](https://codecov.io/gh/apache/dolphinscheduler/commit/b655aa9b1fa4292042fad46835752f8403733634?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b655aa9) will **increase** coverage by `0.00%`.
> The diff coverage is `88.88%`.
```diff
@@ Coverage Diff @@
## dev #10337 +/- ##
=========================================
Coverage 40.59% 40.60%
- Complexity 4778 4780 +2
=========================================
Files 878 878
Lines 35747 35754 +7
Branches 3970 3971 +1
=========================================
+ Hits 14513 14517 +4
- Misses 19786 19788 +2
- Partials 1448 1449 +1
```
| [Impacted Files](https://codecov.io/gh/apache/dolphinscheduler/pull/10337?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...cheduler/plugin/task/jupyter/JupyterConstants.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10337/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci10YXNrLXBsdWdpbi9kb2xwaGluc2NoZWR1bGVyLXRhc2stanVweXRlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZG9scGhpbnNjaGVkdWxlci9wbHVnaW4vdGFzay9qdXB5dGVyL0p1cHl0ZXJDb25zdGFudHMuamF2YQ==) | `0.00% <ø> (ø)` | |
| [...heduler/plugin/task/jupyter/JupyterParameters.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10337/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci10YXNrLXBsdWdpbi9kb2xwaGluc2NoZWR1bGVyLXRhc2stanVweXRlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZG9scGhpbnNjaGVkdWxlci9wbHVnaW4vdGFzay9qdXB5dGVyL0p1cHl0ZXJQYXJhbWV0ZXJzLmphdmE=) | `91.17% <75.00%> (-2.16%)` | :arrow_down: |
| [...phinscheduler/plugin/task/jupyter/JupyterTask.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10337/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci10YXNrLXBsdWdpbi9kb2xwaGluc2NoZWR1bGVyLXRhc2stanVweXRlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZG9scGhpbnNjaGVkdWxlci9wbHVnaW4vdGFzay9qdXB5dGVyL0p1cHl0ZXJUYXNrLmphdmE=) | `66.66% <100.00%> (+1.19%)` | :arrow_up: |
| [...er/master/dispatch/host/assign/RandomSelector.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10337/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1tYXN0ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9kaXNwYXRjaC9ob3N0L2Fzc2lnbi9SYW5kb21TZWxlY3Rvci5qYXZh) | `77.77% <0.00%> (-5.56%)` | :arrow_down: |
| [...r/plugin/task/sqoop/parameter/SqoopParameters.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10337/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci10YXNrLXBsdWdpbi9kb2xwaGluc2NoZWR1bGVyLXRhc2stc3Fvb3Avc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcGx1Z2luL3Rhc2svc3Fvb3AvcGFyYW1ldGVyL1Nxb29wUGFyYW1ldGVycy5qYXZh) | `53.33% <0.00%> (-1.34%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/10337?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/10337?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [b655aa9...a5ece00](https://codecov.io/gh/apache/dolphinscheduler/pull/10337?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] EricGao888 commented on pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#issuecomment-1156422944
> and we still have discussion in [#10337 (comment)](https://github.com/apache/dolphinscheduler/pull/10337#discussion_r896857846), I wonder whether conda have some command like `import` same as docker's `docker import` to import and then `conda activate`?
I haven't found such things so far. However, using `source` for unpacked conda env seems to be the only way I could find on [Conda-Pack](https://conda.github.io/conda-pack/) official page.

--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] EricGao888 commented on pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#issuecomment-1159365199
> > > and we still have discussion in [#10337 (comment)](https://github.com/apache/dolphinscheduler/pull/10337#discussion_r896857846), I wonder whether conda have some command like `import` same as docker's `docker import` to import and then `conda activate`?
> >
> >
> > I haven't found such things so far. However, using `source` for unpacked conda env seems to be the only way I could find on [Conda-Pack](https://conda.github.io/conda-pack/) official page.
> > 
>
> Yeah, I can not find either, I think maybe we should use `source` to activate the env template, WDYT @EricGao888 @SbloodyS
Yes, IMHO, there is no perfect solution here to avoid using `source` while providing good user experience at the same time. This is a trade-off. I think we could give user this option but add some notice about `source` command in docs. If they have concerns about it, they could choose not to use it.
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] zhongjiajie commented on pull request #10337: [Feature][Task Plugin]Enable users to switch and install conda env in jupyter task
Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on PR #10337:
URL: https://github.com/apache/dolphinscheduler/pull/10337#issuecomment-1159367099
SGTM, So please add some docs to hint users about the`source` command
--
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: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org