You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oozie.apache.org by "Roey Shem Tov (JIRA)" <ji...@apache.org> on 2018/08/09 16:09:00 UTC

[jira] [Updated] (OOZIE-3320) Oozie ShellAction should support absolute bash file path

     [ https://issues.apache.org/jira/browse/OOZIE-3320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roey Shem Tov updated OOZIE-3320:
---------------------------------
    Attachment: OOZIE-3320.patch

> 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
>            Assignee: Roey Shem Tov
>            Priority: Major
>              Labels: patch
>         Attachments: OOZIE-3086.patch, OOZIE-3320.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)