在 Luigi 的中央调度程序 Web 界面中跟踪长时间运行的任务状态

Dav*_*her 2 python progress-bar luigi

在 Luigi 框架中,我尝试使用和方法在中央调度程序的 Web 界面中显示长时间运行的任务的进度条set_tracking_url,如下所示:set_progress_barset_statusrun()

def run(self):
    self.set_tracking_url("127.0.0.1:8082")
    for i in range(100):
        self.do_long_calculation(i)
        self.set_status_message("Analyzing Id %d" % i)
        self.set_progress_percentage(i)
Run Code Online (Sandbox Code Playgroud)

我正在使用运行任务

PYTHONPATH='.' luigi --module AnalysisTasks LongTask --workers=5
Run Code Online (Sandbox Code Playgroud)

其中AnalysisTasks是 python 源文件,LongTask是该方法所属的任务run(),并且 luigid 在后台运行。但是我没有看到任何进度条或状态报告。我在任何地方都没有找到任何答案或例子。这有可能吗?

Vin*_*ars 5

class MyTestTask(Task):
    name = "MyTestTask"
    target = ["test"]

    def run(self):
        for i in range(100):
            time.sleep(1)
            self.set_progress_percentage(i / 10)
            print i
        return {self.target[0]: i}
Run Code Online (Sandbox Code Playgroud)

Luigi UI,其中红色箭头表示进度条按钮