Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
move spark runtime options to luigi config
Browse files Browse the repository at this point in the history
  • Loading branch information
rao-abdul-mannan committed Feb 21, 2018
1 parent f65be75 commit cc759f3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
6 changes: 6 additions & 0 deletions config/devstack.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,9 @@ api_root_url = http://localhost:8000/api/courses/v1/courses/

[course-blocks]
api_root_url = http://localhost:8000/api/courses/v1/blocks/

[spark]
driver-memory=3g
executor-memory=3g
executor-cores=1
num-executors=1
22 changes: 20 additions & 2 deletions edx/analytics/tasks/common/spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,26 @@ class SparkJobTask(OverwriteOutputMixin, PySparkTask):
_hive_context = None
_tmp_dir = None

driver_memory = '2g'
executor_memory = '3g'
driver_memory = luigi.Parameter(
config_path={'section': 'spark', 'name': 'driver-memory'},
description='Memory for spark driver',
significant=False,
)
executor_memory = luigi.Parameter(
config_path={'section': 'spark', 'name': 'executor-memory'},
description='Memory for each executor',
significant=False,
)
executor_cores = luigi.Parameter(
config_path={'section': 'spark', 'name': 'executor-cores'},
description='No. of cores for each executor',
significant=False,
)
num_executors = luigi.Parameter(
config_path={'section': 'spark', 'name': 'num-executors'},
description='Total no. of executors for a job',
significant=False,
)
always_log_stderr = False # log stderr if spark fails, True for verbose log

def init_spark(self, sc):
Expand Down

0 comments on commit cc759f3

Please sign in to comment.