Code Monkey home page Code Monkey logo

jobqueue's Introduction

@author Sagar Kar

A RabbitMq based job queying system to run docker as jobs.

Todo:

  • Make the function to passs messages
  • Make the docker command take basic arguments and run
  • Make the entire pipeline work
  • Pretty print the output from PIPE
  • Make the MEMORY requirement check
  • Make the CPU requirement check
  • Use argparse for both files
  • Use -d as an arg to receive.py
  • Make sure about the CPU and CMD examples
  • Make the process work with decoding the '\n' as arbitary blank symbol from pipe.
  • Make the messages durable and stay across restarts.

Requirements: -python3 -pika (pip) -rabbitmq (unix)

Remarks:

  1. Learned about RabbitMQ
  2. Made the docker run work wihout docker compose and understood the underying concept
  3. Difficulty in the Popen Output. Pretty nasty.
  4. The -t arg in docker run caussed the output formatting mess in th subprocess.Popen.PIPE.stdout.readline().

File Structure:

.
├── job_desc (all sample job description holds here)
│   ├── job_desc_1.json
│   └── job_desc_2.json
├── notebooks (scrap notebooks for testing)
│   └── rabbitmqSample.ipynb
├── README.md
└── scripts (the fileterd scripts)
    ├── cpu_usage.sh
    ├── mem_check.sh
    ├── receive.py (worker)
    └── send.py (client)

Project Description:

Job Queue

Create a job queue. It consists of two parts: a worker and a client.

Each job consists of:

  1. a docker image
  2. an array of cmd parameters to pass to the image
  3. a dictionary of environment variables to pass to the image
  4. a dictionary of cpu and memory requirements

The client takes the above details and enqueues the job.

A worker then pops the jobs from the queue and runs them.

Notes:

  • There are no restrictions on how long a task can run; Some may finish in weeks while others may run for weeks.
  • Assume jobs are idempotent; Each job should be run at least once.
  • Each worker should take cpu and memory available as inputs when it's started.
  • A worker should simultaneously run as many jobs as possible without overrunning either the cpu or the memory available
  • We must be able to run multiple workers with different cpu and memory availability simultaneously.

jobqueue's People

Contributors

sagarkar10 avatar

Watchers

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