ProcMan: dedicated gRPC message types#501
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes generic Any-packed messages from the ProcessManager gRPC interface in favor of dedicated message types. The change simplifies the gRPC communication by using strongly-typed messages directly instead of wrapping them in generic Any containers.
Key changes:
- Updated ProcessManager gRPC service methods to use dedicated message types instead of Any-packed payloads
- Refactored driver classes to directly handle typed gRPC requests and responses
- Modified return types to consistently use ProcessInstanceList for batch operations
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/drunc/utils/shell_utils.py | Removed aio_channel support and simplified response handling |
| src/drunc/utils/grpc_utils.py | Added handle_grpc_error and copy_token utility functions |
| src/drunc/unified_shell/shell.py | Updated to handle typed responses without data wrapping |
| src/drunc/unified_shell/commands.py | Modified to access values directly from ProcessInstanceList |
| src/drunc/session_manager/session_manager_driver.py | Refactored to use dedicated message types and direct gRPC calls |
| src/drunc/session_manager/session_manager.py | Removed session field from Description response |
| src/drunc/process_manager/ssh_process_manager.py | Updated to return properly structured ProcessInstanceList responses |
| src/drunc/process_manager/process_manager_driver.py | Complete refactoring to use typed gRPC requests/responses |
| src/drunc/process_manager/process_manager.py | Removed Any message unpacking and simplified service methods |
| src/drunc/process_manager/k8s_process_manager.py | Updated to return ProcessInstanceList consistently |
| src/drunc/process_manager/interface/shell.py | Modified to access Description fields directly |
| src/drunc/process_manager/interface/context.py | Disabled aio_channel usage |
| src/drunc/process_manager/interface/commands.py | Updated to handle ProcessInstanceList responses |
| src/drunc/controller/controller_driver.py | Simplified constructor and removed create_stub method |
|
Some PM commands do not work in unified shell, ie:
I am using ssh-standalone and local-1x1-config |
Thanks @wanyunSu. Good spot. Should be fixed now. |
|
Thanks, PM commands work now, but sequence commands do not work:
|
|
Cheers again. A sneaky one. Fixed. Might be worth us having a chat to discuss your testing process. Seems mine is a bit lacking! ED: Oh, and the accompanying druncschema change: DUNE-DAQ/druncschema#59 |
|
LGTM. My testing process is simply to execute the Process manager commands and FSM commands, using both the local and ehn1 configurations, to ensure that all commands behave as expected. |
|
@wanyunSu @jamesturner246 has the testing finished succesfully? |
|
All good my end. |
|
LGTM |
|
I ran the MSQT which passed, but when I run the unified shell manually there are some issues. Using the following commands I see issues: Before this gets merged, I think it would be useful to define additional tests - the basic tests do not cover all the bases |
|
The reported issues were found to be independent of this PR, they are being investigated now |
|
Thanks @jamesturner246 |
Resolves #495.
This is the second in a series of changes replacing the generic Any-packed messages with dedicated ones. In this change, the
ProcessManageris addressed. Took a bit longer than expected -- I wanted to be sure that I wasn't accidentally leaving something out. Might need a quick chat to step through the changes.I am working on separating the 'drivers' out into separate classes, since caveats in each driver type make subclassing more messier than not. Even the gRPC stub classes are not covariant.
NB: As for which messages, I just used existing ones for now, and left deciding on a proper set of messages for later. Token can be omitted from these messages as we can pass this information in via metadata, as intended.