TFX CLI as part of a CI/CD pipeline

99 views
Skip to first unread message

Sascha Heyer

unread,
Mar 12, 2021, 3:37:52 PM3/12/21
to TensorFlow Extended (TFX)
Hi TFX Team and Community, 

using the TFX CLI as part of a CI/CD pipeline.
https://www.tensorflow.org/tfx/guide/cli

Every time a new version of the pipeline is released we initiate a build to update the Kubeflow pipeline. 

Using tfx pipeline upgrade works well as long as there is already an existing pipeline. 

For the very first build, before the pipeline is there it will fail. 
We can use tfx pipeline create for the first time but it would involve calling the command manually. 

To my questions:
  1. Better approaches to deploy a TFX pipeline to Kubeflow in a automatic fashion?
  2. Is there an option like "overwrite" for the pipeline create command. Or a fallback for tfx pipeline update in case the pipeline is not exiting?

Thanks a lot
Best regards
Sascha

Dhruvesh Talati

unread,
Mar 12, 2021, 3:48:13 PM3/12/21
to Sascha Heyer, Zhitao Li, TensorFlow Extended (TFX)
@Zhitao Li  to help with this 

--
You received this message because you are subscribed to the Google Groups "TensorFlow Extended (TFX)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfx+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfx/d0832ade-0978-465c-942c-e8e0a6e2da04n%40tensorflow.org.


--
Cheers,
Dhruvesh Talati, on behalf of TFX::OSS team

Sascha Heyer

unread,
Mar 12, 2021, 4:34:21 PM3/12/21
to TensorFlow Extended (TFX), dhru...@google.com, TensorFlow Extended (TFX), Sascha Heyer, zhit...@google.com
Or is the recommended approach to use the Kubeflow Pipelines SDK?

Jiyong Jung

unread,
Mar 15, 2021, 12:10:10 AM3/15/21
to Sascha Heyer, TensorFlow Extended (TFX), dhru...@google.com, zhit...@google.com
Thank you for using the TFX CLI.

There is no option like 'overwrite' at this moment and 'update' will fail if the pipeline doesn't exist yet.
Currently, the only possible way would be 'list' pipelines and check whether it already exists.
(We might be able to add 'get' to make it more usable.)

Sascha Heyer

unread,
Mar 15, 2021, 2:04:34 AM3/15/21
to Jiyong Jung, TensorFlow Extended (TFX), dhru...@google.com, zhit...@google.com
@Jiyong thanks a lot for the feedback. 
Conditional steps in the build pipeline are only possible with workarounds.

Better approaches to deploy a TFX pipeline to Kubeflow in an automatic fashion?
Can you provide some of your experience?

Sascha Heyer

unread,
Mar 16, 2021, 11:37:17 AM3/16/21
to TensorFlow Extended (TFX), Sascha Heyer, TensorFlow Extended (TFX), dhru...@google.com, zhit...@google.com, Jiyong Jung
From the implementation, I can see it is anyway checked if the pipeline already exists. 
Can't we just incorporate this into the command itself. 

https://github.com/tensorflow/tfx/blob/1afb72cc939c6f20cc2d01c44a446f5cd331fc27/tfx/tools/cli/handler/kubeflow_handler.py#L61
Jiyoung, what do you think, adding an official feature request on Github probably the best way to track that request?


Screenshot 2021-03-16 at 16.35.27.png

Sascha Heyer

unread,
Mar 16, 2021, 11:46:52 AM3/16/21
to TensorFlow Extended (TFX), Sascha Heyer, TensorFlow Extended (TFX), dhru...@google.com, zhit...@google.com, Jiyong Jung
Appendix:
Found out _check_pipeline_existence just checks if the pipeline file already exists locally.
Too bad though that is the functionality I was looking for. 

Jiyong Jung

unread,
Mar 16, 2021, 8:28:45 PM3/16/21
to Sascha Heyer, TensorFlow Extended (TFX), dhru...@google.com, zhit...@google.com
Thank you for your investigation.

I'll implement that but I'm not sure what would be a more desirable syntax yet.
I would be grateful if you could give me some feedback on it (possibly on GitHub).

Sascha Heyer

unread,
Mar 17, 2021, 6:01:50 AM3/17/21
to Jiyong Jung, TensorFlow Extended (TFX), dhru...@google.com, zhit...@google.com
👍
Reply all
Reply to author
Forward
0 new messages