linux_isolate_process package from linux_isolate_process repolinux_isolate_process |
|
Package Summary
Tags | No category tags. |
Version | 0.0.2 |
License | Apache-2.0 |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/adityapande-1995/linux_isolate_process.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2024-01-31 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- adityapande
Authors
linux_isolate_process
Isolates any given process using the unshare()
system call. Suited for ROS, though can work for any process.
Since the system call is linux specific, this would not work on Windows.
This can be really useful for running a large number of tests in parallel wihtout having them interacting with each other.
This is similar to ROS domain IDs, though domain IDs are limited by the number of ports you have, and this approach is more scalable.
Originally added in drake-ros
Installation
This is a python ROS2 package, and requires colcon to be installed.
1. From source
mkdir ~/my_ws
cd ~/my_ws ; mkdir src ; cd src
git clone https://github.com/adityapande-1995/linux_isolate_process
cd ~/my_ws
colcon build
Usage
1. This command can now be used as a commandline tool:
source ~/my_ws/install/setup.bash
python3 -m linux_isolate_process <your command>
# For e.g., to get a bash shell that is isolated
python3 -m linux_isolate_process /bin/bash
For example, to run an isolated talker (Note : any ros nodes inside the bash -c "(<command>)"
will be able to talk to each other) :
python3 -m linux_isolate_process /bin/bash -c "ros2 run demo_nodes_cpp talker"
If you open another terminal and run a listener normally, using
ros2 run demo_nodes_cpp listener
it will not receive any of the messages published by the talker. However, if you run the talker and listener in the same process, they will be able to talk to each other. That is, this should work perfectly fine :
python3 -m linux_isolate_process /bin/bash -c "ros2 run demo_nodes_cpp talker & ros2 run demo_nodes_cpp listener"
The talker and listener in this case are “isolated together”, and hence can talk to each other.
2. This can also be used as a module, to isolate the current process:
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import linux_isolate_process as i
>>> i.create_linux_namespaces()
True
>>> # Any ros2 nodes run here would be isolated
Changelog for package linux_isolate_process
0.0.2 (2024-01-29)
- 0.0.1
- Removed entry points
- Added main
- Updated readme
- Update README.md
- Updated package.xml
- Changed to a ROS package
- Updated name
- Updated project name
- Updated toml
- Update pyproject.toml
- Update setup.py
- Update README.md
- Update README.md
- Update README.md
- Added toml file
- Create LICENSE
- Changed name of the tool to linux_isolate_process
- Update README.md
- Update README.md
- Update README.md
- Can use as a module
- Check os before execution
- Update isolate.py
- Update README.md
- Update README.md
- Added the basic script
- Initial commit
- Contributors: Aditya Pande
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_copyright | |
ament_flake8 | |
ament_pep257 |
System Dependencies
Name |
---|
python3-pytest |
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged linux_isolate_process at Robotics Stack Exchange
linux_isolate_process package from linux_isolate_process repolinux_isolate_process |
|
Package Summary
Tags | No category tags. |
Version | 0.0.2 |
License | Apache-2.0 |
Build type | AMENT_PYTHON |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/adityapande-1995/linux_isolate_process.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2024-01-31 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- adityapande
Authors
linux_isolate_process
Isolates any given process using the unshare()
system call. Suited for ROS, though can work for any process.
Since the system call is linux specific, this would not work on Windows.
This can be really useful for running a large number of tests in parallel wihtout having them interacting with each other.
This is similar to ROS domain IDs, though domain IDs are limited by the number of ports you have, and this approach is more scalable.
Originally added in drake-ros
Installation
This is a python ROS2 package, and requires colcon to be installed.
1. From source
mkdir ~/my_ws
cd ~/my_ws ; mkdir src ; cd src
git clone https://github.com/adityapande-1995/linux_isolate_process
cd ~/my_ws
colcon build
Usage
1. This command can now be used as a commandline tool:
source ~/my_ws/install/setup.bash
python3 -m linux_isolate_process <your command>
# For e.g., to get a bash shell that is isolated
python3 -m linux_isolate_process /bin/bash
For example, to run an isolated talker (Note : any ros nodes inside the bash -c "(<command>)"
will be able to talk to each other) :
python3 -m linux_isolate_process /bin/bash -c "ros2 run demo_nodes_cpp talker"
If you open another terminal and run a listener normally, using
ros2 run demo_nodes_cpp listener
it will not receive any of the messages published by the talker. However, if you run the talker and listener in the same process, they will be able to talk to each other. That is, this should work perfectly fine :
python3 -m linux_isolate_process /bin/bash -c "ros2 run demo_nodes_cpp talker & ros2 run demo_nodes_cpp listener"
The talker and listener in this case are “isolated together”, and hence can talk to each other.
2. This can also be used as a module, to isolate the current process:
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import linux_isolate_process as i
>>> i.create_linux_namespaces()
True
>>> # Any ros2 nodes run here would be isolated
Changelog for package linux_isolate_process
0.0.2 (2024-01-29)
- 0.0.1
- Removed entry points
- Added main
- Updated readme
- Update README.md
- Updated package.xml
- Changed to a ROS package
- Updated name
- Updated project name
- Updated toml
- Update pyproject.toml
- Update setup.py
- Update README.md
- Update README.md
- Update README.md
- Added toml file
- Create LICENSE
- Changed name of the tool to linux_isolate_process
- Update README.md
- Update README.md
- Update README.md
- Can use as a module
- Check os before execution
- Update isolate.py
- Update README.md
- Update README.md
- Added the basic script
- Initial commit
- Contributors: Aditya Pande
Wiki Tutorials
Package Dependencies
Deps | Name |
---|---|
ament_copyright | |
ament_flake8 | |
ament_pep257 |
System Dependencies
Name |
---|
python3-pytest |