通过PIP安装的Python模块修补Linux系统
这个问题可能没有一个“正确的答案”。我对思想和意见感兴趣。 我们有几百个RHEL7/CENTOS7/ROCKY8节点。他们中的许多人通过PIP/PIP3安装了Python模块。
我一直在寻找有关这些模块的常规/每月修补程序的最佳实践...所以我到目前为止尚未找到任何模块。显然,使用RPM/YUM/DNF安装的功能很容易处理。
从PIP MAN页面:
PIP安装 - 升级SomePackage
很棒! 但是您如何更新所有这些?
当然。可以做一个“ pip列表/冻结”管道,以使...等等。 当然,有一个更好的方法。理想情况下,捕获诸如“ boto3 v1.2”替换为boto3 v1.3的事物之类的东西 现在,感觉就像我是唯一想这件事的人。也许我是愚蠢的。我也可以回答(但是请告诉我原因)。
There probably isn't one "right answer" to this question. I'm interested in thoughts and opinions.
We have a couple hundred RHEL7/Centos7/Rocky8 nodes. Many of them have python modules installed via pip/pip3.
I've been searching for a best practices on routine/monthly patching these modules...so I far haven't found any. Obviously things installed with rpm/yum/dnf are pretty easy to deal with.
From the pip man page:
pip install --upgrade SomePackage
Great!
But how do you update all of them?
Sure. It is possible to do a "pip list/freeze" pipe that to awk...etc..
Surely, there's a better way. Ideally, one that captures things like "boto3 V1.2 replaced with boto3 V1.3"
Right now it feels like I'm the only one thinking about this. Maybe I am and it is stupid. I'm ok with that response as well (but please tell me why).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个常见的解决方案是在Docker容器中部署应用程序代码 - 容器映像包含其自己的Python版本和所有依赖关系模块,因此您无需单独更新所有主机机器上的每个模块。这也意味着可以测试您部署的OS,Python和模块的组合,然后将其“冷冻”到不变的图像中,然后在各处部署相同的图像。
我意识到上面的答案可能对您的情况无济于事,因为您已经部署了一个相当大的系统……但是可能有助于解释为什么没有多少人正在为您的问题开发解决方案!
A common solution is to deploy the application code inside a Docker container - the container image contains its own version of Python and all the dependency modules, so you don't have to update each module on all the host machines individually. It also means that the combination of OS, Python and modules that you deploy can be tested and then "frozen" into an immutable image which is then deployed the same everywhere.
I realise the above answer is probably not helpful in your situation as you already have a fairly large system deployed... but it might help to explain why not many people are developing solutions to your problem!