简体   繁体   English

如何从 Conda 项目创建 setuptools sdist.tar.gz package?

[英]How to create a setuptools sdist .tar.gz package from a Conda project?

I have a PyTorch training project where dependencies are managed using conda .我有一个 PyTorch 培训项目,其中使用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.我需要 package 我的项目作为.tar.gz文件中的setuptools软件分发(sdist),以便我可以在 Google Cloud Platform 的 Vertex.AI 培训服务中将其作为自定义作业运行。

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.我找到了一个官方指南,解释了如何使用 Conda 生成 bdist package,但我认为我不能在 Vertex.AI 中使用它。

Is there a Conda command for generating an sdist distribution?是否有用于生成 sdist 分布的 Conda 命令? 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.请注意:我知道我可以在我的 setuptools setup.py文件中手动重新创建依赖项列表,但我宁愿不这样做,因为手动维护同一列表的两个副本可能会导致同步问题和错误。

You can use python setuptools to achieve it.可以使用python setuptools来实现。 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.在有关使用 Setuptools 构建与 Vertex AI 一起使用的源代码分发的 Vertex AI文档中,有关于如何实现它的完整指南。

Its provide you with this steps to consider when dealing with your own packages:它为您提供了在处理您自己的包裹时要考虑的这些步骤:

  • Follow the instructions on Before you begin and Application structure按照开始之前应用程序结构中的说明进行操作
  • Create your setup.创建您的设置。
  • Add dependencies ( Could be Python or Custom dependencies - If any )添加依赖项(可以是 Python 或自定义依赖项 - 如果有)
  • Setup Python Modules ( If any )设置 Python 模块(如果有)
  • Upload your source distribution to Cloud Storage将您的源代码分发上传到 Cloud Storage

Note : Vertex AI suggest some alternatives to it as described on Alternatives to creating a source distribution .注意:Vertex AI 建议一些替代方案,如创建源分发的替代方案中所述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 SageMaker 处理作业中使用打包的 model tar.gz? - How to use packaged model tar.gz inside SageMaker Processing Job? 将 a.pickle model 转换为 tar.gz model 以便在 Sagemaker 中使用 - Converting a .pickle model to a tar.gz model for use in Sagemaker 使用 Boto3 和 Python 将 tar.gz 文件上传到 S3 Bucket - Upload tar.gz file to S3 Bucket with Boto3 and Python Python Databricks:有没有办法读取保存在 blob 存储中的 tar.gz 文件夹中的文本文件? - Python Databricks: Is there any way to read text files inside a tar.gz folder saved in a blob storage? 在 AWS Sagemaker 中训练 scikit 学习模型时无法创建 model.tar.gz 文件 - Couldn't create model.tar.gz file while training scikit learn model in AWS Sagemaker conda env create from yml 锁定 - conda env create from yml locks up CreateModel 操作:无法在 s3://my-bucket/testing/model/output/model.tar.gz 找到 model 数据 - CreateModel operation: Could not find model data at s3://my-bucket/testing/model/output/model.tar.gz 如何使用 AWS Lambda 函数从 S3 解码 a.gz 文件? - How can I decode a .gz file from S3 using an AWS Lambda function? 如何在 x86-64 架构的 aarch64 中安装 conda 包 - How to install conda packages in the aarch64 from x86-64 architecture 如何在从 lambda function 执行 jupyter notebook 时使用 Conda 内核 - How to use Conda kernels while executing jupyter notebook from lambda function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM