Singularity/Apptainer integration for Styx compiled wrappers
Project description
Singularity/Apptainer Runner for Styx compiled wrappers
styxsingularity
is a Python package that provides Singularity/Apptainer integration for Styx compiled wrappers. It allows you to run Styx functions within Singularity containers, offering improved isolation and reproducibility for your workflows.
Installation
You can install styxsingularity
using pip:
pip install styxsingularity
Usage
from styxdefs import set_global_runner
from styxsingularity import SingularityRunner
# Initialize the SingularityRunner with your container images
runner = SingularityRunner(
images={
"ubuntu:20.04": "/path/to/ubuntu_20.04.sif",
"python:3.9": "/path/to/python_3.9.sif"
}
)
# Set the global runner for Styx
set_global_runner(runner)
# Now you can use any Styx functions as usual, and they will run in Singularity containers
Advanced Configuration
The SingularityRunner
class accepts several parameters for advanced configuration:
images
: A dictionary mapping container image tags to their local pathssingularity_executable
: Path to the Singularity executable (default:"singularity"
)data_dir
: Directory for temporary data storageenviron
: Environment variables to set in the container
Example:
runner = SingularityRunner(
images={"ubuntu:20.04": "/path/to/ubuntu_20.04.sif"},
singularity_executable="/usr/local/bin/singularity",
data_dir="/tmp/styx_data",
environ={"PYTHONPATH": "/app/lib"}
)
Error Handling
styxsingularity
provides a custom error class, StyxSingularityError
, which is raised when a Singularity execution fails. This error includes details about the return code, command arguments, and Singularity arguments for easier debugging.
Contributing
Contributions to styxsingularity
are welcome! Please refer to the GitHub repository for information on how to contribute, report issues, or submit pull requests.
License
styxsingularity
is released under the MIT License. See the LICENSE file for details.
Documentation
For detailed API documentation, please visit our API Docs.
Support
If you encounter any issues or have questions, please open an issue on the GitHub repository.
Requirements
- Python 3.10+
- Singularity or Apptainer installed and running on your system
Comparison with styxdocker
While styxdocker
and styxsingularity
serve similar purposes, they have some key differences:
- Container Technology:
styxdocker
uses Docker, whilestyxsingularity
uses Singularity/Apptainer. - Platform Support:
styxdocker
works on Windows, Linux, and macOS, whereasstyxsingularity
is not supported on Windows. - User Permissions:
styxdocker
can run containers as the current user on POSIX systems, which can help with file permission issues.
Choose the package that best fits your infrastructure and requirements.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file styxsingularity-0.2.0.tar.gz
.
File metadata
- Download URL: styxsingularity-0.2.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dec49c8112ac444d4cc7f79f29fc2dcc0e30e57e9d79a90d42b57e235d376822 |
|
MD5 | 2efaf046f9a1a334f1afa0e45f761960 |
|
BLAKE2b-256 | 058afa4cb8825e9cbcac67b65d108abb2130ab5d800c4def6397533941252951 |
File details
Details for the file styxsingularity-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: styxsingularity-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 082621124d472adbba0102b790ecfcced15e0bd8c2c60ef4b17f7e6738d7979c |
|
MD5 | 4b09e3f5027a8cdf94a88946018e268b |
|
BLAKE2b-256 | 75a14bf82f84b1270adb8f1a05dae5505540ef4d04d478a55f22ee828f54e472 |