我一直在使用Kubeflow dsl容器op命令在我的Kubeflow管道的自定义上运行python脚本。我的配置如下所示:
def test_container_op():
input_path = '/home/jovyan/'
return dsl.ContainerOp(
name='test container',
image="<image name>",
command=[
'python', '/home/jovyan/test.py'
],
file_outputs={
'modeule-logs' : input_path + 'output.log'
}
)
现在,我还想在同一个容器中运行一个名为deploy.sh
的bash脚本。我还没有看到这样的例子。有没有类似的东西
command = [
'/bin/bash', '/home/jovyan/deploy.sh',
'python', '/home/jovyan/test.py'
]
不确定是否可能。会很感激你的帮助。
Kubeflow作业只是一个库伯内特斯作业,因此您受到库伯内特斯作业入口点是单个命令的限制。但是,您仍然可以将多个命令链接到单个sh
命令中:
sh -c "echo 'my first job' && echo 'my second job'"
这样你的kubeflow命令就可以:
command = [
'/bin/sh', '-c', '/home/jovyan/deploy.sh && python /home/jovyan/test.py'
]