Git Product home page Git Product logo

circa's People

Contributors

woodcoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

perkss

circa's Issues

Refactor code into functions

The current code is a bit 'smelly' being, as it is, in one main function.

It needs to be refactored into functions.

Sleeping laptop causes sleep to miss target time

If the system running ca goes to sleep (e.g. a laptop) during the call to sleep() the command waits for too long and misses its window.

This appears to be because the API doesn't account for time when the system is suspended.

Specify location for carbon intensity

The ca code currently has the region hardwired as eastus. This needs to be changeable!

This could be done:

  • as a default for the server in a config file (see #2)
  • as a command line option --location

I think that it probably needs to be supported as a command line option, as it might well need to be supplied with an additional region.

e.g. it's perfectly feasible that a user might want to wait for carbon intensity to be low in two places (e.g. where a database server and report server are located in different places).

Give an expected run-time duration window

The existing ca code assumes a default run-time window of 30 minutes.

Folk are likely to want to specify different expected run times (shorter, longer) depending on the job.

Which could be done with something like a --window parameter.

Use of forecast API means up to 5 minute wait before starting

The code uses the forecast API, which currently responds in a granularity of 5 minutes and always starts in the future.

This means that the earliest 'optimal' result is always in the next five minute block - which could cause the command to sleep for 4m59s if called at, for example 14:31:01.

Either it could have a minimum sleep of 5 minutes, or possibly ask for the data for 'now' as well?

Allow multiple locations

A single location can be specified for finding the lowest carbon intensity.

However, some tasks will involve multiple locations (e.g. database or webserver in a different region) -- therefore it would be good to be able to specify multiple locations on the command line.

Either replacing any default location, or in addition to the default.

This will involve working out when the best overlapping time would be - and might also need some sort of percentage weighting to be specified too, to take into account asymmetric processing.

Head to head comparison against a control test system

As with any project aiming to optimise anything, it would be great to sanity check that this project actually helps save carbon.

One possible way to check this might be to setup two small servers and run a head to head test - one using ca and cron and one just using cron.

I don't quite know how you'd instrument or measure this but it would need to do something like:

  1. measure the amount and timestamp of energy used on both servers
  2. cross-check the historic actual carbon intensity data from the carbon aware SDK

I guess (1) could be done with a simple 'how long did the job take' metric - but this might not be very accurate.

Maybe using a tool like Scaphandre might work?

The goal is to show that the, hopefully small, overhead added by ca is actually helping the overall goal of reducing emissions on a day by day basis!

Check cross-platform build - Linux

Needs to be checked on a linux machine and the appropriate debian packages (or similar) for each of the dependencies added to the README?

Allow specification of specific end time

The end time of the timeframe is always relative to when the command is run. It would be nice to allow a fixed end time of 09:00 in localtime or 18:00Z in UTC to be given.

Call Carbon Aware SDK CLI directly

I was keen for circa to use as few dependencies as possible, with the goal of making it as lightweight as the coreutils programs it aspires to be like.

Linking directly to the Carbon Aware SDK directly (which involves bringing in the whole of .NET core) felt quite counter to that design goal, so I started with accessing the API directly using libcurl.

This means that if you wanted to talk to a local Carbon Aware SDK instance, you'd have to set it up running on a webserver on localhost. Presumably that's not too bad given that it can be run in a docker container.

However, it might be nice if the SDK was installed on the local machine, if circa could exec the ./CarbonAware.CLI command directly.

Record stats

Some method of getting the system to record or log statistics about the commands it's running.

This could be something like time taken to run, energy usage, machine load, how much the task was time shifted by.

Ideally, these things could be used to learn more about a command (e.g. average or variation in runtime, its effect on the load of the server) - especially if run repeatedly from a task scheduler.

This probably would mean something like forking the process to run the new command, and waiting until it is finished to fetch and log this sort of data.

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.