Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions quests/dataflow_python/1_Basic_ETL/lab/my_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def run():
parser.add_argument('--stagingLocation', required=True, help='Specify Cloud Storage bucket for staging')
parser.add_argument('--tempLocation', required=True, help='Specify Cloud Storage bucket for temp')
parser.add_argument('--runner', required=True, help='Specify Apache Beam Runner')
parser.add_argument('--machine_type', required=False, help='Specify machine type')

opts = parser.parse_args()

Expand All @@ -26,6 +27,7 @@ def run():
options.view_as(GoogleCloudOptions).temp_location = opts.tempLocation
options.view_as(GoogleCloudOptions).job_name = '{0}{1}'.format('my-pipeline-',time.time_ns())
options.view_as(StandardOptions).runner = opts.runner
options.view_as(WorkerOptions).machine_type = opts.machine_type

# TODO: Add static input and output strings

Expand Down
3 changes: 3 additions & 0 deletions quests/dataflow_python/1_Basic_ETL/solution/my_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from apache_beam.options.pipeline_options import PipelineOptions
from apache_beam.options.pipeline_options import StandardOptions
from apache_beam.runners import DataflowRunner, DirectRunner
from apache_beam.options.pipeline_options import WorkerOptions

# ### main

Expand All @@ -18,6 +19,7 @@ def run():
parser.add_argument('--stagingLocation', required=True, help='Specify Cloud Storage bucket for staging')
parser.add_argument('--tempLocation', required=True, help='Specify Cloud Storage bucket for temp')
parser.add_argument('--runner', required=True, help='Specify Apache Beam Runner')
parser.add_argument('--machine_type', required=False, help='Specify machine type')

opts = parser.parse_args()

Expand All @@ -29,6 +31,7 @@ def run():
options.view_as(GoogleCloudOptions).temp_location = opts.tempLocation
options.view_as(GoogleCloudOptions).job_name = '{0}{1}'.format('my-pipeline-',time.time_ns())
options.view_as(StandardOptions).runner = opts.runner
options.view_as(WorkerOptions).machine_type = opts.machine_type

# Static input and output
input = 'gs://{0}/events.json'.format(opts.project)
Expand Down