Git Product home page Git Product logo

atlantask's Introduction

Prolem statement

We want to offer an implementation through which the user can now stop the long-running task at any given point in time, and can choose to resume or terminate it. This will ensure that the resources like compute/memory/storage/time are used efficiently at our end, and do not go into processing tasks that have already been stopped (and then to roll back the work done post the stop-action)

Solution

  1. I have created /task, /resume, /stop, /terminate, /list_tasks endpoints.
  2. /task will help to upload the necessary files in to the pipeline.
  3. for the pipeline purpose I have used Queue DataStructure(FIFO).
  4. /stop helps to stop the current running task and with this next task in the queue will start running.
  5. /resume will resume the task based on the id provided for this the current task should stop running.
  6. /terminate helps to completely stop the task fro further execution and now you wont be able to resume the task.
  7. /list_tasks will list all the task in the queue with its metadata.

Techology used

  1. Flask framework for creating API's.
  2. Redis for scheduling tasks

Files

  1. test.py : help to prepare the test data csv.
  2. app.py : the main program responsible to perform task.

Future Work

  1. SQL Database can be used to persist task and its metadata.
  2. Its can be deployed in kubernetes through docker image.

Steps to run

  1. Create a python3 virtual enviornment.
  2. Install the requirements via pip install -r requirements.txt.
  3. Open two terminals in one run flask run and in second run rq worker(make sure redis-server is installed).
  4. Now that the server is running, you can make POST and GET request now.

atlantask's People

Contributors

safwan20 avatar

Watchers

 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.