Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated setup.py for newer thrift versions #24

Closed
wants to merge 1 commit into from
Closed

Updated setup.py for newer thrift versions #24

wants to merge 1 commit into from

Conversation

darkseed
Copy link

Hi, I've made a small change which allows Petrel to be compiled against newer versions of the thrift client.

@barrywhart
Copy link
Contributor

A couple of questions about this...

When I was working with Storm last year, I got the impression it required Thrift version 7 -- hence the existence of this project (a Storm-specific fork of Thrift):

https://github.com/nathanmarz/thrift

is it safe to use a newer compiler?

Also, I'm looking at the command-line help for the Thrift compiler version 0.7, the one I am using:

  -o dir      Set the output directory for gen-* packages
               (default: current directory)
  -out dir    Set the ouput location for generated files.
               (no gen-* folder will be created)

The documentation is slightly different for -o and -out -- will they both work okay?

@barrywhart
Copy link
Contributor

I tested this change using Thrift 0.9. Without the change, the word count sample works fine. With the change, the Python/Thrift Storm wrappers are not generated in the expected location when I run "python setup.py develop", resulting in the following errors when I run "buildandrun --config topology.yaml":

(petrel)barry@Dell660s:~/dev/Petrel/samples/wordcount$ ./buildandrun --config topology.yaml 
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/barry/dev/Petrel/petrel/petrel/cmdline.py", line 11, in <module>
    from .package import build_jar
  File "/home/barry/dev/Petrel/petrel/petrel/package.py", line 13, in <module>
    from topologybuilder import TopologyBuilder
  File "/home/barry/dev/Petrel/petrel/petrel/topologybuilder.py", line 6, in <module>
    from petrel.generated.storm.ttypes import ComponentCommon, Grouping, NullStruct, GlobalStreamId
ImportError: No module named generated.storm.ttypes
Error on or near line 24; exiting with status 1

What version of Thrift are you using? Have you tested your change on a clean source download of Petrel? I don't see how it could work.

@barrywhart barrywhart closed this Apr 6, 2013
@barrywhart
Copy link
Contributor

Closed -- code did not work for me and no response from the developer

@w7374520
Copy link

[root@snamenode wordcount]# thrift -version
Thrift version 0.9.0

[root@snamenode wordcount]# ./buildandrun --config topology.yaml
Traceback (most recent call last):
File "/usr/local/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/site-packages/petrel-0.8.2.0.1-py2.7.egg/petrel/cmdline.py", line 11, in
from .package import build_jar
File "/usr/local/lib/python2.7/site-packages/petrel-0.8.2.0.1-py2.7.egg/petrel/package.py", line 13, in
from topologybuilder import TopologyBuilder
File "/usr/local/lib/python2.7/site-packages/petrel-0.8.2.0.1-py2.7.egg/petrel/topologybuilder.py", line 6, in
from petrel.generated.storm.ttypes import ComponentCommon, Grouping, NullStruct, GlobalStreamId
ImportError: No module named generated.storm.ttypes
Error on or near line 24; exiting with status 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants