如何增加 Azure Container Instance 的共享内存 (devshm)?

问题描述 投票:0回答:1

我正在将Selenium Standalone Firefox作为Azure容器实例运行。为了解决运行protractor测试时经常出现的错误 "未能解码来自marionette的响应",我需要增加容器的共享内存。

无法将其作为参数传递给我在管道中使用的az容器创建命令。

我试着把它作为命令行脚本传递,在容器部署后执行--命令行 "binsh -c 'sudo mount -o remount,size=2G devshm'",但它不起作用,因为容器是只读的,而且不幸的是,按照 https:/feedback.azure.comforums602224-azure-container-instancessuggestions33870166-aci-support-for-privileged-container。 它是不可能在特权模式下运行容器实例,允许写入模式。

你有什么办法吗? 谢谢,Magda

azure shared-memory azure-container-instances firefox-marionette
1个回答
0
投票

这是不支持的,而且会很难支持,因为它为运行不同容器组的虚拟机打开了很多风险。

底层的memoryCPU是与其他用户共享的,允许额外的DEVSHM有可能隐藏容器的真实内存使用情况,从而影响到现在运行在同一容器上的其他容器。

这个要求在过去已经提出过,见下文。

https:/feedback.azure.comforums602224-azure-container-instancessuggestions37442194-allow-specifying-the-siz-of-dev-shm-filesyst

我建议看看Kubernetes的替代方案,它支持中等类型的emptyDir。memory,这会根据你的需求创建合适的临时目录。

you can set the emptyDir.medium field to "Memory" to tell Kubernetes to mount a tmpfs (RAM-backed filesystem) for you instead. While tmpfs is very fast, be aware that unlike disks, tmpfs is cleared on node reboot and any files you write will count against your Container’s memory limit.

https:/kubernetes.iodocsconceptsstoragevolumes#emptydir。

© www.soinside.com 2019 - 2024. All rights reserved.