Skip to main content

Docker integration for Styx compiled wrappers.

Project description

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.

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

styxdocker-0.3.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

styxdocker-0.3.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file styxdocker-0.3.0.tar.gz.

File metadata

  • Download URL: styxdocker-0.3.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

Hashes for styxdocker-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f04e245c7ed0485d26aecbf8f725e333ef02a3f0557cb28a2992809f0b888cce
MD5 1e754568b89577b59b58aa2af8cecacb
BLAKE2b-256 4a8b05118494e33ba2ab2f6664ec98cb0e003bfca4d96b73b18d53dbbdf79938

See more details on using hashes here.

File details

Details for the file styxdocker-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: styxdocker-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for styxdocker-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9aa7edaea55d0a6cd043f0936245695e9f766fd8f95e0ad1b45b0990a170d676
MD5 e15487c70e27e12cfe9199d06f8c76a3
BLAKE2b-256 cfc21f1e4f955b1bd4288a29382105ec2a5a540b5d20b78f9cc702809a4d2644

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