服务器系统(产品配置器/规则引擎)配置器设计

发布于 2025-01-15 19:29:14 字数 799 浏览 3 评论 0原文

我正在为我的配置问题寻找一个干净的解决方案。

我的任务是创建一个服务器系统配置器,我设计并创建了一个服务器系统配置器。实施了一项。然而,我忍不住觉得有一条更好/更干净的路线。

目前,我已经抽象出了“服务器”的一些层次概念:

系统>服务器。机箱 + PSU >节点>各个节点组件(CPU、内存、驱动器、PCI 等)。

因此,我在 Python 中以面向对象的方式实现了这些想法,其中我有一个系统,它有机箱成员,机箱有一个节点成员列表和一个 PSU 成员等。

配置过程的棘手部分是某些部分是动态的。 IE CPU_SKU_#1 无法与 CHASSIS_SKU_#3 配合使用,或者 CHASSIS_SKU_#1 有 6 个 SSD 插槽,而 CHASSIS_SKU_#2 只有 2 个 SSD 插槽。

因此,在我的系统的 Python OOP 实现的下面是一个 Mongo 数据库,它为每个产品系列都有一个条目,其中概述了所有潜在的组件、机箱、PSU 等 SKU,以及哪些组件与其他组件冲突。

因此,它是一个数据驱动的模型,我将数据输入配置器,然后您可以查询有效的选项。

IE chassis.enum_psus() ->;该机箱的有效 PSU 列表。 chassis.nodes[0].enum_cpus() ->;此机箱 + 节点的有效 CPU 列表(因为 CPU 可能与机箱和/或节点冲突)。

所以,总的来说,我想知道我所走的路线是否是可接受的路线,和/或是否有更好/更容易的路线?

最终,我知道我所采取的路线“有效”,我只是忍不住觉得还有更好的成功路线。

任何设计配置器的帮助/指示将不胜感激。

I am searching for a clean solution for my Configuration problem.

I have been tasked with creating a Server System Configurator, I have designed & implemented one. However, I cannot help but feel like there is a better/cleaner route.

Currently I have abstracted a few hierarchical notions of what a "Server" is:

System > Chassis + PSUs > Node(s) > Individual Node Components (CPU, Memory, Drives, PCIes, etc).

So, I have implemented these ideas in an Object-Oriented way in Python, where I have a System and it has Chassis member, and Chassis has a list of nodes member, and a PSU member, etc down the line.

The tricky part of the configuration process is that some parts are dynamic.
I.E. CPU_SKU_#1 does not work with CHASSIS_SKU_#3, or CHASSIS_SKU_#1 has 6 SSD slots, and CHASSIS_SKU_#2 has only 2 SSD slots.

So, underneath my Python OOP implementation of what a System looks like is a Mongo Database that has an entry for each Product Family, where it outlines all the potential components, chassis, PSUs, etc SKUs and which ones conflict with the other ones.

So, it is a data-driven model, I feed the data into the configurator which then allows you to query for valid options.

I.E.
chassis.enum_psus() -> a List of VALID PSUs for this Chassis.
chassis.nodes[0].enum_cpus() -> A list of VALID CPUs for this Chassis + Node (since a CPU might conflict with the chassis and/or the Node).

So, overall I am wondering if the route I have gone is an acceptable route, and/or if there are better/easier routes?

Ultimately, I know the route I took "works", I just cannot help but feel like there are better routes out there to success.

Any help/pointers for designing Configurators would be appreciated.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文