Git Product home page Git Product logo

miniwdl-colima's Introduction

miniwdl-backend-example

This example container backend plugin for miniwdl runs WDL task containers by simply shelling out to docker run โ€” a toy version of miniwdl's default docker integration. This provides an illustrative starting point for third-party Python packages to integrate other container runtimes.

To run the example, cd into a clone of this repo and:

pip3 install .
export MINIWDL__SCHEDULER__CONTAINER_BACKEND=example_docker_run
miniwdl run_self_test

Installing the Python package registers a specific entry point which miniwdl discovers upon starting (details in setup.py). Then we activate it by setting the environment variable MINIWDL__SCHEDULER__CONTAINER_BACKEND to the registered backend name example_docker_run. (Equivalently, we could set [scheduler] container_backend = example_docker_run in a miniwdl configuration file.)

Implementation overview

The main goal is to provide an implementation of the TaskContainer abstract base class. Each miniwdl task runner thread instantiates your subclass and synchronously invokes its methods to configure and run the container.

See miniwdl_backend_example/docker_run.py for the annotated implementation, and miniwdl-aws for a production-ready example. The former "shells out" to a subprocess to run the container, while the latter makes AWS API calls to schedule a job and poll its status.

Besides the container scheduling, the other main design focus is mounting file inputs/outputs and the working directory. Miniwdl prefers to mount these in situ on the POSIX filesystem (possibly a network share) instead of copying/down/uploading them, based on a desired mapping of virtual in-container paths to host/network paths maintained by TaskContainer. Our subclass is responsible for configuring the container to effect this mapping. The container's standard output and error streams are also communicated via the filesystem.

When your plugin is ready, consider publishing it as a PyPI package and/or a Docker image.

miniwdl-colima's People

Contributors

mlin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.