如何在 kubeflow 管道中使用训练运算符(例如 TFJob)定义组件/步骤
我知道有一种方法可以通过 kubectl 使用 tfjob 运算符,就像这里的示例 ( https://www.kubeflow.org/docs/components/training/tftraining/):
kubectl create -f https://raw.githubusercontent.com/kubeflow/training-operator/master/examples/tensorflow/simple.yaml
但我不知道如何合并到 kubeflow 管道中。普通的组件/作业是通过 @component 装饰定义的,或者 ContainerOp 是一种在 Pod 中运行的 Kubernetes Job 类型,但我不知道如何定义组件特殊的训练运算符,例如 TFJob,以便我的代码
apiVersion: "kubeflow.org/v1"
kind: TFJob
运行为而不是:
apiVersion: "kubeflow.org/v1"
kind: Job
在 kubernetes 中
。 PS:这里有一个示例: https:// github.com/kubeflow/pipelines/blob/master/components/kubeflow/launcher/sample.py 但没有看到任何地方指定TFJob
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您引用的示例利用了一些实际创建 TFJob 的代码(look在您的示例的文件夹):
您提出的一般问题仍然受当前讨论。使用 tfjob_launcher_op 似乎是当前推荐的方式。相反,有些人还本机使用
ResourceOps
来模拟您的kubectl create
调用。The example you reference leverages some code that actually creates a TFJob (look at the folder of your example):
The general question you raised is still subject to current discussions. Using
tfjob_launcher_op
appears to be the currently recommended way. Instead, some people also natively useResourceOps
to simulate yourkubectl create
call.