Skip to main content

Singularity/Apptainer integration for Styx compiled wrappers.

Project description

Singularity/Apptainer Runner for Styx compiled wrappers

Build codecov Ruff stability-stable MIT License pages

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
runner = SingularityRunner()

# 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:

  • image_overrides: A dictionary to override container image tags
  • singularity_executable: Path to the Singularity executable (default: "singularity")
  • data_dir: Directory for temporary data storage
  • environ: Environment variables to set in the container

Example:

runner = SingularityRunner(
    image_overrides={"python:3.9": "my-custom-python:3.9"},
    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, while styxsingularity uses Singularity/Apptainer.
  • Platform Support: styxdocker works on Windows, Linux, and macOS, whereas styxsingularity 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


Download files

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

Source Distribution

styxsingularity-0.8.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

styxsingularity-0.8.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file styxsingularity-0.8.0.tar.gz.

File metadata

  • Download URL: styxsingularity-0.8.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for styxsingularity-0.8.0.tar.gz
Algorithm Hash digest
SHA256 7441c5920c18bc09948fe2249e1ad92755355663d935a273dc8a0538282186b7
MD5 9df8514045ad20472e220cdbf2384412
BLAKE2b-256 b0ae238d06494cd1c205ddb1d8e44a9d357c5c532fb0b22c91160145bbf955c2

See more details on using hashes here.

File details

Details for the file styxsingularity-0.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for styxsingularity-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 add16066b48ebd3145259729665b65e68ddf7ce669ee222d94f2130c63666ef7
MD5 51e411675cac3a3e53c29b8e38840e40
BLAKE2b-256 9ada407cd18cbef5eb2d79af61eaa29c1f9656a791e6229936e5d4be04650fcd

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