Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tech Design UML] Design of agent capability discovery #422

Merged
merged 10 commits into from
Apr 12, 2023
86 changes: 86 additions & 0 deletions agent/doc/UML/agent_device_management_design.puml
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,90 @@ LinuxScanner -u-|> EnvCapabilityScanner
MacOSScanner -u-|> EnvCapabilityScanner

EnvCapabilityScanner .. EnvCapability: produce
@enduml

@startuml agent_capability_design

class AgentManagementService {
EnvInfo envInfo;
List<AgentFunctionAvailability> functionAvailabilities;
registerFunctionAvailability(String serviceName,ServiceType,boolean isEnabled, List<EnvCapabilityRequirement>)
}
AgentManagementService -r-> EnvCapabilityDiscoveryService
class TestRunner{
List<EnvCapabilityRequirement>
}
class DeviceDriver{
List<EnvCapabilityRequirement>
}

TestRunner -r-> AgentManagementService
DeviceDriver -r-> AgentManagementService
TestRunner --> EnvCapabilityRequirement
DeviceDriver --> EnvCapabilityRequirement

class EnvCapabilityRequirement{
+private boolean isReady
+EnvCapability envCapability
+boolean meet(EnvCapability envCapability)
}
enum AgentFunctionType{
TEST_RUNNER
DEVICE_DRIVER
}
zhou9584 marked this conversation as resolved.
Show resolved Hide resolved
class AgentFunctionAvailability{
+AgentFunctionType functionType
+String functionName
+List<EnvCapabilityRequirement> envCapabilityRequirements
+boolean enabled
+boolean available
}
AgentManagementService -->AgentFunctionAvailability
AgentFunctionAvailability ..> AgentFunctionType
class AgentUser{
List<AgentFunctionAvailability> functionAvailabilities;
}
AgentManagementService ..> AgentUser : provide
@enduml

@startuml agent_capability_design_sequence
participant SpringContainer
participant EnvCapabilityDiscoveryService
participant AgentManagementService
participant DeviceDriverManager
participant TestRunner
participant AgentWebSocketClientService
participant CenterApplication

activate SpringContainer
activate CenterApplication
SpringContainer --> EnvCapabilityDiscoveryService : createBean
activate EnvCapabilityDiscoveryService
EnvCapabilityDiscoveryService --> EnvCapabilityDiscoveryService : discoverEnvCapability
SpringContainer --> AgentManagementService : createBean
activate AgentManagementService
EnvCapabilityDiscoveryService --> AgentManagementService : provideEnvCapability
deactivate EnvCapabilityDiscoveryService
zhou9584 marked this conversation as resolved.
Show resolved Hide resolved
SpringContainer --> DeviceDriverManager : createDriverManager
activate DeviceDriverManager
DeviceDriverManager --> DeviceDriverManager : add deviceDrivers
deactivate DeviceDriverManager
SpringContainer --> AgentManagementService : registerDriverAvailability

SpringContainer --> TestRunner : createBean
activate TestRunner
TestRunner --> TestRunner : init
TestRunner --> AgentManagementService : registerRunnerAvailability
deactivate TestRunner
SpringContainer --> AgentWebSocketClientService : createBean
activate AgentWebSocketClientService
AgentWebSocketClientService --> AgentWebSocketClientService : buildAgentUser
AgentWebSocketClientService --> AgentManagementService : getServiceAvailabilities
AgentManagementService --> AgentWebSocketClientService : return serviceAvailabilities
deactivate AgentManagementService
AgentWebSocketClientService --> CenterApplication : provide agent info
CenterApplication --> CenterApplication : display agent info
deactivate CenterApplication
deactivate AgentWebSocketClientService
deactivate SpringContainer
@enduml
Binary file added docs/images/UML/agent_capability_design.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.