我有一个 PyTorch 培训项目,其中使用 conda 管理依赖项。我需要将我的项目打包为 setuptools
软件分发 (sdist) 放在 .tar.gz
文件中,以便我可以将其作为 Google Cloud Platform 的 Vertex.AI Training 服务中的自定义作业运行。
我找到了一个官方指南,解释了 如何使用 Conda 生成 bdist 包,但我认为我不能在 Vertex.AI 中使用它。
是否有用于生成 sdist 发行版的 Conda 命令?或者我可以使用任何其他工具来自动完成此操作吗?
请注意:我知道我可以在我的 setuptools setup.py 文件,但我不想这样做,因为手动维护同一列表的两个副本可能会链接到同步问题和错误。
I have a PyTorch training project where dependencies are managed using conda. I need to package my project as a setuptools
software distribution (sdist) in a .tar.gz
file so that I can run it as a custom job in Google Cloud Platform's Vertex.AI Training service.
I've found an official guide that explains how to generate a bdist package using Conda but I don't think I can use that in Vertex.AI.
Is there a Conda command for generating an sdist distribution? Or are there any other tools I can use to get this done automatically?
Please note: I know I can manually recreate the list of dependencies in my setuptools setup.py
file but I would rather not do that because manually maintaining two copies of the same list could link to sync issues and errors.
发布评论
评论(1)
您可以使用 python setuptools 来实现它。在 vertex ai 文档中,有关使用 Setuptools构建一个与 Vertex AI 一起使用的源发行版,有关于如何实现它的完整指南。
它为您提供了在处理自己的软件包时要考虑的步骤:
注意:Vertex AI 建议使用一些替代方案,如 创建源代码分发的替代方案。
You can use python setuptools to achieve it. On vertex ai documentation about using Setuptools to build a source distribution to use with Vertex AI there is a complete guide on how to achieve it.
Its provide you with this steps to consider when dealing with your own packages:
Note: Vertex AI suggest some alternatives to it as described on Alternatives to creating a source distribution.