Giter Site home page Giter Site logo

workflow-management-scheduler's Introduction

Workflow Management Scheduler

What is it?

Middleware for icgcargo/workflow-management used to initialise workflows with scheduled directories (if needed).

How does it work?

This middleware is essentially a greedy scheduluer that treats each available directory as a knapsack which it is filling up with workflows. Each directory has a maxCostPerDir and each workflow configured has a cost. This allows for various combinations of workflows running on a single directories while making sure the maxCostPerDir is never exceed. There is also a maxTotalRun per workflow to make sure each workflow type has a fair share of directories.

The scheduler logic only applies for configured workflows repos and workflow requests that make use of the workDirTemplate tag. This tag is needed for scheduler to know where to inject the directory values in the run request.

Configuration

Scheduler configuration looks like this:

scheduler:
  workDirTemplate: "<SCHEDULED_DIR>"
  maxCostPerDir: 3
  dirValues:
    - "nfs-local/nfs-1"
    - "nfs-local/nfs-2"
  workflows:
    - repository: "argo/hello"
      name: "hello"
      maxTotalRuns: 2
      cost: 2
    - repository: "argo/sanger-wgs"
      name: "sanger-wgs"
      maxTotalRuns: 4
      cost: 1
  • template string is used to find and replace with the scheduled dir
  • array of workflows wach configured with a repository, name, cost, and maxTotalRuns
  • when making decisions, scheduler will not exceed the maxTotalRuns per workflow and maxCostPerDir

workflow-management-scheduler's People

Contributors

dahiyaad avatar andricdu avatar ummulkiramr avatar yalturmes avatar justincorrigible avatar

Watchers

James Cloos avatar Junjun Zhang avatar Ciarán Schütte avatar Sam Rich avatar Hardeep Nahal-Bose avatar  avatar Leonardo Rivera avatar Dan avatar Bhavik Bhagat avatar

workflow-management-scheduler's Issues

Add ability to manually trigger reschedule

Detailed Description

  • if scheduler doesn't receive any messages (because some thing is wrong in the system), it will not set any runs to INITIALIZING which means no runs will start
  • depending on the problem, scheduler still might not have any messages to trigger it even after every thing is fixed
  • we should have a manual way to trigger scheduler for scenarios where it needs to triggered manually

Possible Implementation

  • add a POST endpoint to scheduler to trigger reschedule

Feature Request: To get Scheduler to auto-trigger jobs in external cluster

How does Scheduler calculate available capacity:
The Scheduler allocates the work directory to a new workflow based on a cost calculation. Every workflow has a cost and every directory has a max cost.
For example: If the max cost per directory is set to 4 (MaxCostPerDir = 4)and the cost of one Dna Seq workflow = 2, that would mean that one directory can accommodate 2 running Dna Seq jobs.

How to get Scheduler to auto-trigger jobs in external cluster:

The list of directories maintained in the Scheduler currently looks like this


  dirValues:
    - /nfs-local/nfs-1
    - /nfs-external/nfs-1
   

We can improvise this configuration to enable auto-triggering of the workflows to an external cluster by adding the list of all directories present in the external cluster along with the cluster information for each directory. Note here the cluster info is separated by a colon. 'default' means the local cluster and cluster2 is the external cluster.

   - "nfs-local/nfs-1:default"
   - "nfs-local/nfs-2:default"
   - "nfs-external/nfs-1:cluster2"
   - "nfs-external/nfs-1:cluster2"

Now, at decision time Scheduler will check for the available capacity (using the cost calculation) for all the directories in the list above and allocate them to the workflows. Whichever directory the Scheduler picks it will add its corresponding cluster info as a parameter to the list of workflow params to signal management about the cluster it needs to fire the jobs in.

This will eliminate the need for users to provide a cluster name to fire the jobs in and instead leave this for the Scheduler to decide. However, users can still override this behaviour and provide a cluster in which to run the workflows (in the workflow params) but they will need to provide the directory names too.

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.