How am I supposed to start a pipeline B after pipeline A completes, and use pipeline A's outputs into pipeline B?
A piece of code as a starting point:
from dagster import InputDefinition, Nothing, OutputDefinition, pipeline, solid
@solid
def pipeline1_task1(context) -> Nothing:
context.log.info('in pipeline 1 task 1')
@solid(input_defs=[InputDefinition("start", Nothing)],
output_defs=[OutputDefinition(str, 'some_str')])
def pipeline1_task2(context) -> str:
context.log.info('in pipeline 1 task 2')
return 'my cool output'
@pipeline
def pipeline1():
pipeline1_task2(pipeline1_task1())
@solid(input_defs=[InputDefinition("print_str", str)])
def pipeline2_task1(context, print_str) -> Nothing:
context.log.info('in pipeline 2 task 1' + print_str)
@solid(input_defs=[InputDefinition("start", Nothing)])
def pipeline2_task2(context) -> Nothing:
context.log.info('in pipeline 2 task 2')
@pipeline
def pipeline2():
pipeline2_task2(pipeline2_task1())
if __name__ == '__main__':
# run pipeline 1
# store outputs
# call pipeline 2 using the above outputs
Here we have three pipelines: pipeline1
has two solids, possibly does whatever stuff we wish and returns output from the second solid. pipeline2
is supposed to use the output of pipeline1_task2
, eventually do another piece of work and print the output of the first pipeline.
How am I supposed to "connect" the two pipelines?