我一直在使用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'
]不确定这是否可能。会很感谢你的帮助。
发布于 2021-10-11 09:36:30
Kubeflow作业只是一个Kubernetes作业,因此您只能使用Kubernetes作业入口点作为单个命令。但是,您仍然可以将多个命令链接到单个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'
]https://stackoverflow.com/questions/69489759
复制相似问题