首页 > 解决方案 > 我想从 python 脚本创建一个数据流模板

问题描述

我找到了这个脚本,我想从中创建一个数据流模板,但我不知道如何。我也找到了这个命令

python -m examples.mymodule \
    --runner DataflowRunner \
    --project YOUR_PROJECT_ID \
    --staging_location gs://YOUR_BUCKET_NAME/staging \
    --temp_location gs://YOUR_BUCKET_NAME/temp \
    --template_location gs://YOUR_BUCKET_NAME/templates/YOUR_TEMPLATE_NAME

用于创建和暂存模板,但这对我来说真的很困惑。

标签: google-cloud-dataflow

解决方案


首先,您必须准备要用作模板的脚本,为此您可以点击@JayadeepJayaraman [1] 提供的链接。

关于python命令,它将允许您在此参数“ --template_location ”中选择的存储桶中创建和存储模板,“ examples.mymodule ”是指您要创建的package.name_script的路径模板。

[1] https://cloud.google.com/dataflow/docs/guides/templates/creating-templates


推荐阅读