conda env build 失败并显示“[Errno 28] No space left on device”

conda env build fails with "[Errno 28] No space left on device"

我正在尝试在终端会话中的 Sagemaker ec2 环境中构建一个新的 conda 环境。环境原始副本中的包已损坏,环境变得不可用。无法通过删除软件包并重新安装或使用 conda update.

来解决此问题

我用 conda env remove -n python3-cn 破坏了环境,然后尝试用以下方法重新创建环境:

conda env create -p /home/ec2-user/SageMaker/anaconda3/envs/python3-cn --file=${HOME}/SageMaker/efs/.sagemaker/python3-cn_environment.yml --force

此环境已在多个 ec2 实例中为各个 Sagemaker 用户创建多次。

Conda 记录以下内容:

Collecting package metadata (repodata.json): done
Solving environment: done

Downloading and Extracting Packages
pytest-arraydiff-0.2 | 14 KB     | ##################################################################################################### | 100% 
partd-0.3.8          | 32 KB     | ##################################################################################################### | 100% 

... several progress bar lines later...

psycopg2-2.7.5       | 507 KB    | ##################################################################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
ERROR conda.core.link:_execute(700): An error occurred while installing package 'defaults::mkl-2018.0.3-1'.
Rolling back transaction: done

[Errno 28] No space left on device
()

No space left on device错误是一致的。我试过了

在前两个中,我得到 Errno 28

最后一个,没有创建实例,conda env list没有显示python3-cn,但是我看到anaconda/envs/里面有一个python3-cn目录目录。如果我这样做 conda activate python3-cn,我会看到提示发生变化,但环境不可用。如果我尝试 conda update --all,我会收到一个包文件已损坏的通知。

不太确定在这里做什么。我正在寻找 space 猪,但没有真正找到任何重要的东西。

尝试增加笔记本的 ebs 卷数量...这个博客解释得很好:https://aws.amazon.com/blogs/machine-learning/customize-your-notebook-volume-size-up-to-16-tb-with-amazon-sagemaker/

此外,最佳做法是使用生命周期配置脚本来 build/add 新的依赖项...官方文档:https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html

这个 github 页面有一些很棒的模板示例...例如设置特定的配置,如 conda 等:https://github.com/aws-samples/amazon-sagemaker-notebook-instance-lifecycle-config-samples/tree/master/scripts

@thePurplePython 感谢您提供此信息——它非常有用。我发现 notebook 中有一些隐藏的目录消耗了足够的 space 来允许构建开始,但不能完成。但是,我真的很喜欢生命周期配置,并且会随着我们的依赖关系的增长而查看它,这必然会发生。