如何从迪斯科python获取工作结果?

我尝试过迪斯科工作:

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


有关:


http://disco.readthedocs.io/en/latest/howto/administer.html
http://disco.readthedocs.io/en/latest/man/disco.html
http://disco.readthedocs.io/en/latest/howto/oob.html
https://github.com/discoproject/disco/search?p=3&q=dir%3A%2F%2F&utf8=%E2%9C%93
https://groups.google.com/forum/?nomobile=true#!searchin/disco-dev/job%20results%7Csort:relevance

最佳答案

我打开了一个拉取请求,但是基本上这是一种方法,我想将减少结果作为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)


看到:


https://github.com/discoproject/disco/pull/644

关于python - 如何获得工作结果迪斯科python,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41233253/

10-13 01:22