Skip to main content

A package to isolate linux processes

Project description

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

1. From PYPI

pip install linux_isolate_process

2. From source

git clone https://github.com/adityapande-1995/linux_isolate_process
cd linux_isolate_process
pip install .

Usage

1. This command can now be used as a commandline tool:

linux_isolate_process <your command>

For example, to run an isolated talker (Note : any ros nodes inside the bash -c "(<command>)" will be able to talk to each other) :

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.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linux_isolate_process-0.1.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linux_isolate_process-0.1.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file linux_isolate_process-0.1.3.tar.gz.

File metadata

  • Download URL: linux_isolate_process-0.1.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for linux_isolate_process-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3fa3828e69fe7573d3fdbafa530a477812eb2a56b2c789e4fa2aafa189df5da4
MD5 7d61cb582affd8e90fd9360ae56d577f
BLAKE2b-256 d288204b8b525419a5ba7c48e14cb36de9da50025e62d38ec55de82c0f049aef

See more details on using hashes here.

File details

Details for the file linux_isolate_process-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for linux_isolate_process-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ce1b96ebde5943fb0d1dc7fe4e029e00be8412101b4df9fbb4ed9ab35f710a1a
MD5 50fcddb4d8d0ca59a5e725b78e3a0c6d
BLAKE2b-256 05988b255d72293ff03009cf8f90bc79433e34b766f029402ea44c65edee43b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page