您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

worker_machine_type标记在使用python的Google Cloud Dataflow中无效

5b51 2022/1/14 8:21:37 python 字数 3166 阅读 511 来源 www.jb51.cc/python

我在Python中使用Apache Beam和Google Cloud Dataflow(2.3.0).将worker_machine_type参数指定为例如n1-highmem-2或custom-1-6656,Dataflow运行该作业,但始终为每个工作人员使用标准机器类型n1-standard-1.如果我做错了,有没有人知道?其他主题(here和here

概述

我在Python中使用Apache Beam和Google Cloud Dataflow(2.3.0).将worker_machine_type参数指定为例如n1-highmem-2或custom-1-6656,Dataflow运行该作业,但始终为每个工作人员使用标准机器类型n1-standard-1.

如果我做错了,有没有人知道?

其他主题(herehere)表明这应该是可能的,因此这可能是版本问题.

我的用于指定PipelineOptions的代码(请注意,所有其他选项都可以正常工作,因此它应该识别worker_machine_type参数):

def get_cloud_pipeline_options(project):

  options = {
    'runner': 'DataflowRunner','job_name': ('converter-ml6-{}'.format(
        datetime.Now().strftime('%Y%m%d%H%M%s'))),'staging_location': os.path.join(BUCKET,'staging'),'temp_location': os.path.join(BUCKET,'tmp'),'project': project,'region': 'europe-west1','zone': 'europe-west1-d','autoscaling_algorithm': 'THROUGHPUT_BASED','save_main_session': True,'setup_file': './setup.py','worker_machine_type': 'custom-1-6656','max_num_workers': 3,}

  return beam.pipeline.PipelineOptions(flags=[],**options)

def main(argv=None):
  args = parse_arguments(sys.argv if argv is None else argv)

  pipeline_options = get_cloud_pipeline_options(args.project_id

  pipeline = beam.Pipeline(options=pipeline_options)

>在命令行上传递参数.例如my_pipeline.py –worker_machine_type custom-1-6656
>将参数作为命令行标记传递,例如flags [‘ – worker_machine_type’,’worker_machine_type custom-1-6656′,…]

然而它与** kwargs不兼容.以这种方式传递的任何其他args用于替换已知的参数名称(但不是标志名称).

简而言之,使用machine_type可以在任何地方使用.我提交了https://issues.apache.org/jira/browse/BEAM-4112,以便将来在Beam中修复.

总结

以上是编程之家为你收集整理的worker_machine_type标记在使用python的Google Cloud Dataflow中无效全部内容,希望文章能够帮你解决worker_machine_type标记在使用python的Google Cloud Dataflow中无效所遇到的程序开发问题。


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶