如何更改 SageMaker Docker 容器的共享内存?

发布于 2025-01-17 13:36:00 字数 568 浏览 0 评论 0原文

我在弹性容器注册表(ECR)中有一个Docker图像。它是通过我控制的简单Dockerfile创建的。

图像本身很好,但是我有一个问题,即在Sagemaker Studio中的容器内部工作时共享内存不足。因此,我需要提高这些容器的共享记忆。

为了提高容器的共享内存,我相信通常的方法是- SHM-SIZE参数参数在启动容器时Docker Run命令。但是,我无法控制这个命令,因为萨格人为我做了这一点。 Sagemaker正在运行Docker Run< image>训练启动容器时。

可以解决这个问题吗?通过以某种方式向命令提供其他参数,或者在创建Docker映像时指定某些内容(例如在Dockerfile中,部署脚本到ECR)。

I have a Docker image in Elastic Container Registry (ECR). It was created via a simple Dockerfile which I have control over.

The image itself is fine, but I have a problem where the shared memory is insufficient when working inside a container in SageMaker Studio. Therefore I need to raise the shared memory of these containers.

To raise the shared memory of a container, I believe the usual method is to pass the --shm-size argument to the docker run command when starting the container. However, I do not have control over this command, as SageMaker is doing that bit for me. The docs say that SageMaker is running docker run <image> train when starting a container.

Is it possible to work around this problem? Either via somehow providing additional arguments to the command, or specifying something when creating the Docker image (such as in the Dockerfile, deployment script to ECR).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

晚风撩人 2025-01-24 13:36:00

根据 this 问题,您没有可以在 sagemaker 中使用的选项那一刻。如果 ECS 适合您,它确实支持任务定义中的 --shm-size 选项。

According to this issue there is no option you can use in sagemaker at the moment. If ECS is an option for you, it does support --shm-size option in the task definition.

莫言歌 2025-01-24 13:36:00

正如 @rok 所指出的(谢谢!)在这种情况下不可能将参数传递给 docker run,尽管如果切换到 ECS 则可以。

但是,在构建镜像以推送到 ECR 时,可以将 --shm-size 参数传递给 docker build。这似乎已经解决了问题,尽管每当想要更改此参数时确实需要构建并推送新的 Docker 映像。

As pointed out by @rok (thank you!) it is not possible in this situation to pass arguments to docker run, although it would be if switching to ECS.

It is however possible to pass the --shm-size argument to docker build when building the image to push to ECR. This seems to have fixed the problem, albeit it does require a new Docker image to be built and pushed whenever wanting to change this parameter.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文