Как получить результаты работы диско питона

Как получить результаты работы с диско питона?

Я пробовал работу на дискотеке:

jmunsch@disco-master-5147:~$ disco jobs
KeyCount@5ca:2d323:53093
KeyCount@5ca:2bcb5:4f479

результаты дискотеки:

jmunsch@disco-master-5147:~$ disco results "KeyCount@5ca:2bcb5:4f479"
dir://disco-node-9144/disco/disco-node-9144/1a/KeyCount@5ca:2bcb5:4f479/.disco/reduce-1001-1482183896238504.results

Вот вход:

jmunsch@disco-master-5147:~$ disco jobdict "KeyCount@5ca:2bcb5:4f479"
inputs  [ ... a bunch of inputs ... ]
pipeline    [[u'iter_pgs_item', u'split', False], [u'reduce', u'group_label', False]]
save_info   ddfs
worker  virtualenvworker
save_results    False
prefix  KeyCount
scheduler   {}
owner   jenkins@jenkins-4139

связанные с:

1 ответ

Я открыл запрос на извлечение, но в основном это один из способов сделать это, я хотел вывести результаты сокращения в виде кортежей len(2), как часть bin/discocli.py:

@Disco.job_command
def results_get(program, jobname):
    """Usage: jobname

    Print out the data of a completed job.
    `disco jobs | xargs -IJOB_ID disco results_get JOB_ID`
    """
    status, results = program.disco.results(jobname)
    if sys.version_info[0] == 2:
        binary_type = str
    elif sys.version_info[0] == 3:
        binary_type = bytes
    if status == 'ready':
        for line in program.disco.result_iterator(results):
            if isinstance(line, binary_type):
                line = line.decode('utf-8')
            print(line)

Увидеть:

Другие вопросы по тегам