Skip to content

Commit 63566e8

Browse files
committed
feat: parametrise master_disk_size in create_cluster
1 parent 00297f2 commit 63566e8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/airflow/dags/common_airflow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def create_cluster(
6666
num_workers: int = 2,
6767
num_local_ssds: int = 1,
6868
autoscaling_policy: str = GCP_AUTOSCALING_POLICY,
69+
master_disk_size: int = 500,
6970
) -> DataprocCreateClusterOperator:
7071
"""Generate an Airflow task to create a Dataproc cluster. Common parameters are reused, and varying parameters can be specified as needed.
7172
@@ -76,6 +77,7 @@ def create_cluster(
7677
num_workers (int): Number of worker nodes. Defaults to 2.
7778
num_local_ssds (int): How many local SSDs to attach to each worker node, both primary and secondary. Defaults to 1.
7879
autoscaling_policy (str): Name of the autoscaling policy to use. Defaults to GCP_AUTOSCALING_POLICY.
80+
master_disk_size (int): Size of the master node's boot disk in GB. Defaults to 500.
7981
8082
Returns:
8183
DataprocCreateClusterOperator: Airflow task to create a Dataproc cluster.
@@ -86,7 +88,7 @@ def create_cluster(
8688
zone=GCP_ZONE,
8789
master_machine_type=master_machine_type,
8890
worker_machine_type=worker_machine_type,
89-
master_disk_size=2000,
91+
master_disk_size=master_disk_size,
9092
worker_disk_size=500,
9193
num_workers=num_workers,
9294
image_version=GCP_DATAPROC_IMAGE,

src/airflow/dags/finngen_preprocess.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@
6363
)
6464

6565
(
66-
common.create_cluster(CLUSTER_NAME, autoscaling_policy=AUTOSCALING)
66+
common.create_cluster(
67+
CLUSTER_NAME, autoscaling_policy=AUTOSCALING, master_disk_size=2000
68+
)
6769
>> common.install_dependencies(CLUSTER_NAME)
6870
>> study_and_sumstats
6971
>> window_based_clumping

0 commit comments

Comments
 (0)