[
https://issues.apache.org/jira/browse/OOZIE-3320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16569578#comment-16569578
]
ASF GitHub Bot commented on OOZIE-3320:
---------------------------------------
GitHub user roeyshemtov24 opened a pull request:
https://github.com/apache/oozie/pull/39
[OOZIE-3320] Oozie ShellAction should support absolute bash file path
This code related to
[OOZIE-3320](https://issues.apache.org/jira/browse/OOZIE-3320)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/roeyshemtov24/oozie OOZIE-3320
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/oozie/pull/39.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #39
----
commit 3da77d9705631220c80ecc61cf6f50cf47edb158
Author: Roey Shem Tov <roeyshemtov1@...>
Date: 2018-08-05T20:47:16Z
[OOZIE-3320] Oozie ShellAction should support absolute bash file path
----
> Oozie ShellAction should support absolute bash file path
> --------------------------------------------------------
>
> Key: OOZIE-3320
> URL: https://issues.apache.org/jira/browse/OOZIE-3320
> Project: Oozie
> Issue Type: Improvement
> Components: action
> Affects Versions: 5.0.0, 4.3.1
> Reporter: Roey Shem Tov
> Priority: Major
> Labels: patch
> Attachments: OOZIE-3086.patch
>
>
> bash files that saved on shared mount, cannot be execute by the ShellAction
> in proper way.
> Example:
> Worker-1,Worker-2,Worker-3 have shared mount /mnt/hadoop
> on /mnt/hadoop there is a file script.sh
> Right now there is two options to submit it using ShellAction:
> # Upload it to hdfs, add it as a file and submit script.sh
> # use bash as exec and file location (/mnt/hadoop/script.sh) as argument
> (e.g <exec>bash>/exec><argument>/mnt/hadoop/script.sh</argument>
> Best option is that the <exec> command will support shared mounted file :
> <exec>/mnt/hadoop/script.sh</exec>
>
> This code is taking only the file name instead it full path:
> {code:java}
> String exec = actionXml.getChild("exec", ns).getTextTrim();
> String execName = new Path(exec).getName();
> actionConf.set(ShellMain.CONF_OOZIE_SHELL_EXEC, execName);
> {code}
>
> Best option to support shared mount file is to support file:// starting for
> bash files that are local (or shared by mount), e.g:
> {code:java}
> String exec = actionXml.getChild("exec", ns).getTextTrim(); String execName;
> String localFilePrefix = "file://";
> // When exec starts with 'file://' refer it as local file.
> if (exec.startsWith(localFilePrefix))
> execName = exec.substring(localFilePrefix.length());
> else execName = new Path(exec).getName();
> actionConf.set(ShellMain.CONF_OOZIE_SHELL_EXEC, execName);
> {code}
>
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)