Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
a948f09
add biomek.py demo implementation
TablewareBox May 30, 2025
055d120
更新LiquidHandlerBiomek类,添加资源创建功能,优化协议创建方法,修复部分代码格式问题,更新YAML配置以支持新功能。
TablewareBox May 30, 2025
90a0f3d
merge
Xuwznln May 30, 2025
0452a68
Test
ElijahChang929 May 30, 2025
ea2e9c3
fix biomek success type
Xuwznln May 30, 2025
cb7c56a
Convert LH action to biomek.
ElijahChang929 May 30, 2025
208540b
Update biomek.py
ElijahChang929 May 30, 2025
d2dda6e
Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-L…
ElijahChang929 May 30, 2025
0f2555c
注册表上报handle和schema (param input)
Xuwznln May 30, 2025
478a859
修复biomek缺少的字段
Xuwznln May 30, 2025
6f6c70e
delete 's'
ElijahChang929 Jun 4, 2025
8a29bc5
Remove warnings
ElijahChang929 Jun 4, 2025
807dcdd
Update biomek.py
ElijahChang929 Jun 4, 2025
6d2489a
Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-L…
ElijahChang929 Jun 4, 2025
147b8f4
Biomek test
ElijahChang929 Jun 4, 2025
5b240cb
Update biomek.py
ElijahChang929 Jun 4, 2025
c5a495f
新增transfer_biomek的msg
Xuwznln Jun 4, 2025
e63c159
New transfer_biomek
ElijahChang929 Jun 4, 2025
e1a7c3a
Updated transfer_biomek
ElijahChang929 Jun 4, 2025
b957ad2
Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-L…
ElijahChang929 Jun 4, 2025
b999692
更新transfer_biomek的msg
Xuwznln Jun 5, 2025
39de3ac
更新transfer_biomek的msg
Xuwznln Jun 5, 2025
dd5a7ca
支持Biomek创建
Xuwznln Jun 5, 2025
a62112a
new action
qxw138 Jun 5, 2025
101c1bc
fix key name typo
Xuwznln Jun 5, 2025
46da42d
Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-L…
qxw138 Jun 5, 2025
1e00a66
New parameter for biomek to run.
ElijahChang929 Jun 6, 2025
3c2a4a6
Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-L…
ElijahChang929 Jun 6, 2025
106d71e
Refine
ElijahChang929 Jun 6, 2025
2573d34
Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-L…
qxw138 Jun 6, 2025
24ecb13
Update
ElijahChang929 Jun 6, 2025
5e86112
Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-L…
ElijahChang929 Jun 6, 2025
5bec899
new actions
qxw138 Jun 6, 2025
097114d
new actions
qxw138 Jun 6, 2025
1b9f3c6
1
qxw138 Jun 6, 2025
55be5e8
registry
Xuwznln Jun 6, 2025
48c43d3
fix biomek startup
Xuwznln Jun 6, 2025
c7b9c6a
fix handles not as default entry
Xuwznln Jun 6, 2025
6573c9e
biomek_test.py
qxw138 Jun 6, 2025
146d8c5
Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-L…
qxw138 Jun 6, 2025
e840516
Update biomek.py
qxw138 Jun 6, 2025
3f53f88
biomek_test.py
qxw138 Jun 7, 2025
8698821
fix liquid_handler.biomek handles
TablewareBox Jun 7, 2025
b6c9530
Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-L…
TablewareBox Jun 7, 2025
c0b7f2d
host node新增resource add时间统计
Xuwznln Jun 8, 2025
ab0c4b7
修正物料上传时间
Xuwznln Jun 8, 2025
6a14104
正确发送return_info结果
Xuwznln Jun 8, 2025
aaa8631
同步执行状态信息
Xuwznln Jun 8, 2025
5263277
取消raiseValueError提示
Xuwznln Jun 8, 2025
9b3377a
Update biomek_test.py
qxw138 Jun 8, 2025
f1fee5f
Merge branch '37-biomek-i5i7' of https://github.com/dptech-corp/Uni-L…
qxw138 Jun 8, 2025
6577fe1
0608 DONE
ElijahChang929 Jun 8, 2025
12c17ec
同步了Biomek.py 现在应可用
ElijahChang929 Jun 8, 2025
bab4b1d
biomek switch back to non-test
Xuwznln Jun 8, 2025
6ae77e0
temp disable initialize resource
Xuwznln Jun 8, 2025
729a0fc
37-biomek-i5i7 (#40)
Xuwznln Jun 9, 2025
133ffaa
Device visualization (#39)
q434343 Jun 9, 2025
d8a0c5e
Device visualization (#41)
Xuwznln Jun 9, 2025
4c7aa8a
fix move it
Xuwznln Jun 9, 2025
2e9a0a4
fix move it
Xuwznln Jun 9, 2025
ea5e7a5
Merge branch '37-biomek-i5i7' into dev
Xuwznln Jun 9, 2025
9c515a2
create_resource
Xuwznln Jun 9, 2025
d297abf
bump ver
Xuwznln Jun 9, 2025
9016998
增加modbus支持
Xuwznln Jun 10, 2025
369a21b
调整protocol node以更好支持多种类型的read和write
Xuwznln Jun 10, 2025
34151f5
补充日志
Xuwznln Jun 10, 2025
d7d0a27
Device visualization (#42)
Xuwznln Jun 12, 2025
96f37b3
Add Mock Device for Organic Synthesis\添加有机合成的虚拟仪器和Protocol (#43)
KCFeng425 Jun 12, 2025
11e4f05
bump version & protocol fix
Xuwznln Jun 12, 2025
ae3c65c
Merge remote-tracking branch 'origin/main' into dev
Xuwznln Jun 12, 2025
66af337
hotfix: Add macos_sdk_config (#46)
Mile-Away Jun 12, 2025
75ea45f
include device_mesh when pip install
Xuwznln Jun 12, 2025
30d143e
Merge branch 'dev' of https://github.com/dptech-corp/Uni-Lab-OS into dev
Xuwznln Jun 13, 2025
4471fed
测试自动构建
Xuwznln Jun 13, 2025
d5d516f
try build fix
Xuwznln Jun 13, 2025
49f1aa9
try build
Xuwznln Jun 13, 2025
5478ba3
test artifacts
Xuwznln Jun 13, 2025
8038094
hotfix: Add .certs in .gitignore
HaohuiQue Jun 15, 2025
934276d
create container
Xuwznln Jun 15, 2025
a354965
Merge branch 'dev' of https://github.com/dptech-corp/Uni-Lab-OS into dev
Xuwznln Jun 15, 2025
f7db8d1
container 添加和更新完成
Xuwznln Jun 15, 2025
46cec82
Device registry port (#49)
KCFeng425 Jun 22, 2025
6faa19a
Merge branch 'main' into dev
Xuwznln Jun 22, 2025
06b7962
更新workstation注册表
Xuwznln Jun 22, 2025
96e9c76
添加了两个protocol的检索功能 (#51)
KCFeng425 Jun 22, 2025
f9a9e91
Merge remote-tracking branch 'origin/main' into dev
Xuwznln Jun 22, 2025
bbc49e9
新增注册表补全功能,修复Protocol执行失败
Xuwznln Jun 27, 2025
15f3f85
支持通过导入方式补全注册表,新增工作流unilabos_device_id字段
Xuwznln Jun 27, 2025
817e88c
修复不启用注册表补充就无法启动的bug
Xuwznln Jun 27, 2025
9be6e10
修复部分识别error
Xuwznln Jun 28, 2025
be0a73e
修复静态方法识别get status,注册表支持python类型
Xuwznln Jun 28, 2025
157da17
status types对于嵌套类型返回的对象,暂时处理成字符串,无法直接进行转换
Xuwznln Jun 29, 2025
498b3ca
支持通过list[int],list[float]进行Int64MultiArray,Float64MultiArray的替换
Xuwznln Jun 29, 2025
6887135
成功动态导入的不再需要使用静态导入
Xuwznln Jun 29, 2025
6483271
Fix handle names (#55)
TablewareBox Jun 29, 2025
7714c71
add camera and dependency (#56)
TablewareBox Jun 29, 2025
09ad905
修复auto-的Action在protocol node下错误注册
Xuwznln Jun 29, 2025
f2753fc
Merge branch 'main' into dev
Xuwznln Jun 29, 2025
e752197
匹配init param schema格式
Xuwznln Jun 30, 2025
1329556
Add channel_sources config in conda_build_config.yaml (#58)
ZiWei09 Jul 3, 2025
d7d43af
修复任务执行传参
Xuwznln Jul 4, 2025
21afdb6
Create 5 new protocols & bump version 0.9.8 (#59)
KCFeng425 Jul 4, 2025
b69acea
Merge branch 'dev' of https://github.com/dptech-corp/Uni-Lab-OS into dev
Xuwznln Jul 4, 2025
a6ec20e
转换到ros消息时,要进行基础类型转换
Xuwznln Jul 5, 2025
c8c7550
Update work_station.yaml (#60)
KCFeng425 Jul 5, 2025
0d512c9
Create prcxi.py
ElijahChang929 Jul 5, 2025
b78c6c6
Update prcxi.py
ElijahChang929 Jul 5, 2025
bef44b2
Update Prcxi
ElijahChang929 Jul 5, 2025
ce8667f
更新中析仪器,以及启动示例
Xuwznln Jul 6, 2025
5028266
修改moveit_interface,并在mqtt上报时发送一个时间戳,方便网页端对数据的筛选 (#62)
q434343 Jul 8, 2025
e2052d4
更新实例
Xuwznln Jul 11, 2025
18f6685
更新实例
Xuwznln Jul 11, 2025
61ee446
更新实例
Xuwznln Jul 11, 2025
644fece
修正prcxi启动
Xuwznln Jul 11, 2025
5a2cc2d
更新PRCXI配置,修改主机地址和设置状态,并添加示例用法
ElijahChang929 Jul 11, 2025
b85722f
add pickup tips for prcxi
Xuwznln Jul 11, 2025
cd9e7ef
任意执行错误都应该返回failed
Xuwznln Jul 11, 2025
72c67ba
任意执行错误都应该返回failed
Xuwznln Jul 11, 2025
25960c2
Add plateT6 to PRCXI configuration and enhance error handling in liqu…
ElijahChang929 Jul 11, 2025
7b68545
prcxi blending
Xuwznln Jul 11, 2025
0e11dac
assert blending_times > 0
Xuwznln Jul 11, 2025
5d214eb
update prcxi
Xuwznln Jul 11, 2025
694a779
update prcxi registry
Xuwznln Jul 11, 2025
4456529
Update prcxi.py to fit the function in unilabos.
ElijahChang929 Jul 14, 2025
10cb645
不生成已配置action的动作,增加prcxi的debug模式
Xuwznln Jul 15, 2025
f9aae44
增加注册表版本参数,支持将auto-指令人工检查后非auto,不生成人工已检查的指令,取消不必要的description生成
Xuwznln Jul 15, 2025
540c5e9
增加注册表版本参数,支持将auto-指令人工检查后非auto,不生成人工已检查的指令,取消不必要的description生成
Xuwznln Jul 16, 2025
0593f98
Update prcxi.py
ElijahChang929 Jul 16, 2025
acf7b6d
修复了部分的protocol因为XDL更新导致的问题 (#61)
KCFeng425 Jul 16, 2025
c5efa5a
修复action移除时的报错,更新注册表
Xuwznln Jul 16, 2025
23cf713
Update prcxi.py
ElijahChang929 Jul 16, 2025
d81297d
Merge branch 'dev' of https://github.com/dptech-corp/Uni-Lab-OS into dev
ElijahChang929 Jul 16, 2025
71f6ded
Update prcxi.py
ElijahChang929 Jul 16, 2025
9c4fdd8
新增simulator
Xuwznln Jul 16, 2025
604d821
Update prcxi.py
ElijahChang929 Jul 16, 2025
f90be18
Update trash
ElijahChang929 Jul 16, 2025
e793ff6
Update prcxi.py
ElijahChang929 Jul 16, 2025
3584e92
Update prcxi.py
ElijahChang929 Jul 16, 2025
46b7ce2
Update for discard tips
ElijahChang929 Jul 16, 2025
31f59dc
Update prcxi.py
ElijahChang929 Jul 17, 2025
aaf33a8
Update PRCXI
ElijahChang929 Jul 17, 2025
0466b57
更新axis等参数
Xuwznln Jul 17, 2025
3f7b991
Update 9320
ElijahChang929 Jul 17, 2025
743ec88
get_well_container&get_tip_rack
Xuwznln Jul 17, 2025
2d30fb7
update
ElijahChang929 Jul 17, 2025
41c130e
Merge branch 'dev' of https://github.com/dptech-corp/Uni-Lab-OS into dev
ElijahChang929 Jul 17, 2025
6eaa8e1
Update 9320
ElijahChang929 Jul 17, 2025
8980828
update
ElijahChang929 Jul 17, 2025
f0de653
deck
Xuwznln Jul 17, 2025
0dc1154
更新注册表&增加资源,parent应为resources字段
Xuwznln Jul 17, 2025
9a8d50b
Update 9320
ElijahChang929 Jul 17, 2025
06e6d33
update
ElijahChang929 Jul 17, 2025
8dbea5d
Merge remote-tracking branch 'origin/dev' into dev
Xuwznln Jul 17, 2025
0bd3025
新增set liquid方法
Xuwznln Jul 17, 2025
5674e18
新增set liquid方法
Xuwznln Jul 17, 2025
00ced4d
action to resource & 0.9.12 (#64)
KCFeng425 Jul 17, 2025
2a686e6
modify prcxi
Xuwznln Jul 17, 2025
f1c7c96
Merge remote-tracking branch 'origin/dev' into dev
Xuwznln Jul 17, 2025
dde7086
0.9.12 update registry
Xuwznln Jul 18, 2025
5823ede
update
ElijahChang929 Jul 18, 2025
ad54308
Merge branch 'dev' of https://github.com/dptech-corp/Uni-Lab-OS into dev
ElijahChang929 Jul 18, 2025
c462540
update
ElijahChang929 Jul 18, 2025
3d97984
registry upadte
Xuwznln Jul 18, 2025
2c06f94
Update
ElijahChang929 Jul 18, 2025
de6584f
update
ElijahChang929 Jul 18, 2025
a95e4d4
container_for_nothing
Xuwznln Jul 18, 2025
84aeb69
mix
Xuwznln Jul 18, 2025
45eaf70
registry fix
Xuwznln Jul 18, 2025
c61c4aa
registry fix
Xuwznln Jul 18, 2025
9eb1f98
registry fix
Xuwznln Jul 18, 2025
736f557
Update
ElijahChang929 Jul 18, 2025
9327d59
Merge branch 'dev' of https://github.com/dptech-corp/Uni-Lab-OS into dev
ElijahChang929 Jul 18, 2025
dd89d00
Update prcxi.py
ElijahChang929 Jul 18, 2025
2b7da0e
SET TIP RACK
Xuwznln Jul 18, 2025
58bf649
bump version
Xuwznln Jul 18, 2025
73f33c8
update registry version & category
Xuwznln Jul 18, 2025
862f250
update set tip rack
Xuwznln Jul 18, 2025
ebe9e1b
yaml dump支持ordered dict,支持config_info
Xuwznln Jul 18, 2025
fd3dbcf
fix devices
Xuwznln Jul 18, 2025
4cd4086
fix resource check serialize
Xuwznln Jul 18, 2025
c2dfe68
fix: Protocol node resource run (#65)
TablewareBox Jul 18, 2025
fd18b21
采用http报送resource
Xuwznln Jul 19, 2025
3c9cca8
采用http报送resource
Xuwznln Jul 19, 2025
de4da95
update
ElijahChang929 Jul 19, 2025
826b04f
Merge branch 'dev' of https://github.com/dptech-corp/Uni-Lab-OS into dev
ElijahChang929 Jul 19, 2025
b08026f
Update .gitignore
ElijahChang929 Jul 19, 2025
34dd65d
bump version to 0.10.0
Xuwznln Jul 19, 2025
c57bb2a
Merge branch 'dev' of https://github.com/dptech-corp/Uni-Lab-OS into dev
Xuwznln Jul 19, 2025
1467b9a
default param simulator
Xuwznln Jul 19, 2025
98e9d09
slim
Xuwznln Jul 19, 2025
a8cf389
Update
ElijahChang929 Jul 19, 2025
27132bb
Merge branch 'dev' of https://github.com/dptech-corp/Uni-Lab-OS into dev
ElijahChang929 Jul 19, 2025
aac3c9d
Update for prcxi
ElijahChang929 Jul 19, 2025
30415ef
Update
ElijahChang929 Jul 19, 2025
81769d5
Update
ElijahChang929 Jul 19, 2025
03e8c1e
Refactor PRCXI9300Deck initialization and update plate configurations
ElijahChang929 Jul 19, 2025
5a2ea47
test
ElijahChang929 Jul 19, 2025
6ead71d
update
ElijahChang929 Jul 19, 2025
1a0b3b5
Update prcxi_9300.json
ElijahChang929 Jul 19, 2025
0c8c8d7
update
ElijahChang929 Jul 19, 2025
d611911
fix protocol_node communication transfer
TablewareBox Jul 20, 2025
3181671
修复注册表handles类型错误的问题
Xuwznln Jul 24, 2025
4d98e1c
物料添加失败应该直接raise ValueError,不要等待
Xuwznln Jul 24, 2025
badf402
更正注册表中的数字类型
Xuwznln Jul 24, 2025
d289c01
Delete unnecessary files.
ElijahChang929 Jul 24, 2025
1b086a8
新增lab_id直接传入
Xuwznln Jul 25, 2025
0584bd5
fix vessel_id param passing in protocols
TablewareBox Jul 25, 2025
c6ac32c
新增dll预载,保证部分设备可正常使用unilabos_msgs
Xuwznln Jul 25, 2025
2b3cec5
修复可能的web template找不到的问题
Xuwznln Jul 31, 2025
2580e80
修复可能的web template找不到的问题
Xuwznln Jul 31, 2025
b63e281
新增用户引导
Xuwznln Jul 31, 2025
dcc970a
Device visualization (#67)
q434343 Jul 31, 2025
ccf1cdc
更新注册表
Xuwznln Jul 31, 2025
65bf870
Merge remote-tracking branch 'origin/main' into dev
Xuwznln Jul 31, 2025
1aa7539
Merge remote-tracking branch 'origin/main' into dev
Xuwznln Jul 31, 2025
ed123db
fix build
Xuwznln Jul 31, 2025
fab90f0
更新启动逻辑
Xuwznln Aug 1, 2025
b6a23ef
更新环境变量级别
Xuwznln Aug 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion recipes/ros-humble-unilabos-msgs/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ requirements:
- robostack-staging::ros-humble-rosidl-default-runtime
- robostack-staging::ros-humble-std-msgs
- robostack-staging::ros-humble-geometry-msgs
- robostack-staging::ros2-distro-mutex=0.6.*
# - robostack-staging::ros2-distro-mutex=0.6.*
- sel(osx and x86_64): __osx >={{ MACOSX_DEPLOYMENT_TARGET|default('10.14') }}
39 changes: 23 additions & 16 deletions unilabos/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,24 @@ def main():

# 加载配置文件,优先加载config,然后从env读取
config_path = args_dict.get("config")
working_dir = os.path.abspath(os.path.join(os.getcwd(), "unilabos_data"))
if not config_path and (not os.path.exists(working_dir) or not os.path.exists(os.path.join(working_dir, "local_config.py"))):
print_status(f"当前未指定config路径,非第一次使用请通过 --config 传入 local_config.py 文件路径", "info")
print_status(f"您是否为第一次使用?并将当前文件路径 {working_dir} 作为工作目录? (Y/n)", "info")
if os.getcwd().endswith("unilabos_data"):
working_dir = os.path.abspath(os.getcwd())
else:
working_dir = os.path.abspath(os.path.join(os.getcwd(), "unilabos_data"))
if args_dict.get("working_dir"):
working_dir = args_dict.get("working_dir")
if config_path and not os.path.exists(config_path):
config_path = os.path.join(working_dir, "local_config.py")
if not os.path.exists(config_path):
print_status(
f"当前工作目录 {working_dir} 未找到local_config.py,请通过 --config 传入 local_config.py 文件路径",
"error")
os._exit(1)
elif os.path.exists(working_dir) and os.path.exists(os.path.join(working_dir, "local_config.py")):
config_path = os.path.join(working_dir, "local_config.py")
elif not config_path and (not os.path.exists(working_dir) or not os.path.exists(os.path.join(working_dir, "local_config.py"))):
print_status(f"未指定config路径,可通过 --config 传入 local_config.py 文件路径", "info")
print_status(f"您是否为第一次使用?并将当前路径 {working_dir} 作为工作目录? (Y/n)", "info")
if input() != "n":
os.makedirs(working_dir, exist_ok=True)
config_path = os.path.join(working_dir, "local_config.py")
Expand All @@ -153,16 +167,8 @@ def main():
os._exit(1)
else:
os._exit(1)
else:
working_dir = args_dict.get("working_dir") or os.path.abspath(os.path.join(os.getcwd(), "unilabos_data"))
if working_dir:
if config_path and not os.path.exists(config_path):
config_path = os.path.join(working_dir, "local_config.py")
if not os.path.exists(config_path):
print_status(f"当前工作目录 {working_dir} 未找到local_config.py,请通过 --config 传入 local_config.py 文件路径", "error")
os._exit(1)
print_status(f"当前工作目录为 {working_dir}", "info")
# 加载配置文件
print_status(f"当前工作目录为 {working_dir}", "info")
load_config_from_file(config_path, args_dict["labid"])

# 设置BasicConfig参数
Expand Down Expand Up @@ -204,10 +210,11 @@ def main():
print_status("联网获取设备加载文件成功", "info")
graph, data = read_node_link_json(request_startup_json)
else:
if args_dict["graph"].endswith(".json"):
graph, data = read_node_link_json(args_dict["graph"])
file_path = args_dict["graph"]
if file_path.endswith(".json"):
graph, data = read_node_link_json(file_path)
else:
graph, data = read_graphml(args_dict["graph"])
graph, data = read_graphml(file_path)
import unilabos.resources.graphio as graph_res

graph_res.physical_setup_graph = graph
Expand Down
5 changes: 3 additions & 2 deletions unilabos/app/web/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
提供与远程服务器通信的客户端功能,只有host需要用
"""
import json
import os
from typing import List, Dict, Any, Optional

import requests
from unilabos.utils.log import info
from unilabos.config.config import MQConfig, HTTPConfig
from unilabos.config.config import MQConfig, HTTPConfig, BasicConfig
from unilabos.utils import logger


Expand Down Expand Up @@ -189,7 +190,7 @@ def request_startup_json(self) -> Optional[Dict[str, Any]]:
logger.error(f"请求启动配置失败: {response.status_code}, {response.text}")
else:
try:
with open("startup_config.json", "w", encoding="utf-8") as f:
with open(os.path.join(BasicConfig.working_dir, "startup_config.json"), "w", encoding="utf-8") as f:
f.write(response.text)
target_dict = json.loads(response.text)
if "data" in target_dict:
Expand Down
5 changes: 3 additions & 2 deletions unilabos/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ def _update_config_from_env():
def load_config(config_path=None, override_labid=None):
# 如果提供了配置文件路径,从该文件导入配置
if config_path:
_update_config_from_env() # 允许config_path被env设定后读取
env_config_path = os.environ.get("UNILABOS.BASICCONFIG.CONFIG_PATH")
config_path = env_config_path if env_config_path else config_path
BasicConfig.config_path = os.path.abspath(os.path.dirname(config_path))
if not os.path.exists(config_path):
logger.error(f"[ENV] 配置文件 {config_path} 不存在")
exit(1)

try:
module_name = "lab_" + os.path.basename(config_path).replace(".py", "")
spec = importlib.util.spec_from_file_location(module_name, config_path)
Expand All @@ -179,6 +179,7 @@ def load_config(config_path=None, override_labid=None):
spec.loader.exec_module(module) # type: ignore
_update_config_from_module(module, override_labid)
logger.info(f"[ENV] 配置文件 {config_path} 加载成功")
_update_config_from_env()
except Exception as e:
logger.error(f"[ENV] 加载配置文件 {config_path} 失败")
traceback.print_exc()
Expand Down
6 changes: 3 additions & 3 deletions unilabos/config/example_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class MQConfig:
broker_url = ""
port = 1883

ca_file = "CA.crt"
cert_file = "lab.crt"
key_file = "lab.key"
ca_file = "./CA.crt"
cert_file = "./lab.crt"
key_file = "./lab.key"

# HTTP配置
class HTTPConfig:
Expand Down
Loading