Skip to main content

Docker Runner for Styx compiled wrappers

Build codecov Ruff stability-stable MIT License pages

styxdocker is a Python package that provides Docker integration for Styx compiled wrappers. It allows you to run Styx functions within Docker containers, offering improved isolation and reproducibility for your workflows.

Installation

You can install styxdocker using pip:

pip install styxdocker

Usage

Here's a basic example of how to use styxdocker:

from styxdefs import set_global_runner
from styxdocker import DockerRunner

# Initialize the DockerRunner
runner = DockerRunner()

# Set the global runner for Styx
set_global_runner(runner)

# Now you can use any Styx functions as usual, and they will run in Docker containers

Advanced Configuration

The DockerRunner class accepts several parameters for advanced configuration:

  • image_overrides: A dictionary to override container image tags
  • docker_executable: Path to the Docker executable (default: "docker")
  • user_id: User ID to run the container as (default: current user ID on POSIX systems)
  • data_dir: Directory for temporary data storage
  • environ: Environment variables to set in the container

Example:

runner = DockerRunner(
    image_overrides={"python:3.9": "my-custom-python:3.9"},
    docker_executable="/usr/local/bin/docker",
    user_id=1000,
    data_dir="/tmp/styx_data",
    environ={"PYTHONPATH": "/app/lib"}
)

Error Handling

styxdocker provides a custom error class, StyxDockerError, which is raised when a Docker execution fails. This error includes details about the return code, command arguments, and Docker arguments for easier debugging.

Cross-Platform Support

styxdocker is designed to work on Linux, macOS, and Windows. On POSIX systems (Linux and macOS), it automatically uses the current user's ID for running containers, ensuring proper file permissions. On Windows, this feature is not available, but the package remains functional.

Contributing

Contributions to styxdocker are welcome! Please refer to the GitHub repository for information on how to contribute, report issues, or submit pull requests.

License

styxdocker 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+
  • Docker installed and running on your system

Comparison with styxsingularity

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.

Metadata

Release files for styxdocker 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for styxdocker 0.8.0
File Size Uploaded Provenance
styxdocker-0.8.0.tar.gz 3.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for styxdocker 0.8.0
File Interpreter ABI Platform
styxdocker-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / styxdocker-0.8.0.tar.gz

Download URL styxdocker-0.8.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
10b7782933214be8d0bba15ae2cb9dea755156e7d0c493b20c9124f06555cef9
BLAKE2b-256 checksum
How to use checksums
39205b29ca3be7e8600934278431abd2e5921fbd756adf06366011b73325755d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / styxdocker-0.8.0-py3-none-any.whl

Download URL styxdocker-0.8.0-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6a42827051848217fc95042ee617f50ffbd647202fc5fe1edee6cfd5f48076a
BLAKE2b-256 checksum
How to use checksums
c754ef3f68ed7abacb5cc0ccb2e9012dee1bcb76fa5a6147d9d9a3f93bc10e25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for styxdocker 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page