Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-3299

Thrift ShellComponent should support multiple arguments

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: storm-client, storm-core
    • Labels:
      None

      Description

      As this comment in storm.thrift from 7 years ago says, `ShellComponent` should support multiple arguments. Currently it supports only `execution_command` and `script`.

       

      I am trying to make streamparse support self-contained JARs (where the virtualenv is packaged up inside the JAR so we don't need SSH access to the workers), but I am hitting a wall because of the combination of this issue and STORM-152. I can make an executable that contains the virtualenv using the Python shiv package, but when it gets packaged up in the JAR, it loses its executable bit, so I can't use it as `execution_command`. Therefore, I wanted to make a little shell script that runs first that fixes the executable bit, and then calls the shiv file with the Python module it needs to launch. That would require me to be able to pass the Python module to the wrapper script, but I cannot because I can only specify `bash` as `execution_command` and `my_wrapper_script.sh` as `script`. If I try to make `script` longer (like `my_wrapper_script.sh -arg1 -arg2`), `bash` complains that `my_wrapper_script.sh -arg1 -arg2` doesn't exist, because it's all sent as a single argument.

       

      An alternative (but less desirable) fix that I could also work with would be if there were some environment variables set when the commands were launched that told you what component was being launched, and other basic context information. I could probably figure out the module to launch from there.

       

      Still another alternative would be to add environment variables to the Thrift `ShellComponent` definition so we could pass arbitrary ones.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dan.blanchard Dan Blanchard
            • Votes:
              4 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: