Skip to content

Commit

Permalink
update dbc bare metal related interface documents.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry-se committed Jan 14, 2025
1 parent 80ce992 commit 7b91a51
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,19 @@ bare_metal_port=5003
After this setting, DeepLink will automatically connect to the bare metal node of dbc at startup and synchronize the device information of DeepLink.

:::tip Note!
The above LAN connection requires dbc 0.4.1.7 and DeepLink 1.0.3.1 and above.
The above LAN connection requires dbc 0.4.1.7 and DeepLink 1.0.3.1 and above. This function replaces the middleware that was previously independently developed, deployed and stored for setting the DeepLink verification code, and integrates the functions of those middleware into the dbc and DeepLink software. At the same time, the interface for querying and setting machine information has also been changed, because a LAN connection needs to be established to query and set machine information. Please ensure that the configuration file and the IP address filled in when adding a bare metal machine are correct.
:::

There are two tables in the bare metal node of dbc. One table stores node information. The key is the node_id of the node, and the value is uuid, ip, ipmi_hostname and other information. The other table stores the TCP connection established by DeepLink. The key is the ip address of the TCP connection, and the value is the deeplink_device_id and deeplink_device_password device information received by the TCP connection.

When the bare metal node of dbc receives a query request, it first checks the first table above, finds the ip address through node_id, and then uses the ip address to query the device information of DeepLink in the second table. Therefore, the ip address set when adding a bare metal server must be real and valid, and correspond to the DeepLink device one by one. It is recommended to correctly set the fields such as uuid and ip, otherwise the interface for querying DeepLink device information may report an error.

:::tip Note!
For example, the "deeplink service not connected" error that frequently appears now is when the dbc bare metal node finds the IP address in the first table through node_id, but finds that this IP address does not exist in the second table. The reasons may be the following two points:
1. The IP address set in the first table is inconsistent with the actual IP of the machine where DeepLink is installed.
2. The incorrect configuration mentioned above causes DeepLink to fail to establish a connection with dbc, so there is no such data in the second table.
:::

In addition, you need to modify `http_ip=127.0.0.1` in the configuration file `dbc_baremetal_node/conf/core.conf` of the bare metal node to `http_ip=0.0.0.0`, so that the bare metal node can directly accept HTTP requests.

When the GPU machine and the bare metal node of dbc are in the same network, you can directly use the HTTP service of the bare metal node to get/set device information, and the request at this time does not need `session_id` and `session_id_sign` parameters. When the renter queries the device information through the HTTP service of the client node, it must have `session_id` and `session_id_sign` parameters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,19 @@ bare_metal_port=5003
如此设置后,DeepLink 将在开机启动时自动连接 dbc 的裸金属节点,并同步 DeepLink 的设备信息。

:::tip 注意!
上述的局域网连接需要 dbc 0.4.1.7 和 DeepLink 1.0.3.1 及其以上版本。
上述的局域网连接需要 dbc 0.4.1.7 和 DeepLink 1.0.3.1 及其以上版本,这个功能代替了以前为了设置 DeepLink 验证码而独立开发部署和存储的中间件,将那些中间件的功能集成在 dbc 和 DeepLink 软件中,同时还改动了查询和设置机器信息的接口,因为需要建立局域网的连接才能查询和设置机器信息,请确保配置文件和添加裸金属机器时填写的 ip 地址等信息的正确
:::

dbc 的裸金属节点里面有两张表,一张表存储节点信息,key 是节点的 node_id,value 是 uuid、ip、ipmi_hostname 等信息,另一张表存储 DeepLink 建立的 TCP 连接,key 是 TCP 连接的 ip 地址,value 是 TCP 连接收到的 deeplink_device_id、deeplink_device_password 设备信息。

当 dbc 的裸金属节点收到查询请求时,先查上面的第一张表,通过 node_id 查到 ip 地址,再拿 ip 地址去第二张表查询 DeepLink 的设备信息。因此添加裸金属服务器时设置的 ip 地址必须真实有效,且跟 DeepLink 设备一一对应,建议正确的设置 uuid 和 ip 等字段,否则查询 DeepLink 设备信息的接口可能会报错。

:::tip 注意!
例如现在频繁出现的 "deeplink service not connected" 报错,这个报错就是当 dbc 裸金属节点通过 node_id 在第一张表查到 ip 地址,却发现这个 ip 地址在第二张表中不存在,原因可能是以下两点:
1. 第一张表设置的 ip 地址跟安装了 DeepLink 的那台机器的实际 ip 不一致。
2. 上面提到的配置不正确导致 DeepLink 跟 dbc 没有建立连接,所以在第二张表中没有这个数据。
:::

另外,需要将裸金属节点的配置文件 `dbc_baremetal_node/conf/core.conf` 中的 `http_ip=127.0.0.1` 修改为 `http_ip=0.0.0.0`,这样设置将使得裸金属节点可以直接接受 HTTP 请求。

当 GPU 机器和 dbc 的裸金属节点位于同一个网络中的时候,可以直接使用裸金属节点的 HTTP 服务来获取/设置设备信息,而且此时的请求不需要 `session_id``session_id_sign` 参数。当租用人通过客户端节点的 HTTP 服务查询设备信息时,就必需带有 `session_id``session_id_sign` 参数了。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,19 @@ bare_metal_port=5003
After this setting, DeepLink will automatically connect to the bare metal node of dbc at startup and synchronize the device information of DeepLink.

:::tip Note!
The above LAN connection requires dbc 0.4.1.7 and DeepLink 1.0.3.1 and above.
The above LAN connection requires dbc 0.4.1.7 and DeepLink 1.0.3.1 and above. This function replaces the middleware that was previously independently developed, deployed and stored for setting the DeepLink verification code, and integrates the functions of those middleware into the dbc and DeepLink software. At the same time, the interface for querying and setting machine information has also been changed, because a LAN connection needs to be established to query and set machine information. Please ensure that the configuration file and the IP address filled in when adding a bare metal machine are correct.
:::

There are two tables in the bare metal node of dbc. One table stores node information. The key is the node_id of the node, and the value is uuid, ip, ipmi_hostname and other information. The other table stores the TCP connection established by DeepLink. The key is the ip address of the TCP connection, and the value is the deeplink_device_id and deeplink_device_password device information received by the TCP connection.

When the bare metal node of dbc receives a query request, it first checks the first table above, finds the ip address through node_id, and then uses the ip address to query the device information of DeepLink in the second table. Therefore, the ip address set when adding a bare metal server must be real and valid, and correspond to the DeepLink device one by one. It is recommended to correctly set the fields such as uuid and ip, otherwise the interface for querying DeepLink device information may report an error.

:::tip Note!
For example, the "deeplink service not connected" error that frequently appears now is when the dbc bare metal node finds the IP address in the first table through node_id, but finds that this IP address does not exist in the second table. The reasons may be the following two points:
1. The IP address set in the first table is inconsistent with the actual IP of the machine where DeepLink is installed.
2. The incorrect configuration mentioned above causes DeepLink to fail to establish a connection with dbc, so there is no such data in the second table.
:::

In addition, you need to modify `http_ip=127.0.0.1` in the configuration file `dbc_baremetal_node/conf/core.conf` of the bare metal node to `http_ip=0.0.0.0`, so that the bare metal node can directly accept HTTP requests.

When the GPU machine and the bare metal node of dbc are in the same network, you can directly use the HTTP service of the bare metal node to get/set device information, and the request at this time does not need `session_id` and `session_id_sign` parameters. When the renter queries the device information through the HTTP service of the client node, it must have `session_id` and `session_id_sign` parameters.
Expand Down

0 comments on commit 7b91a51

Please sign in to comment.