-
Notifications
You must be signed in to change notification settings - Fork 146
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
[launch] consider refactoring ExecuteProcess into Execute and Executable #114
Comments
I thought a little bit about this, and about how it would look in the new frontends (examples only in XML here). I would have the following classes:
For XML (or other frontend), I think we should check the parent entity and behave differently according to that. <node ATTRIBUTES_FOR_EXECUTION_EXECUTABLE_AND_NODE_DESCRIPTION/>
<execute_remotely ATTRIBUTES_FOR EXECUTION>
<node ATTRIBUTES_FOR_EXECUTABLE_AND_NODE_DESCRIPTION/>
<multi_node ATTRIBUTES_FOR_EXECUTABLE>
<node ATTRIBUTES_FOR_DESCRIBING_A_NODE/>
<node ATTRIBUTES_FOR_DESCRIBING_A_NODE/>
</multi_node>
</execute_remotely> So in each case the tag may accept different attributes, but it would be less verbose. |
I've been working with the guys who are putting together ideas for Multi-machine launching (ros2/design#255), and wanted to follow up on some of the feedback there. I saw the mention of this issue, and I'd like to see if we can help on getting some of this work done, and figure out how to use this concept for our remote execution needs. Also want to make sure we don't start running with ideas that have been obsoleted by other changes. There are good notes above from both @wjwwood and @ivanpauno; does everything here still feel current? Also, there's discussion in the FP about some changes to how things would be called, for instance:
Are there any concerns about breaking changes and backward compatibility in this area? |
Yes. It should be done in a backwards compatible way. i.e.: The I think that everything previously commented here still stands. If you need any extra input for the design of the API, please let me know and I will try to help. |
@ivanpauno Finally had some time to dig into this and learn quite a bit more about how things are structured. I'm not sure if this is in quite the format you were wanting, but we've put together some thoughts about how to approach this. I've created a document in a fork of the design repo, but I'm not sure the document itself needs to be pulled there. Just needed a place to park some thoughts. Take a look to see if things are on the right track; if you'd like me to move this somewhere else, I certainly can. Also, (and this is probably a little premature) assuming we eventually get to the point of implementing the refactor, can you point me to the appropriate unit tests so I can make sure to update them/add new ones as appropriate? |
@roger-strain Thanks for working on this! I had a quick look, here some comments:
I think that before continuing the discussion, it would be good to open a PR in |
@ivanpauno Is the document naming/formatting okay for a PR as is? I can go set that up now if it looks like it's in good enough format for that discussion. |
This issue has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-2-tsc-meeting-minutes-2020-07-16/15468/1 |
Part of implementation of refactor for ros2#114 Distro A; OPSEC #2893 Signed-off-by: Roger Strain <rstrain@swri.org>
Part of implementation of refactor for ros2#114 Distro A; OPSEC #2893 Signed-off-by: Roger Strain <rstrain@swri.org>
Part of implementation of refactor for ros2#114 Distro A; OPSEC #2893 Signed-off-by: Roger Strain <rstrain@swri.org>
Part of implementation of refactor for ros2#114 Distro A; OPSEC #2893 Signed-off-by: Roger Strain <rstrain@swri.org>
Part of implementation of refactor for ros2#114 Distro A; OPSEC #2893 Signed-off-by: Roger Strain <rstrain@swri.org>
* Adding Executable description class Part of implementation of refactor for #114 Distro A; OPSEC #2893 Signed-off-by: Roger Strain <rstrain@swri.org> * Cleaned up access to substituted values Modified handling of cmd parameter as described in #263 Distro A; OPSEC #2893 Signed-off-by: Roger Strain <rstrain@swri.org> * Initial implementation of execute_local Distro A; OPSEC #4584 Signed-off-by: Roger Strain <rstrain@swri.org> * Fixed minor bugs to verify unit tests Distro A; OPSEC #4584 Signed-off-by: Roger Strain <rstrain@swri.org> * Unit test fixes Distro A; OPSEC #4584 Signed-off-by: Roger Strain <rstrain@swri.org> * Adjust for launch_ros modifications, add unit tests Distro A; OPSEC #4584 Signed-off-by: Roger Strain <rstrain@swri.org> * Apply minor updates to address feedback Distro A; OPSEC #4584 Signed-off-by: Roger Strain <rstrain@swri.org> * Refactor arguments to apply to executable Distro A; OPSEC #4584 Signed-off-by: Roger Strain <rstrain@swri.org> * Fix order of parameters Distro A; OPSEC #4584 Signed-off-by: Roger Strain <rstrain@swri.org> * Fixed default log name prefix Distro A; OPSEC #4584 Signed-off-by: Roger Strain <rstrain@swri.org> * Fix unit tests Distro A; OPSEC #4584 Signed-off-by: Roger Strain <rstrain@swri.org> * Removed some language from file headers Distro A, OPSEC #4584. You may have additional rights; please see https://rosmilitary.org/faq/?category=ros-2-license Signed-off-by: matthew.lanting <mlanting@dcscorp.com> * Add prefix filtering to Executable description class. Distro A, OPSEC #4584. You may have additional rights; please see https://rosmilitary.org/faq/?category=ros-2-license Signed-off-by: matthew.lanting <mlanting@dcscorp.com> * Formatting fixes. Distro A, OPSEC #4584. You may have additional rights; please see https://rosmilitary.org/faq/?category=ros-2-license Signed-off-by: matthew.lanting <mlanting@dcscorp.com> * Fixed indentation in descriptions/executable.py. Distro A, OPSEC #4584. You may have additional rights; please see https://rosmilitary.org/faq/?category=ros-2-license Signed-off-by: matthew.lanting <mlanting@dcscorp.com> * Fixed namechange missed during rebase. Distro A, OPSEC #4584. You may have additional rights; please see https://rosmilitary.org/faq/?category=ros-2-license Signed-off-by: matthew.lanting <mlanting@dcscorp.com> Co-authored-by: Roger Strain <rstrain@swri.org> Co-authored-by: matthew.lanting <mlanting@dcscorp.com>
I believe it might be wise to separate the description of a process to be executed and its state while running from the Action which executes it.
Currently all of this information is encapsulated in the
ExecuteProcess
action, and my proposal would be to replace that with an action calledExecute
that takes anExecutable
(not an action or launch description entity, just a new kind of class). TheExecutable
would contain any information needed byExecute
to actually execute the executable described or introspect it. There could be sub classes of bothExecute
andExecutable
. For instance, a sub class ofExecutable
might beNode
orLifecycleNode
, and a sub class ofExecute
might beExecuteRemotely
(execute on a different machine).The reasons for doing this include:
Executable
s (or subclasses thereof) with other actionsExecuteProcess
class is really big now and it would be nice to break into smaller partsExecute(Executable(...))
orExecute(Node(...))
rather thanExecuteProcess(...)
andNode(...)
The first reason is the most impactful, because it allows for a few use cases that aren't currently easy to implement:
Executable
instances and later decide whether to pass toExecute
,ExecuteRemotely
, orExecuteInDocker
(just ideas)ComponentNode
(possibly a subclass ofExecutable
which represents a node that can be loaded dynamically) to eitherExecute()
orExecuteNodesInSharedProcess()
(name needs work)ComponentNode
instances and run them all in a single processI still have some design questions in mind, like:
Node
inherit fromExecutable
Executable
contain process related things likepid
and produce events for stdout and process exit, etc...Process
that also inherits fromExecutable
Node
might not be associated with a process, or rather a process might not be associated with a singleNode
Executable
andExecute
?Execute
?The text was updated successfully, but these errors were encountered: