-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Add support for driver pool, instance flexibility policy, and min_num_instances for Dataproc #34172
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
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
42e33bd
to
0e87d7c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple suggestions
7da8f15
to
7c4dc41
Compare
7c4dc41
to
5950352
Compare
5950352
to
b6366f6
Compare
fee1497
to
f2302aa
Compare
@potiuk @SamWheating Can you please review/approve the PR if there are no more concerns ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple comments / suggestions
@@ -84,6 +117,7 @@ class ClusterGenerator: | |||
to create the cluster. (templated) | |||
:param num_workers: The # of workers to spin up. If set to zero will | |||
spin up cluster in a single node mode | |||
:param min_num_workers: The minimum number of primary worker instances to create. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not immediately clear how this value interacts with num_workers
, might be worth elaborating a bit more?
From the API docs:
Example: Cluster creation request with num_instances = 5 and min_num_instances = 3:
If 4 VMs are created and 1 instance fails, the failed VM is deleted. The cluster is resized to 4 instances and placed in a RUNNING state.
If 2 instances are created and 3 instances fail, the cluster in placed in an ERROR state. The failed VMs are not deleted.
Could we add some of that context here? I don't have any strong opinions on the exact wording.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
@@ -344,6 +402,10 @@ def _build_cluster_data(self): | |||
"autoscaling_config": {}, | |||
"endpoint_config": {}, | |||
} | |||
|
|||
if self.min_num_workers: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we raise an Exception at initialization time if min_num_workers > num_workers
?
It's usually best to surface issues as early as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
driver_pool = { | ||
"node_group": { | ||
"roles": ["DRIVER"], | ||
"node_group_config": {"num_instances": self.driver_pool_size}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on allowing instance type here as well? Something like:
"node_group_config": {"num_instances": self.driver_pool_size}, | |
"node_group_config": { | |
"num_instances": self.driver_pool_size | |
"machine_type_uri": self.driver_pool_machine_type | |
}, |
Maybe this is too much config though? I'm fine with leaving this for another day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let keep it these two for now. Later on, we can driver pool config (like InstanceFlexibilityPolicy) to cover rest of the config options.
06cf8f9
to
9c36945
Compare
9c36945
to
fcdd197
Compare
@SamWheating Thank you for review. Can you please trigger the workflow? |
I actually can't trigger the workflow - we'll have to wait for a committer to come along and do the final check + merge. |
@potiuk Can you please help get this merged? |
fcdd197
to
703eff4
Compare
703eff4
to
667843f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
…_instances for Dataproc
667843f
to
47308cf
Compare
@Taragolis Can you please help merge this. |
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
The change in apache#34172 had been merged without rebasing and caused static check failure in main. This PR fixes it.
The change in #34172 had been merged without rebasing and caused static check failure in main. This PR fixes it.
Add following to ClusterGenerator for Dataproc