Skip to content

Commit

Permalink
Lineage run
Browse files Browse the repository at this point in the history
  • Loading branch information
htahir1 committed Nov 19, 2021
1 parent 4bf5d1e commit 755fd99
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,34 @@ def my_pipeline(importer, preprocesser, trainer, evaluator, deployer):
deployer=deployer(),
)

lineage_pipeline.run()
lineage_pipeline.run()
lineage_pipeline.run()
lineage_pipeline.run()

pipeline = Repository().get_pipelines()[-1]

for run in pipeline.runs:
try:
deployer_step = run.get_step(name="deployer")
trainer_step = run.get_step(name="trainer")
deployed_model_artifact = deployer_step.inputs["model"]
trained_model_artifact = trainer_step.output

# lets do the lineage
print(
f"trained_model_artifact was produced by: "
f"{trained_model_artifact.producer_step.id} and is_cached: "
f"{trained_model_artifact.is_cached} step cached: "
f"{trainer_step.status}"
)
except Exception as e:
if "No step found for name `deployer`" in str(e):
pass
else:
raise e
# for run in pipeline.runs:
# try:
# deployer_step = run.get_step(name="deployer")
# trainer_step = run.get_step(name="trainer")
# deployed_model_artifact = deployer_step.inputs["model"]
# trained_model_artifact = trainer_step.output
#
# # lets do the lineage
# print(
# f"trained_model_artifact was produced by: "
# f"{trained_model_artifact.producer_step.id} and is_cached: "
# f"{trained_model_artifact.is_cached} step cached: "
# f"{trainer_step.status}"
# )
# except Exception as e:
# if "No step found for name `deployer`" in str(e):
# pass
# else:
# raise e


from zenml.post_execution.visualizers.lineage.pipeline_lineage_visualizer import PipelineLineageVisualizer

PipelineLineageVisualizer().visualize(pipeline)

0 comments on commit 755fd99

Please sign in to comment.