Uploaded image for project: 'Oozie'
  1. Oozie
  2. OOZIE-3320

Oozie ShellAction should support absolute bash file path

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 5.0.0, 4.3.1
    • None
    • action
    • Patch

    Description

      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:

      1. Upload it to hdfs, add it as a file and submit script.sh
      2. 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:

      String exec = actionXml.getChild("exec", ns).getTextTrim(); 
      String execName = new Path(exec).getName(); actionConf.set(ShellMain.CONF_OOZIE_SHELL_EXEC, execName);
      

       

      Best option to support shared mount file is to support file:// starting for bash files that are local (or shared by mount), e.g:

      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);
      

       

       

       

      Attachments

        1. OOZIE-3086.patch
          1 kB
          Roey Shem Tov
        2. OOZIE-3320.patch
          3 kB
          Roey Shem Tov

        Issue Links

          Activity

            People

              roeyshemtov24 Roey Shem Tov
              roeyshemtov24 Roey Shem Tov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: