Пример #1
0
def query_component_output_data_info():
    output_data_infos = Tracker.query_output_data_infos(**request.json)
    if not output_data_infos:
        return get_json_result(retcode=101, retmsg='find data view failed')
    return get_json_result(retcode=0,
                           retmsg='success',
                           data=[
                               output_data_info.to_json()
                               for output_data_info in output_data_infos
                           ])
Пример #2
0
def component_output_data_table():
    output_data_infos = Tracker.query_output_data_infos(**request.json)
    if output_data_infos:
        return get_json_result(retcode=0,
                               retmsg='success',
                               data=[{
                                   'table_name': output_data_info.f_table_name,
                                   'table_namespace':
                                   output_data_info.f_table_namespace,
                                   "data_name": output_data_info.f_data_name
                               } for output_data_info in output_data_infos])
    else:
        return get_json_result(
            retcode=100,
            retmsg='No found table, please check if the parameters are correct'
        )
Пример #3
0
def get_job_all_table(job):
    dsl_parser = schedule_utils.get_job_dsl_parser(
        dsl=job.f_dsl,
        runtime_conf=job.f_runtime_conf,
        train_runtime_conf=job.f_train_runtime_conf)
    _, hierarchical_structure = dsl_parser.get_dsl_hierarchical_structure()
    component_table = {}
    component_output_tables = Tracker.query_output_data_infos(
        job_id=job.f_job_id, role=job.f_role, party_id=job.f_party_id)
    for component_name_list in hierarchical_structure:
        for component_name in component_name_list:
            component_table[component_name] = {}
            component_input_table = get_component_input_table(
                dsl_parser, job, component_name)
            component_table[component_name]['input'] = component_input_table
            component_table[component_name]['output'] = {}
            for output_table in component_output_tables:
                if output_table.f_component_name == component_name:
                    component_table[component_name]['output'][output_table.f_data_name] = \
                        {'name': output_table.f_table_name, 'namespace': output_table.f_table_namespace}
    return component_table