@@ -309,8 +309,8 @@ def __init__(self):
309309 self .spark_configuration = None
310310 self .vm_size = None
311311 self .docker_repo = None
312- self .max_dedicated_nodes = None
313- self .max_low_pri_nodes = None
312+ self .max_dedicated_nodes = 0
313+ self .max_low_pri_nodes = 0
314314 self .spark_defaults_conf = None
315315 self .spark_env_sh = None
316316 self .core_site_xml = None
@@ -327,13 +327,37 @@ def _merge_dict(self, config):
327327 if cluster_configuration :
328328 self .vm_size = cluster_configuration .get ('vm_size' )
329329 self .docker_repo = cluster_configuration .get ('docker_repo' )
330- self .max_dedicated_nodes = cluster_configuration .get ('size' )
331- self .max_low_pri_nodes = cluster_configuration .get ('size_low_pri' )
330+ if cluster_configuration .get ('size' ) is not None :
331+ self .max_dedicated_nodes = cluster_configuration .get ('size' )
332+ if cluster_configuration .get ('size_low_pri' ) is not None :
333+ print ("max_low_pri nodes is None" )
334+ self .max_low_pri_nodes = cluster_configuration .get ('size_low_pri' )
332335 self .custom_scripts = cluster_configuration .get ('custom_scripts' )
333336 self .subnet_id = cluster_configuration .get ('subnet_id' )
334337 self .worker_on_master = cluster_configuration .get ("worker_on_master" )
335338
336- self .applications = config .get ('applications' )
339+ applications = config .get ('applications' )
340+ if applications :
341+ self .applications = []
342+ for application in applications :
343+ self .applications .append (
344+ aztk .spark .models .ApplicationConfiguration (
345+ name = application .get ('name' ),
346+ application = application .get ('application' ),
347+ application_args = application .get ('application_args' ),
348+ main_class = application .get ('main_class' ),
349+ jars = application .get ('jars' ),
350+ py_files = application .get ('py_files' ),
351+ files = application .get ('files' ),
352+ driver_java_options = application .get ('driver_java_options' ),
353+ driver_library_path = application .get ('driver_library_path' ),
354+ driver_class_path = application .get ('driver_class_path' ),
355+ driver_memory = application .get ('driver_memory' ),
356+ executor_memory = application .get ('executor_memory' ),
357+ driver_cores = application .get ('driver_cores' ),
358+ executor_cores = application .get ('executor_cores' )
359+ )
360+ )
337361
338362 spark_configuration = config .get ('spark_configuration' )
339363 if spark_configuration :
@@ -379,14 +403,12 @@ def merge(self, id, job_config_yaml=None):
379403 self .id = id
380404
381405 for entry in self .applications :
382- if entry [ ' name' ] is None :
406+ if entry . name is None :
383407 raise aztk .error .AztkError (
384- "Application specified with no name. Please verify your configuration in job.yaml"
385- )
386- if entry ['application' ] is None :
408+ "Application specified with no name. Please verify your configuration in job.yaml" )
409+ if entry .application is None :
387410 raise aztk .error .AztkError (
388- "No path to application specified for {} in job.yaml" .
389- format (entry ['name' ]))
411+ "No path to application specified for {} in job.yaml" .format (entry .name ))
390412
391413
392414def get_file_if_exists (file ):
0 commit comments