Exemple #1
0
def run_proxy():
    proxy = '/usr/src/app/cadcproxy.pem'
    ec.run_by_file(GemName,
                   APPLICATION,
                   COLLECTION,
                   proxy,
                   meta_visitors,
                   data_visitors,
                   archive=ARCHIVE)
def test_run_by_file():
    try:
        os.getcwd = Mock(return_value=TESTDATA_DIR)
        todo_file = os.path.join(os.getcwd(), 'todo.txt')
        f = open(todo_file, 'w')
        f.write('')
        f.close()
        ec.run_by_file(ec.StorageName, 'collection2caom2', 'collection',
                       proxy=None, meta_visitors=None, data_visitors=None)
    except mc.CadcException as e:
        assert False, 'but the work list is empty {}'.format(e)
Exemple #3
0
def run_query():
    """
    Run the processing for all the entries returned from a time-boxed ad
    query.

    :param sys.argv[1] the timestamp for the > comparison in the time-boxed
        query
    :param sys.argv[2] the timestamp for the <= comparison in the time-boxed
        query

    :return 0 if successful, -1 if there's any sort of failure. Return status
        is used by airflow for task instance management and reporting.
    """
    prev_exec_date = sys.argv[1]
    exec_date = sys.argv[2]

    config = mc.Config()
    config.get()
    config.stream = 'default'

    file_list = mc.read_file_list_from_archive(config, APPLICATION,
                                               prev_exec_date, exec_date)
    sys.argv = sys.argv[:1]
    result = 0
    if len(file_list) > 0:
        mc.write_to_file(config.work_fqn, '\n'.join(file_list))
        result |= ec.run_by_file(GemName,
                                 APPLICATION,
                                 COLLECTION,
                                 config.proxy_fqn,
                                 meta_visitors,
                                 data_visitors,
                                 archive=ARCHIVE)
    sys.exit(result)
Exemple #4
0
def _run():
    """
    Uses a todo file to identify the work to be done.

    :return 0 if successful, -1 if there's any sort of failure. Return status
        is used by airflow for task instance management and reporting.
    """
    config = mc.Config()
    config.get_executors()
    return ec.run_by_file(config,
                          VliteName,
                          APPLICATION,
                          meta_visitors,
                          data_visitors,
                          chooser=None)
def vlass_run():
    proxy = '/usr/src/app/cadcproxy.pem'
    ec.run_by_file(VlassName, APPLICATION, COLLECTION, proxy=proxy,
                   meta_visitors=visitors, data_visitors=None)
Exemple #6
0
def run_proxy():
    proxy = '/usr/src/app/cadcproxy.pem'
    ec.run_by_file(ec.StorageName, APPLICATION, COLLECTION, proxy,
                   meta_visitors, data_visitors)
Exemple #7
0
def run():
    ec.run_by_file(ec.StorageName, APPLICATION, COLLECTION, None,
                   meta_visitors, data_visitors)
def cgps_run():
    config = mc.Config()
    config.get_executors()
    ec.run_by_file(config, mc.StorageName, APPLICATION, meta_visitors,
                   data_visitors)
def omm_run_proxy():
    proxy = '/usr/src/app/cadcproxy.pem'
    ec.run_by_file(OmmName, APPLICATION, COLLECTION, proxy, meta_visitors,
                   data_visitors, OmmChooser())
def draosfm_run():
    ec.run_by_file(ec.StorageName, APPLICATION, COLLECTION, meta_visitors,
                   data_visitors)