Skip to content

Commit b66592f

Browse files
tnazarewclaude
andauthored
spark_dataproc: use n1-standard-4 for the cluster master (#347)
Since one cluster runs all OpenLineage versions, up to 3 scenarios run at the same time and all their drivers run on the master. On n1-standard-2 (7.5 GB) the master ran out of memory now and then: in run 39672836849 the bigquery and bigquery_to_delta drivers were killed with "Driver received SIGTERM/SIGKILL signal and exited with 143 code, which potentially signifies a memory pressure". create-cluster gets a --master-machine-type option (default stays n1-standard-2) and the workflow uses n1-standard-4 (15 GB). Workers are unchanged: 8 instead of 6 vCPU per cluster. Signed-off-by: tnazarew <tomasz.nazarewicz@getindata.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 1ff172d commit b66592f

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎.github/workflows/producer_spark_dataproc.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,15 @@ jobs:
165165
--cluster-name "${{ steps.init.outputs.cluster_name }}" \
166166
--credentials-file ${{ steps.gcp-auth.outputs.credentials_file_path }} \
167167
--metadata "$metadata" \
168+
--master-machine-type n1-standard-4 \
168169
--initialization-actions="${{ steps.upload-initialization-actions.outputs.init_actions }}"
169170
170171
- name: Remove initialization actions from GCS
171172
if: ${{ always() && steps.upload-initialization-actions.outputs.scripts_dir }}
172173
run: gcloud storage rm -r "${{ steps.upload-initialization-actions.outputs.scripts_dir }}" || true
173174

174-
# openlineage versions run one after another, scenarios of a single version run in parallel;
175+
# openlineage versions run one after another, scenarios of a single version run in parallel
176+
# (their drivers all run on the master, which is why it's bigger than the workers);
175177
# failed scenarios don't fail the job, they show up in validation together with their driver logs
176178
- name: Run producer jobs and create OL events
177179
if: ${{ steps.init.outputs.any_scenarios }}

‎producer/spark_dataproc/runner/dataproc_workflow.py‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ async def create_cluster(
211211
metadata: typing.Dict[str, str],
212212
initialization_actions: typing.List[str],
213213
credentials: Credentials,
214+
master_machine_type: str = "n1-standard-2",
214215
) -> None:
215216
"""
216217
Asynchronously creates a Dataproc cluster.
@@ -232,7 +233,7 @@ async def create_cluster(
232233
},
233234
"master_config": {
234235
"num_instances": 1,
235-
"machine_type_uri": "n1-standard-2",
236+
"machine_type_uri": master_machine_type,
236237
"disk_config": {
237238
"boot_disk_type": "pd-standard",
238239
"boot_disk_size_gb": 300,
@@ -607,6 +608,7 @@ async def create_cluster_command(args):
607608
metadata=spark_metadata,
608609
initialization_actions=initialization_actions,
609610
credentials=credentials,
611+
master_machine_type=args.master_machine_type,
610612
)
611613

612614

@@ -766,6 +768,12 @@ def main():
766768
default="",
767769
help="Cluster initialization action scripts gcs locatizations separated by commas",
768770
)
771+
parser_create.add_argument(
772+
"--master-machine-type",
773+
required=False,
774+
default="n1-standard-2",
775+
help="Machine type of the master node, which runs the drivers of all jobs (default: n1-standard-2)",
776+
)
769777
parser_create.set_defaults(func=create_cluster_command)
770778

771779
# Run job command

0 commit comments

Comments
 (0)