feat: phase 6 webbridge + generic workflow (resource slots, security, bellhop/kraken/ram assets)
这个提交包含在:
@@ -181,7 +181,7 @@ def show_algo_library():
|
||||
col1, col2, col3 = st.columns(3)
|
||||
col1.metric("Python", "✅ 可用")
|
||||
col2.metric("MATLAB/Octave", "✅ 可用" if "matlab" in available_types else "❌ 不可用")
|
||||
col3.metric("C++ 编译器", "✅ 可用" if "cpp" in available_types else "❌ 不可用")
|
||||
col3.metric("C++ 运行时", "✅ 可用" if "cpp" in available_types else "❌ 不可用")
|
||||
st.json(env)
|
||||
|
||||
st.subheader("已注册算法")
|
||||
@@ -406,7 +406,11 @@ def show_scheduling():
|
||||
|
||||
if algo_type == "python":
|
||||
try:
|
||||
algo_func = load_algo_func(algo.get("module", ""), algo.get("function", ""))
|
||||
algo_func = load_algo_func(
|
||||
algo.get("module", ""),
|
||||
algo.get("function", ""),
|
||||
expected_sha256=algo.get("sha256") or None,
|
||||
)
|
||||
except Exception as e:
|
||||
st.error(f"算法加载失败:{algo.get('name', '<unknown>')} - {e}")
|
||||
st.stop()
|
||||
@@ -430,6 +434,8 @@ def show_scheduling():
|
||||
preprocessing=preprocessing,
|
||||
requirements=algo.get("inputs") or {}, # 包含 argtypes/restype 如果在 JSON 中定义
|
||||
output_specs=algo.get("outputs") or {},
|
||||
expected_sha256=algo.get("sha256") or None,
|
||||
isolate=bool(algo.get("isolate", False)),
|
||||
)
|
||||
elif algo_type == "matlab":
|
||||
from src.bridges import MatlabBridge
|
||||
@@ -442,6 +448,20 @@ def show_scheduling():
|
||||
preprocessing=preprocessing,
|
||||
requirements=algo.get("inputs") or {},
|
||||
output_specs=algo.get("outputs") or {},
|
||||
expected_sha256=algo.get("sha256") or None,
|
||||
)
|
||||
elif algo_type == "web":
|
||||
from src.bridges import WebBridge
|
||||
bridge = WebBridge(
|
||||
algo["name"],
|
||||
algo.get("endpoint", ""),
|
||||
in_map,
|
||||
out_map,
|
||||
method=algo.get("method", "POST"),
|
||||
timeout_sec=algo.get("timeout_sec", 300),
|
||||
slot_key=algo.get("slot_key"),
|
||||
fixed_params=algo.get("fixed_params"),
|
||||
sanitize_output=algo.get("sanitize_output", True),
|
||||
)
|
||||
else:
|
||||
st.warning(f"暂不支持的算法类型: {algo_type}")
|
||||
|
||||
在新工单中引用
屏蔽一个用户