INNER CODE UNIT · Python
options_to_conf
aehrc/VariantSpark · cloud/aws-emr/python/vs_emr/cli.py:261
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)
if not aws_ctx.noop:
if cluster_id_file is not None:
aws_ctx.echo("Saving cluster info to: %s" % cluster_id_file)