This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import luigi | |
import os | |
#from WorkflowUtils import WorkflowUtils | |
import logging as log | |
class ATask(luigi.Task): | |
# Task parameters | |
dataset_name = luigi.Parameter() | |
upstream_task = luigi.Parameter() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Some needed luigi imports | |
import luigi | |
import luigi.scheduler | |
import luigi.worker | |
# Here we are importing our own tasks, provided they are | |
# arranged in a python module (folder) named "components" | |
from components.SomeTaskA import SomeTaskA | |
from components.SomeTaskB import SomeTaskB | |
from components.SomeTaskC import SomeTaskC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Luigi Workflow | |
Usage: | |
run_luigi_workflow.py (--host=|--local-scheduler) --workers=<workers> run <taskname> -p <partitioning_parameter> | |
run_luigi_workflow.py (-h|--help) | |
run_luigi_workflow.py --version | |
Options: | |
-h, --help Show this screen | |
--version Show version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import luigi | |
from SomePossibleUpstreamTask import SomePossibleUpstreamTask | |
from SomeOtherPossibleUpstreamTask import SomeOtherPossibleUpstreamTask | |
class ExampleTask(luigi.Task): | |
upstream_task = luigi.Parameter() | |
def requires(self): | |
# This will return the upstream task object | |
return self.upstream_task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python run_luigi_workflow.py --workers run some_task_c --partitioning-parameter Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[wiki] | |
user = MyWikiBotUser | |
pass = ******** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"log" | |
"os" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FooParamsMixin(object): | |
param1 = luigi.Parameter() | |
param2 = luigi.Parameter() | |
... | |
def foo_params(self): | |
return { 'param1': self.param1, 'param2' : self.param2, ... } | |
class TaskA(FooParamsMixin, luigi.Task): | |
def requires(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[formatters] | |
keys: default | |
[handlers] | |
keys: console, logfile | |
[loggers] | |
keys: root, luigi-interface | |
[formatter_default] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TaskA1(luigi.Task): | |
def requires(self): | |
.... | |
def output(self): | |
return { 'output1' : luigi.LocalTarget( self.input().path + ".output1" ), | |
'output2' : luigi.LocalTarget( self.input().path + ".output2" ) } | |
def run(self): | |
.... | |
class TaskA2(luigi.Task): |
OlderNewer