remainder = 0 else: LOG.info('Using modulus {0} - remainder {1}'.format( args['mod'][0], args['mod'][1])) modulus = int(args['mod'][0]) remainder = int(args['mod'][1]) LOG.info('module = {0}, remainder = {1}'.format(modulus, remainder)) if args['option'] == 'boinc': # We're running from the BOINC server process_boinc(modulus, remainder) else: # We're running from a specially created AMI log_name = 'archive_task_{0}'.format(remainder) LOG.info('Attempting to create socket handler...') add_special_handler_to_root(LOGGER_SERVER_ADDRESS, LOGGER_SERVER_PORT, log_name) LOG.info('Socket handler created, logs should appear on logging server') LOG.info('Logging server host: {0}'.format(LOGGER_SERVER_ADDRESS)) LOG.info('Logging server port: {0}'.format(str(LOGGER_SERVER_PORT))) LOG.info('About to perform sanity checks') if pass_sanity_checks(): process_ami(modulus, remainder) else: LOG.error('Failed to pass sanity tests') LOG.info('All done')
from config import LOGGER_SERVER_ADDRESS, LOGGER_SERVER_PORT LOG = config_logger(__name__) parser = argparse.ArgumentParser('Build the intermediary images to show how the work is progressing') parser.add_argument('option', choices=['boinc', 'ami'], help='are we running on the BOINC server or the AMI server') args = vars(parser.parse_args()) if args['option'] == 'boinc': LOG.info('PYTHONPATH = {0}'.format(sys.path)) # We're running from the BOINC server build_png_image_boinc() else: # We're running from a specially created AMI LOG.info('Attempting to create socket handler...') add_special_handler_to_root(LOGGER_SERVER_ADDRESS, LOGGER_SERVER_PORT, 'build_png_image_AMI') LOG.info('Socket handler created, logs should appear on logging server') LOG.info('Logging server host: {0}'.format(LOGGER_SERVER_ADDRESS)) LOG.info('Logging server port: {0}'.format(str(LOGGER_SERVER_PORT))) LOG.info('PYTHONPATH = {0}'.format(sys.path)) LOG.info('About to perform sanity checks') if pass_sanity_checks(): build_png_image_ami() else: LOG.error('Failed to pass sanity tests') LOG.info('All done.')
# Used to show we have no modulus modulus = None remainder = 0 else: LOG.info('Using modulus {0} - remainder {1}'.format(args['mod'][0], args['mod'][1])) modulus = int(args['mod'][0]) remainder = int(args['mod'][1]) LOG.info('module = {0}, remainder = {1}'.format(modulus, remainder)) if args['option'] == 'boinc': # We're running from the BOINC server process_boinc(modulus, remainder) else: # We're running from a specially created AMI log_name = 'archive_task_{0}'.format(remainder) LOG.info('Attempting to create socket handler...') add_special_handler_to_root(LOGGER_SERVER_ADDRESS, LOGGER_SERVER_PORT, log_name) LOG.info('Socket handler created, logs should appear on logging server') LOG.info('Logging server host: {0}'.format(LOGGER_SERVER_ADDRESS)) LOG.info('Logging server port: {0}'.format(str(LOGGER_SERVER_PORT))) LOG.info('About to perform sanity checks') if pass_sanity_checks(): process_ami(modulus, remainder) else: LOG.error('Failed to pass sanity tests') LOG.info('All done')