Luigi 可以处理同一管道的并行运行吗?

Can Luigi handle parallel runs of the same pipeline?

用户向我们发送订单。收到订单后,我们 运行 一个由 运行 几个任务组成的管道。有些任务需要几天的计算机时间。

# Example pipeline
order -> task1 -> task2 -> task3 -> Complete

我想在收到每个订单时开始处理,因此我们的计算集群将同时处理多个订单及其关联的 运行 管道

# Diagram showing each order arriving then being processed over time.

|  order1 -> t1 -> t2 -> t3 -> complete
|             order2 -> t1 -> t2 -> t3 -> complete
|                        order3 -> t1 -> t2 -> t3 -> complete
|                        order4 -> t1 -> t2 -> t3 -> complete
|                                                order5 -> t1 -> t
------------------------------------------------------------------
 time 

你能在 Luigi 中做到这一点吗?

我不认为你可以在我实施测试管道时尝试启动测试管道的另一个实例,而第一个是 运行ning 我从第二个得到以下输出管道实例。

Pid(s) set([11004]) already running

Process finished with exit code 0

只要参数不同,Tasks就会有不同的id,可以同时运行。如果您尝试 运行 具有相同参数的任务,以便 id 生成函数生成相同的 id,它将认为它已经 运行ning。如果生成的 id 不同,你肯定可以 运行 多个相同的任务。

任务ID生成方法如下: https://github.com/spotify/luigi/blob/master/luigi/task.py#L118