Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to use Dataflow Flexible Resource Scheduling to save on Cloud cost #662

Open
mbookman opened this issue Sep 9, 2020 · 0 comments

Comments

@mbookman
Copy link
Contributor

mbookman commented Sep 9, 2020

For loading VCF data into BigQuery, Variant Transforms uses Cloud Dataflow. Dataflow now provides a flag which can be passed that brings down the cost of using Dataflow and has been demonstrated to work well for Variant Transforms.

Details about Flexible Resource Scheduling (FlexRS) can be found here:

https://cloud.google.com/dataflow/docs/guides/flexrs

Note that users will likely want to read through the doc carefully to understand how it works, whether they'll need to update any Quotas, and overall what to expect (including the likelihood that job start will be delayed).

At a high level:

FlexRS reduces batch processing costs by using advanced scheduling techniques, the Dataflow Shuffle service, and currently a combination of preemptible virtual machine (VM) instances and regular VMs.

and can be used with Variant Transforms by updating your COMMAND from:

COMMAND="vcf_to_bq \
  --input_pattern ${INPUT_PATTERN} \
  --output_table ${OUTPUT_TABLE} \
  --job_name vcf-to-bigquery \
  --runner DataflowRunner"

to:

COMMAND="vcf_to_bq \
  --input_pattern ${INPUT_PATTERN} \
  --output_table ${OUTPUT_TABLE} \
  --job_name vcf-to-bigquery \
  --flexrs_goal=COST_OPTIMIZED \
  --runner DataflowRunner"

We used this successfully for loading variants for over 9,000 WGS samples that were joint genotyped. For these particular tests, the cost dropped by about half. A few important things to note:

The fix for #658 wasn't strictly necessary, but the use of COST_OPTIMIZED introduces a delay to starting the (unnecessary) merge_headers Dataflow. On a few occasions, this added a couple of hours to the overall time to run vcf_to_bq.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant