Exemple #1
0
def add_manager_parser(subparser, required_named_args,
                       optional_named_args):  # pragma: no cover
    add_cluster_arg(required_named_args, required=True)
    add_pool_arg(required_named_args)
    add_scheduler_arg(required_named_args)
    optional_named_args.add_argument(
        '--target-capacity',
        metavar='X',
        help=
        'New target capacity for the cluster (valid options: min, max, positive integer)',
    )
    optional_named_args.add_argument(
        '--mark-stale',
        action='store_true',
        help=
        ('Mark the resource groups of a cluster as "stale" (ASGs only); these resource groups '
         'will no longer contribute to the pool\'s target capacity.'),
    )
    optional_named_args.add_argument(
        '--dry-run',
        action='store_true',
        help=
        'Just print what would happen, don\'t actually add or remove instances'
    )
    add_cluster_config_directory_arg(optional_named_args)
Exemple #2
0
def add_cluster_disable_parser(subparser, required_named_args, optional_named_args):  # pragma: no cover
    add_cluster_arg(required_named_args, required=True)
    add_pool_arg(required_named_args)
    add_scheduler_arg(required_named_args)
    optional_named_args.add_argument(
        '--until',
        metavar='timestamp',
        help='time at which to re-enable autoscaling (try "tomorrow", "+5m"; use quotes)',
    )
    add_cluster_config_directory_arg(optional_named_args)
Exemple #3
0
 def parse_args(self, parser):
     arg_group = parser.add_argument_group('AutoscalerMonitor options')
     add_cluster_arg(arg_group)
     add_pool_arg(arg_group)
     add_scheduler_arg(arg_group)
     add_env_config_path_arg(arg_group)
     add_cluster_config_directory_arg(arg_group)
     add_branch_or_tag_arg(arg_group)
     arg_group.add_argument(
         '--signal-root-directory',
         default='/code/signals',
         help='location of signal artifacts',
     )
Exemple #4
0
 def parse_args(self, parser):
     arg_group = parser.add_argument_group('AutoscalerBatch options')
     add_cluster_arg(arg_group, required=True)
     add_pool_arg(arg_group)
     add_scheduler_arg(arg_group)
     add_cluster_config_directory_arg(arg_group)
     add_env_config_path_arg(arg_group)
     arg_group.add_argument(
         '--dry-run',
         default=False,
         action='store_true',
         help=
         'If true, will only log autoscaling decisions instead of modifying capacities',
     )
Exemple #5
0
def add_status_parser(subparser, required_named_args, optional_named_args):  # pragma: no cover
    add_cluster_arg(required_named_args, required=True)
    add_pool_arg(required_named_args)
    add_scheduler_arg(required_named_args)

    optional_named_args.add_argument(
        '--only-idle',
        action='store_true',
        help='Only show information about idle agents',
    )
    optional_named_args.add_argument(
        '--only-orphans',
        action='store_true',
        help='Only show information about orphaned instances (instances that are not in the Mesos cluster)',
    )
    optional_named_args.add_argument(
        '-v', '--verbose',
        action='store_true',
        help='Show more detailed status information (implies -v, ignores --only-idle and --only-orphans)',
    )
    add_json_arg(optional_named_args)
    add_cluster_config_directory_arg(optional_named_args)
Exemple #6
0
def add_cluster_enable_parser(subparser, required_named_args,
                              optional_named_args):  # pragma: no cover
    add_cluster_arg(required_named_args, required=True)
    add_pool_arg(required_named_args)
    add_scheduler_arg(required_named_args)
    add_cluster_config_directory_arg(optional_named_args)
Exemple #7
0
def add_simulate_parser(subparser, required_named_args,
                        optional_named_args):  # pragma: no cover
    add_start_end_args(
        required_named_args,
        'simulation start time',
        'simulation end time',
    )
    add_cluster_arg(required_named_args, required=False)
    add_pool_arg(required_named_args)
    add_scheduler_arg(required_named_args)
    add_cluster_config_directory_arg(optional_named_args)
    add_branch_or_tag_arg(optional_named_args)
    required_named_args.add_argument(
        '--name',
        default='simulation',
        help='Name for the simulation (helpful when comparing two simulations)',
    )
    optional_named_args.add_argument(
        '--autoscaler-config',
        default=None,
        help=
        'file containing the spot fleet request JSON data for the autoscaler',
    )
    optional_named_args.add_argument(
        '--reports',
        nargs='+',
        choices=list(REPORT_TYPES.keys()) + ['all'],
        default=[],
        help='type(s) of reports to generate from the simulation',
    )
    optional_named_args.add_argument(
        '--metrics-data-files',
        metavar='filename',
        nargs='+',
        help='provide simulated values for one or more metric time series',
    )
    optional_named_args.add_argument(
        '--cpus-per-weight',
        type=int,
        default=1,
        help='how many CPUs are present in one unit of weight',
    )
    optional_named_args.add_argument(
        '--ebs-volume-size',
        type=int,
        metavar='GB',
        default=0,
        help='size of EBS volume for EBS-only instances')
    optional_named_args.add_argument(
        '--discount',
        metavar='percent',
        type=float,
        default=None,
        help='optional discount to apply to cost calculations',
    )
    optional_named_args.add_argument(
        '--join-delay-params',
        metavar=('mean', 'stdev (seconds)'),
        nargs=2,
        type=int,
        default=[0, 0],
        help=
        'parameters to control long to wait before a host joins the cluster (normally distributed)'
    )
    optional_named_args.add_argument(
        '--output-prefix',
        default='',
        help='filename prefix for generated reports',
    )
    optional_named_args.add_argument(
        '--simulation-result-file',
        metavar='filename',
        help='specify filename to save simulation result for comparison',
    )
    optional_named_args.add_argument(
        '--compare',
        metavar='filename',
        nargs='+',
        help='specify one or two filenames to compare simulation result',
    )
    optional_named_args.add_argument(
        '--comparison-operator',
        choices=['add', 'sub', 'mul', 'truediv'],
        default='truediv',
        help=
        'operation to use for comparing simulations; valid choices are binary functions from the operator module',
    )