'How to define component/step using training operators such as TFJob in kubeflow pipeline

I know there is a way to use tfjob operator via kubectl, like the example at here (https://www.kubeflow.org/docs/components/training/tftraining/):

kubectl create -f https://raw.githubusercontent.com/kubeflow/training-operator/master/examples/tensorflow/simple.yaml

But I don't know how to incorporate in kubeflow pipeline. A normal component/job is defined via @component decoration or ContainerOp is a Kubernetes Job kind which runs in a Pod, but I don't know how to define a component with special training operator such as TFJob, so that my code runs as

apiVersion: "kubeflow.org/v1"
kind: TFJob

rather than:

apiVersion: "kubeflow.org/v1"
kind: Job

in kubernetes.

P.S.: there is a example here: https://github.com/kubeflow/pipelines/blob/master/components/kubeflow/launcher/sample.py but don't see anywhere specify TFJob



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source