How do I specify resorceHints when running a Dataflow classic template

Hello all,

We are trying to deploy our dataflow job as a classic template.  The job is Apache Beam Java and when we run the job using maven, we can specify --resourceHints to increase the min_ram (--resourceHints=min_ram=64GB), but I have been unable to figure out how to set this when running the classic template using 'gcloud dataflow jobs run'.
Any help is appreciated.

Thank you!

Solved Solved
0 1 381
1 ACCEPTED SOLUTION

While the gcloud dataflow jobs run command doesn't directly support specifying resourceHints for Classic Templates, you can consider the following options:

Option 1: Hardcode in the Template Creation:

Modify your Java Beam code to include the desired resourceHints during the pipeline construction. This means that the resourceHints will be part of the template itself.

 

PipelineOptions options = PipelineOptionsFactory.create();
// Set the resource hints directly in the options
options.as(DataflowPipelineWorkerPoolOptions.class)
    .setResourceHints(ImmutableMap.of("min_ram", "64GB"));

View solution in original post

1 REPLY 1

While the gcloud dataflow jobs run command doesn't directly support specifying resourceHints for Classic Templates, you can consider the following options:

Option 1: Hardcode in the Template Creation:

Modify your Java Beam code to include the desired resourceHints during the pipeline construction. This means that the resourceHints will be part of the template itself.

 

PipelineOptions options = PipelineOptionsFactory.create();
// Set the resource hints directly in the options
options.as(DataflowPipelineWorkerPoolOptions.class)
    .setResourceHints(ImmutableMap.of("min_ram", "64GB"));