INNER CODE UNIT · Python

start_cluster

aehrc/VariantSpark · cloud/aws-emr/python/vs_emr/cli.py:258

def start_cluster(aws_ctx, conf, profile, cluster_id_file, config_file, master_on_demand, worker_on_demand,  **kwargs):
    
    aws_ctx.debug("kwargs: %s" % kwargs)
    def options_to_conf():        
        return functools.reduce(dict_put, ((MAP_OPTIONS_TO_CONFIG[k], v) for k,v in  kwargs.items() if v is not None), dict())
    
    configuration  = aws_ctx.load_config(config_file)
    if profile:
        aws_ctx.echo("Using profiles: %s" % list(profile))
    config = configuration.resolve_config(profile,options_to_conf(), conf)
    # manual overrides for on  demant prices
    if master_on_demand:
        dict_put_path(config,'master.bidPrice', None)
    if worker_on_demand:
        dict_put_path(config, 'worker.bidPrice', None)        
    cmd_options = resolve_to_cmd_options(aws_ctx, resource_filename(__name__, os.path.join('templates','spot-cluster.yaml')), config)
    cmd = " ".join(['aws', 'emr', 'create-cluster'] + cmd_options)
    output = aws_ctx.aws_run(cmd)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…