2017-07-27 52 views
1

我想知道是否有可能在Google Dataflow中运行自定义Apache Beam Python版本。公共存储库中尚未提供的版本(截至撰写本文时为0.6.0和2.0.0)。例如,来自Apache Beam官方存储库的HEAD版本,或者针对该问题的特定标签。Dataflow中的自定义Apache Beam Python版本

我知道如官方documentation中所述包装定制包(例如私人本地包)的可能性。这里有回答questions在这里如何做一些其他脚本。甚至有一个GIST guiding就此。

但是我还没有设法获得当前的Apache Beam开发版本(或标记的版本),该版本可在其官方存储库的主分支中获得,以便打包并沿着我的脚本发送到Google Dataflow。 例如,对于最新的可用标签,它的链接,画中画过程将是:git+https://github.com/apache/[email protected]#egg=apache_beam[gcp]&subdirectory=sdks/python我得到这样的:

INFO:root:Executing command: ['.../bin/python', '-m', 'pip', 'install', '--download', '/var/folders/nw/m_035l9d7f1dvdbd7rr271tcqkj80c/T/tmpJhCkp8', 'apache-beam==2.1.0', '--no-binary', ':all:', '--no-deps'] 
DEPRECATION: pip install --download has been deprecated and will be removed in the future. Pip now has a download command that should be used instead. 
Collecting apache-beam==2.1.0 
    Could not find a version that satisfies the requirement apache-beam==2.1.0 (from versions: 0.6.0, 2.0.0) 
No matching distribution found for apache-beam==2.1.0 

任何想法? (我想知道是否可能,因为Google Dataflow可能已经修复了可以运行到官方发布版本的Apache Beam版本)。

回答

2

我会回答自己,因为我在一个Apache Beam的JIRA中得到了这个问题的答案,我一直在帮忙。

如果你想使用谷歌云数据流(自定义的Apache梁Python版本是,运行与--runner DataflowRunner您的管道,你必须在你运行你的管道使用的选项--sdk_location <apache_beam_v1.2.3.tar.gz>;其中<apache_beam_v1.2.3.tar.gz>是相应的位置包装要使用的版本。

例如,在写这篇文章的,如果你已经签出了HEAD版本的Apache Beam的混帐repository的,你通过导航到了Python SDK与cd beam/sdks/python必须先包库然后运行python setup.py sdist(将在dist子目录中创建压缩的tar文件)。

此后,你可以这样运行了您的管道:

python your_pipeline.py [...your_options...] --sdk_location beam/sdks/python/dist/apache-beam-2.2.0.dev0.tar.gz 

谷歌云数据流将使用所提供的SDK。