Giter Club home page Giter Club logo

carbon-scheduler's Introduction

CAS

A Carbon-aware scheduler for Unix jobs
Report Bug · Request Feature · Contribute

About Carbon Aware Scheduler

Carbon Aware Scheduler (CAS) is a command line tool that takes CO2 into account when scheduling jobs. Given a job, this tool will find the best time to run this job based on a model of carbon intensity of the power grid. The amount of CO2 emitted per kWh (the aforementioned carbon intensity) often varies greatly during the day, so smart scheduling can reduce CO2 emissions. The model is based on heuristics and it's currently only available for the Netherlands. The tool is a wrapper around the cron and at tools for scheduling Unix commands.

This tool can help you:

  • Schedule non-urgent jobs at a later time during the day
  • Save CO2 and visualize total CO2 saved
  • Easily manage your cron and at jobs

(back to top)

Built With

This project was built in Python. Its main dependencies are:

The project also imports requests, but we do not actually use it in live code in the project. This is due to us not getting access to the ElectricityMap API in time for this project.

(back to top)

Getting Started

Here are the instructions on getting started with our tool. Whether you want to use this tool to become more environmentally-friendly or simply contribute to a tool that changes the world, you can find the instructions here.

Installation

If you simply want to use the app and benefit from the carbon aware-scheduling, simply run:

pip install carbon-aware-scheduler

Contributing

In order to contribute to this project,

  1. Fork the repo using the web interface or using the gh CLI:

    gh repo fork https://github.com/abel-vs/carbon-scheduler --clone
  2. Install the requirements

    pip install -r requirements.txt
  3. Make some commits!

  4. Open a Pull Request

(back to top)

Usage

Some useful commands:

  1. Scheduling a one-off job

    $ cas myjob.py --repeat @daily

  2. Scheduling a repeating job

    $ cas myjob.py --at 202204052230

  3. Listing all the scheduled jobs, repeating and one-off jobs

    $ cas --list

  4. Cancelling a repeating job given the index

    $ cas --cancel-repeating 42

  5. Cancelling a one-off job given the index

    $ cas --cancel-one 42

(back to top)

Roadmap

  • Schedule jobs

    • Given estimate of duration and deadline
    • Taking into account carbon intensity of the grid
  • List jobs

    • Combined view of all jobs: one-off and repeating
  • Remove jobs given id of task

  • Implement offline model based on energymap's historical data on energy mix

    • Location set to NL only
    • Use time of the day
    • Use day of the week
    • Use week/month/season of the year
  • Output saved CO2

    • For current session
    • For all sessions
  • Run parallel jobs

  • "Full of batteries basement" flag -> don't use energy data for scheduling

  • Implement online/live model

    • Based on forecasting marginal carbon intensity
  • GUI for non-technical users

  • Windows platform support

  • Extensive testing

  • Consider machine workload

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contact

Wander Siemers - [email protected]

Abel Van Steenweghen - [email protected]

Florentin-Ionut Arsene - [email protected]

(back to top)

Acknowledgments

  • Luís Cruz - Assistant Professor at Delft University of Technology

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

carbon-scheduler's People

Contributors

wandersiemers avatar abel-vs avatar farsene avatar

Stargazers

 avatar Luis Gerhorst avatar  avatar Samuel Rincé avatar Chris Adams avatar Luís Cruz avatar

Watchers

 avatar  avatar  avatar

Forkers

ofosos

carbon-scheduler's Issues

Documentation on running the tool on Windows

Running on Windows requires some extra steps, i.e. having WSL ready and enabling cron to run on the startup of the computer. A documentation of how to run this would make it easier for the people wanting to test the tool on Windows.

Fix bug in cancelling repeating jobs

I noticed that sometimes cancelling repeating jobs doesn't work as expected. In the picture you can see the list of CronItems found in the crontab, on the second line you can see the item it is supposed to be removed from crontab with cron.remove(), however after calling the remove function, the list of cron items is on the third line, the wrong element being removed
Screenshot 2022-03-31 210213

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.