cluster4npu/debug_deployment.py
HuangMason320 1781a05269 feat: Add multi-series configuration testing and debugging tools
- Add comprehensive test scripts for multi-series dongle configuration
- Add debugging tools for deployment and flow testing
- Add configuration verification and guide utilities
- Fix stdout/stderr handling in deployment dialog for PyInstaller builds
- Includes port ID configuration tests and multi-series config validation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-21 00:31:45 +08:00

58 lines
1.9 KiB
Python

#!/usr/bin/env python3
"""
Debug deployment error
"""
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
def simulate_deployment():
"""Simulate the deployment process to find the Optional error"""
try:
print("Testing export_pipeline_data equivalent...")
# Simulate creating a node and getting properties
from core.nodes.exact_nodes import ExactModelNode
# This would be similar to what dashboard does
node = ExactModelNode()
print("Node created")
# Check if node has get_business_properties
if hasattr(node, 'get_business_properties'):
print("Node has get_business_properties")
try:
props = node.get_business_properties()
print(f"Properties extracted: {type(props)}")
except Exception as e:
print(f"Error in get_business_properties: {e}")
import traceback
traceback.print_exc()
# Test the mflow converter directly
print("\nTesting MFlowConverter...")
from core.functions.mflow_converter import MFlowConverter
converter = MFlowConverter(default_fw_path='.')
print("MFlowConverter created successfully")
# Test multi-series config building
test_props = {
'multi_series_mode': True,
'enabled_series': ['520', '720'],
'kl520_port_ids': '28,32',
'kl720_port_ids': '4'
}
config = converter._build_multi_series_config_from_properties(test_props)
print(f"Multi-series config: {config}")
print("All tests passed!")
except Exception as e:
print(f"Error: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
simulate_deployment()