Yelp / pyleus

Pyleus is a Python framework for developing and launching Storm topologies.
Apache License 2.0
404 stars 113 forks source link

Cannot build on OSX when submitting to Ubuntu cluster #129

Open emaadmanzoor opened 9 years ago

emaadmanzoor commented 9 years ago

I am building the provided exclamation topology on OSX (Python 2.7.9) and submitting it to a cluster running Ubuntu (Python 2.7.6).

I get the following error in Storm's logs:

java.lang.RuntimeException: Error when launching multilang subprocess bash: pyleus_venv/bin/python: cannot execute binary file: Exec format error

I think this is related to #110.

I extracted the pyleus_venv directory from the topology JAR, copied it to a cluster machine and tried running pyleus_venv/bin/python; it causes the same error.

I guess I need to be careful with where I build the topology. It would be nice if the documentation included a warning to this effect.

emaadmanzoor commented 9 years ago

For completeness sake, here is the output of file on the OSX and Ubuntu python executables:

poros commented 9 years ago

I'm sorry you have been unlucky enough to experience #110, but could you be a bit more precise? What kind of alert should be added to the documentation?

mzbyszynski commented 9 years ago

I've never done a mac -> ubuntu deployment, but I have had trouble whenever there was a difference between the python version that my pyleus jar was built with vs. the python version the storm cluster is using. Maybe the documentation should specify that you need to compile your jar using the same python version you are going to deploy to?

emaadmanzoor commented 9 years ago

I am not sure what exactly causes the problem (Python versions, OS specifics, etc.), but I can look into it if it will help.

I think mentioning that the Python versions need to be the same is a good idea, but would OSX->Ubuntu really work if Python versions were the same? Let me try using the same Python version on OSX. TODO

If cross-platform deployments do happen often, I guess a good place to add a "warning" (like the Python 3 incompatibility warning in the docs) would be near the first time pyleus submit is mentioned.

poros commented 9 years ago

Cool, we can definitely do that. Let me know about yours OSX->Ubuntu experiment. Cross-platform development is a pretty unusual scenario for me, but it might be not the case for other users.

hellp commented 9 years ago

I even ran into problems running a topology built on Ubuntu on Debian. Even if the very simple exclamation topology would (somehow) run OSX->Ubuntu, I guess as soon as you start using python packages that use C extensions you'd be out of luck doing it cross platform. You'd need two systems that are very much alike regarding installed libraries etc.

I'm using one of our machines as a build machine and deploy from there to the other (pretty much identical) Storm nodes.

poros commented 9 years ago

Good point, I forgot about C extensions. Ok, I'm going to add a warning in the library in case of cross-platform development.

alialshehab commented 8 years ago

Hi, Have this issue been resolved? I am having a similar issue to the one listed in this thread. This happens by simply trying to run the exclamation_topology example on git.

On my machine I am using: OSX version 10.10.5 pyleus 0.3.0 storm 0.9.5 Python 2.7.10

And on my clusters I have: Ubuntu-14.04 Python 2.7.6 storm 0.9.5

Below is the error output I get on my Storm UI:

java.lang.RuntimeException: Error when launching multilang subprocess bash: pyleus_venv/bin/python: cannot execute binary file: Exec format error at backtype.storm.utils.ShellProcess.launch(ShellProcess.java:66) at backtype.storm.spout.ShellSpout.open(ShellSpout.java:74) at backtype.storm.daemon.executor$fn6579$fn6594.invoke(executor.clj:522) at backtype.storm.util$async_loop$fn__459.invoke(util.clj:461) at clojure.lang.AFn.run(AFn.java:24) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: Stream closed at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:434) at java.io.OutputStream.write(OutputStream.java:116) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) at java.io.DataOutputStream.flush(DataOutputStream.java:123) at com.yelp.pyleus.serializer.MessagePackSerializer.writeMessage(MessagePackSerializer.java:215) at com.yelp.pyleus.serializer.MessagePackSerializer.connect(MessagePackSerializer.java:65) at backtype.storm.utils.ShellProcess.launch(ShellProcess.java:64) ... 5 more

westover commented 8 years ago

Maybe a good use of docker? I have been experimenting with using Docker to do this. But have issues getting the storm binary to behave