I am new to Luigi and trying to find my way around. I may be missing something on this but I haven't found the answer yet.
Problem:
Luigi seems to be running one task at a time even though many are pending and have no dependencies.
I am running "luigid" and there is an example below with code and command line.
Questions:
* How do I get multiple tasks to run concurrently (assuming not dependencies or dependencies are satisfied) ? In this case, an "unlimited" number of tasks (ok, a lot) ?
* How do I limit the number of concurrent tasks ?
Thanks in advance for any help.
Here is example code which can launch a number of concurrent sleeping tasks to help illustrate what is happening.
Command Line: (luigid is already running)
python concurrent_task_test.py task_launch_sleepers --sleep-time 40 --sleeper-count 4
import luigi
import time
class task_sleeping(luigi.Task):
sleep_time = luigi.IntParameter()
task_number = luigi.IntParameter()
def requires(self):
return []
def output(self):
return luigi.LocalTarget("done_sleeping_" + str(self.task_number) + ".txt")
def run(self):
time.sleep(self.sleep_time)
with self.output().open('w') as ofh:
ofh.write("Done sleeping.")
class task_launch_sleepers(luigi.Task):
sleep_time = luigi.IntParameter()
sleeper_count = luigi.IntParameter()
def requires(self):
sleeper_list = []
for sidx in range(self.sleeper_count):
sleeper_list.append(
task_sleeping(sleep_time = self.sleep_time,
task_number = sidx))
return sleeper_list
def output(self):
return luigi.LocalTarget("done_task_launch_sleepers.txt")
def run(self):
pass
if __name__ == '__main__':
luigi.run()
I did find I could use "--workers 30" to set the number of concurrent workers to 30, as in:
python concurrent_task_test.py task_launch_sleepers --sleep-time 40 --sleeper-count 4 --workers 30
* Is there a way to launch "luigid" with a default setting ? Unlimited or limited ?
* Can certain task types have a smaller limit (e.g. the max may be 30 in general but for a specified task type set it to 5) ?
Thanks.
--
You received this message because you are subscribed to the Google Groups "Luigi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to luigi-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to luigi-user+unsubscribe@googlegroups.com.