Ejemplo n.º 1
0
def main():
    parser = argparse.ArgumentParser('Start a number of CLEAN servers')
    parser.add_argument('-a', '--ami_id', help='the AMI id to use')
    parser.add_argument('-i', '--instance_type', required=True, help='the instance type to use')
    parser.add_argument('-c', '--created_by', help='the username to use')
    parser.add_argument('-n', '--name', required=True, help='the instance name to use')
    parser.add_argument('-s', '--spot_price', type=float, help='the spot price to use')
    parser.add_argument('-b', '--bash_script', help='the bash script to use')
    parser.add_argument('-e', '--ebs', type=int, help='the size in GB of any EBS volume')
    parser.add_argument('bottom_frequency', help='The bottom frequency')
    parser.add_argument('frequency_range', help='the range of frequencies')
    parser.add_argument('obs_id', help='the observation id')

    args = vars(parser.parse_args())

    corrected_args = check_args(args)
    if corrected_args is None:
        LOGGER.error('The arguments are incorrect: {0}'.format(args))
    else:
        start_servers(
            corrected_args['ami_id'],
            corrected_args['user_data'],
            corrected_args['setup_disks'],
            args['instance_type'],
            make_safe_filename(args['obs_id']),
            corrected_args['created_by'],
            args['name'],
            corrected_args['instance_details'],
            corrected_args['spot_price'],
            args['ebs'],
            args['bottom_frequency'],
            args['frequency_range'])
Ejemplo n.º 2
0
def main():
    parser = argparse.ArgumentParser('Copy the IMGCONCAT output to the correct place in S3')
    parser.add_argument('cube', help='the cube id')
    args = vars(parser.parse_args())
    cube = make_safe_filename(args['cube'])

    copy_files(cube)
Ejemplo n.º 3
0
def main():
    parser = argparse.ArgumentParser(
        'Copy the IMGCONCAT output to the correct place in S3')
    parser.add_argument('cube', help='the cube id')
    args = vars(parser.parse_args())
    cube = make_safe_filename(args['cube'])

    copy_files(cube)
Ejemplo n.º 4
0
def main():
    parser = argparse.ArgumentParser('Copy the CVEL output to the correct place in S3')
    parser.add_argument('vis_file', help='the visibilites file')
    parser.add_argument('date', help='the date of the observation')
    args = vars(parser.parse_args())
    date = make_safe_filename(args['date'])
    vis_file = args['vis_file']

    copy_files(date, vis_file)
Ejemplo n.º 5
0
def main():
    parser = argparse.ArgumentParser('Copy the CVEL output to the correct place in S3')
    parser.add_argument('vis_file', help='the visibilites file')
    parser.add_argument('date', help='the date of the observation')
    args = vars(parser.parse_args())
    date = make_safe_filename(args['date'])
    vis_file = args['vis_file']

    copy_files(date, vis_file)
Ejemplo n.º 6
0
    def get_volume_name(self, volume_id):
        """
        Get the name of volume (if it has one)
        """
        volume_details = self.ec2_connection.get_all_volumes(volume_id)
        if volume_details and len(volume_details) == 1:
            volume = volume_details[0]
            name = volume.tags['Name']
            if name:
                return make_safe_filename(name)

        return volume_id
Ejemplo n.º 7
0
    def get_volume_name(self, volume_id):
        """
        Get the name of volume (if it has one)
        """
        volume_details = self.ec2_connection.get_all_volumes(volume_id)
        if volume_details and len(volume_details) == 1:
            volume = volume_details[0]
            name = volume.tags['Name']
            if name:
                return make_safe_filename(name)

        return volume_id