コード例 #1
0
def standalone_launch_instances(number, max_idle_time,
                                idle_terminate_granularity):
    config = pywren.wrenconfig.default()
    sc = config['standalone']
    aws_region = config['account']['aws_region']

    if max_idle_time is not None:
        sc['max_idle_time'] = max_idle_time
    if idle_terminate_granularity is not None:
        sc['idle_terminate_granularity'] = idle_terminate_granularity

    inst_list = ec2standalone.launch_instances(
        number,
        sc['target_ami'],
        aws_region,
        sc['ec2_ssh_key'],
        sc['ec2_instance_type'],
        sc['instance_name'],
        sc['instance_profile_name'],
        sc['sqs_queue_name'],
        sc['max_idle_time'],
        idle_terminate_granularity=sc['idle_terminate_granularity'])

    print "launched:"
    ec2standalone.prettyprint_instances(inst_list)
コード例 #2
0
ファイル: pywrencli.py プロジェクト: sean-smith/pywren
def standalone_launch_instances(ctx, number, max_idle_time,
                                idle_terminate_granularity, pywren_git_branch,
                                pywren_git_commit):
    config_filename = ctx.obj['config_filename']
    config = pywren.wrenconfig.load(config_filename)

    sc = config['standalone']
    aws_region = config['account']['aws_region']

    if max_idle_time is not None:
        sc['max_idle_time'] = max_idle_time
    if idle_terminate_granularity is not None:
        sc['idle_terminate_granularity'] = idle_terminate_granularity

    inst_list = ec2standalone.launch_instances(
        number,
        sc['target_ami'],
        aws_region,
        sc['ec2_ssh_key'],
        sc['ec2_instance_type'],
        sc['instance_name'],
        sc['instance_profile_name'],
        sc['sqs_queue_name'],
        sc['max_idle_time'],
        idle_terminate_granularity=sc['idle_terminate_granularity'],
        pywren_git_branch=pywren_git_branch,
        pywren_git_commit=pywren_git_commit)

    print("launched:")
    ec2standalone.prettyprint_instances(inst_list)
コード例 #3
0
ファイル: pywrencli.py プロジェクト: zhangjyr/pywren
def standalone_launch_instances(ctx, number, max_idle_time, parallelism,
                                idle_terminate_granularity, pywren_git_branch,
                                pywren_git_commit, spot_price, instance_type):
    config_filename = ctx.obj['config_filename']
    config = pywren.wrenconfig.load(config_filename)

    sc = config['standalone']
    aws_region = config['account']['aws_region']

    if max_idle_time is not None:
        sc['max_idle_time'] = max_idle_time
    if idle_terminate_granularity is not None:
        sc['idle_terminate_granularity'] = idle_terminate_granularity
    if instance_type is not None:
        sc['instance_type'] = instance_type

    use_fast_io = sc.get("fast_io", False)

    availability_zone = sc.get("availability_zone", None)

    inst_list = ec2standalone.launch_instances(number,
                                               sc['target_ami'], aws_region,
                                               sc['ec2_ssh_key'],
                                               sc['ec2_instance_type'],
                                               sc['instance_name'],
                                               sc['instance_profile_name'],
                                               sc['sqs_queue_name'],
                                               max_idle_time=sc['max_idle_time'],
                                               idle_terminate_granularity=\
                                               sc['idle_terminate_granularity'],
                                               pywren_git_branch=pywren_git_branch,
                                               pywren_git_commit=pywren_git_commit,
                                               availability_zone=availability_zone,
                                               fast_io=use_fast_io,
                                               parallelism=parallelism,
                                               spot_price=spot_price)

    print("launched:")
    ec2standalone.prettyprint_instances(inst_list)