def ConstructDpbService(self): """Create the dpb_service object and create groups for its vms.""" if self.config.dpb_service is None: return dpb_service_spec = self.config.dpb_service dpb_service_cloud = dpb_service_spec.worker_group.cloud dpb_service_spec.worker_group.vm_count = dpb_service_spec.worker_count providers.LoadProvider(dpb_service_cloud) dpb_service_type = dpb_service_spec.service_type dpb_service_class = dpb_service.GetDpbServiceClass(dpb_service_type) self.dpb_service = dpb_service_class(dpb_service_spec) # If the dpb service is un-managed, the provisioning needs to be handed # over to the vm creation module. if dpb_service_type == dpb_service.UNMANAGED_DPB_SVC_YARN_CLUSTER: # Ensure non cluster vms are not present in the spec. if self.vms_to_boot: raise Exception('Invalid Non cluster vm group {0} when benchmarking ' 'unmanaged dpb service'.format(self.vms_to_boot)) base_vm_spec = dpb_service_spec.worker_group base_vm_spec.vm_spec.zone = self.dpb_service.dpb_service_zone if dpb_service_spec.worker_count: self.vms_to_boot['worker_group'] = dpb_service_spec.worker_group # else we have a single node cluster. master_group_spec = copy.copy(base_vm_spec) master_group_spec.vm_count = 1 self.vms_to_boot['master_group'] = master_group_spec
def ConstructDpbService(self): """Create the dpb_service object and create groups for its vms.""" if self.config.dpb_service is None: return providers.LoadProvider(self.config.dpb_service.worker_group.cloud) dpb_service_class = dpb_service.GetDpbServiceClass( self.config.dpb_service.service_type) self.dpb_service = dpb_service_class(self.config.dpb_service)
def CheckPrerequisites(benchmark_config): """Verifies that the required resources are present. Raises: perfkitbenchmarker.data.ResourceNotFound: On missing resource. """ if (FLAGS.dpb_wordcount_input is None and FLAGS.dpb_wordcount_fs != BaseDpbService.GCS_FS): raise errors.Config.InvalidValue('Invalid default input directory.') # Get handle to the dpb service dpb_service_class = dpb_service.GetDpbServiceClass( benchmark_config.dpb_service.service_type) dpb_service_class.CheckPrerequisites(benchmark_config)