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

Add version option to spark_service. #1214

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions perfkitbenchmarker/configs/benchmark_config_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ def _GetOptionDecoderConstructions(cls):
'default': spark_service.PROVIDER_MANAGED,
'valid_values': [spark_service.PROVIDER_MANAGED,
spark_service.PKB_MANAGED]}),
'version': (option_decoders.EnumDecoder, {
'default': spark_service.SPARK_1_6_2,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spark runner upgraded to 1.6.3 - though it really shouldn't matter much, and would be compatible.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And now I notice that this is a bit more general, and not Beam specific... anyway - 1.6.3 was released.

'valid_values': spark_service.SPARK_VERSIONS}),
'worker_group': (_VmGroupSpecDecoder, {}),
'master_group': (_VmGroupSpecDecoder,
{'default': None,
Expand Down
1 change: 1 addition & 0 deletions perfkitbenchmarker/linux_benchmarks/spark_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
description: Run a jar on a spark cluster.
spark_service:
service_type: managed
version: 1.6.2
worker_group:
vm_spec:
GCP:
Expand Down
14 changes: 12 additions & 2 deletions perfkitbenchmarker/providers/aws/aws_emr.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
FLAGS = flags.FLAGS

DEFAULT_MACHINE_TYPE = 'm3.xlarge'
RELEASE_LABEL = 'emr-4.5.0'
READY_CHECK_SLEEP = 30
READY_CHECK_TRIES = 60
READY_STATE = 'WAITING'
Expand All @@ -47,6 +46,12 @@
# Certain machine types require a subnet.
NEEDS_SUBNET = ['m4', 'c4']

EMR_VERSION_MAP = {
spark_service.SPARK_1_6_1: 'emr-4.8.0',
spark_service.SPARK_1_6_2: 'emr-4.8.2',
spark_service.SPARK_2_0_2: 'emr-5.2.0',
}


class AwsSecurityGroup(resource.BaseResource):
"""Object representing a AWS Security Group.
Expand Down Expand Up @@ -157,9 +162,14 @@ def _Create(self):
instance_properties.update({'EbsConfiguration': ebs_configuration})
instance_groups.append(instance_properties)

# Set version from spec.
if self.spec.version is None or EMR_VERSION_MAP[self.spec.version] is None:
raise Exception('Spark version not provided or not supported on EMR.')
emr_version = EMR_VERSION_MAP[self.spec.version]

# we need to store the cluster id.
cmd = self.cmd_prefix + ['emr', 'create-cluster', '--name', name,
'--release-label', RELEASE_LABEL,
'--release-label', emr_version,
'--use-default-roles',
'--instance-groups',
json.dumps(instance_groups),
Expand Down
11 changes: 11 additions & 0 deletions perfkitbenchmarker/providers/gcp/gcp_dataproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@

GCP_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'

DATAPROC_VERSION_MAP = {
spark_service.SPARK_1_6_1: None,
spark_service.SPARK_1_6_2: '1.0',
spark_service.SPARK_2_0_2: '1.1',
}


class GcpDataproc(spark_service.BaseSparkService):
"""Object representing a GCP Dataproc cluster.
Expand Down Expand Up @@ -94,6 +100,11 @@ def _Create(self):
disk_flag = group_type + '-boot-disk-size'
cmd.flags[disk_flag] = group_spec.vm_spec.boot_disk_size

if self.spec.version is not None:
if DATAPROC_VERSION_MAP[self.spec.version] is None:
raise Exception('Spark version specified not supported on Dataproc.')
cmd.flags['image-version'] = DATAPROC_VERSION_MAP[self.spec.version]

cmd.Issue()

def _Delete(self):
Expand Down
6 changes: 6 additions & 0 deletions perfkitbenchmarker/spark_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
PKB_MANAGED = 'pkb_managed'
PROVIDER_MANAGED = 'managed'

# Spark version options.
SPARK_1_6_1 = '1.6.1'
SPARK_1_6_2 = '1.6.2'
SPARK_2_0_2 = '2.0.2'
SPARK_VERSIONS = [SPARK_1_6_1, SPARK_1_6_2, SPARK_2_0_2]

SUCCESS = 'success'
RUNTIME = 'running_time'
WAITING = 'pending_time'
Expand Down