将 .py 文件下载到执行环境中有哪些选项?
在这个例子中:
class Preprocess(dsl.ContainerOp):
def __init__(self, name, bucket, cutoff_year):
super(Preprocess, self).__init__(
name=name,
# image needs to be a compile-time string
image='gcr.io/<project>/<image-name>/cpu:v1',
command=['python3', 'run_preprocess.py'],
arguments=[
'--bucket', bucket,
'--cutoff_year', cutoff_year,
'--kfp'
],
file_outputs={'blob-path': '/blob_path.txt'}
)
正在从 CLI 调用 run_preprocess.py 文件。
问题是:如何在那里获取该文件?
我看过这个有趣的例子:https ://github.com/benjamintanweihao/kubeflow-mnist/blob/master/pipeline.py ,它会在运行管道之前克隆代码。
另一种方法是使用 Dockerfile 进行 git 克隆(尽管构建映像需要很长时间)。
还有什么其他选择?