GithubHelp home page GithubHelp logo

gravitational's Introduction

Scheduler-Worker Cluster Architecture

Goal

  • Build a scheduler and worker architecture that supports GRPC communication.

General Overview

  • Support single scheduler and multiple workers.
  • The scheduler must be aware of all workers' states. (requires the workers to register and deregister when going offline)
  • The scheduler and the workers authenticate with each other via TLS.
  • The scheduler and workers, both need to have GRPC-APIs.
    • The scheduler GRPC-API support:
      • Register a worker
      • Deregister a worker
    • The worker GRPC-API support:
      • Start a job
      • Stop a job
      • Return the status of a job
      • Return a stream of output for a running job.

Scheduler Overview

  • Scheduler Details
  • When a worker registers, a UUID is assigned to the worker and worker details are kept in a map.
    • This model use an in-memory model. however a production version code might be using Redis for a persistent-model.
    • An SQL database might also be used, however I don't see a big benefit in using an SQL database. The lookups are often and the data is not complex, Redis would be a fine option.
  • Starting a job on a specific worker
    • Request (pseudo):
      {
        "worker_id": "71382ed1-471d-4ae3-b572-f67d178f04e9",
        "path": "worker/scripts/count.sh",
        "command": "bash"
      }
      
    • Response (pseudo):
      {
        "job_id": "6c26a00e-3017-11e9-b210-d663bd873d93"
      }
      
    • for above request, job starts with
      bash worker/scripts/count.sh
    • Allows you to run any scripts with proper command (python, ruby, js, bash etc) Also possible to run executables by leaving the path as ""

Worker Overview

  • Worker Details
  • Support a GRPC-API (Appendix B)
  • Jobs are basically scripts that are held in the specified folder.
  • When a job is started by the scheduler, a job object is created by the worker
    • This object specifies where the output of the job will be piped.
    • Also holds which command and which path was requested.

gravitational's People

Contributors

koraygocmen avatar

Watchers

James Cloos 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.