Using predictions of request during the next hour we calculate how the servers should be placed to handle the requests while minimizing carbon and satsifying latency constraint.
Once servers are placed, the scheduler distributes the request between the regions such that carbon is minimized.
Install all required packages specified in requirements.txt
pip install -r requirements.py
To run the scheduler, make sure the working directory is the root folder of the repository and run the following
python -m scheduler --help
usage: __main__.py [-h] [-a {latency_greedy,carbon_greedy,carbon_aware}] [-t TIMESTEPS] [-r [0-60]] [--load LOAD] [--save] [-d START_DATE] [-v] [-l LATENCY] [-m MAX_SERVERS]
[--rate RATE]
optional arguments:
-h, --help show this help message and exit
-a {latency_greedy,carbon_greedy,carbon_aware}, --algorithm {latency_greedy,carbon_greedy,carbon_aware}
The scheduling algorithm to use
-t TIMESTEPS, --timesteps TIMESTEPS
The total number of hours
-r [0-60], --request-update-interval [0-60]
The number of minutes between each scheduling
--load LOAD Name of file to load and plot
--save Name of file to save
-d START_DATE, --start-date START_DATE
Start date in ISO format (YYYY-MM-DD)
-v, --verbose Print information for every timestep
-l LATENCY, --latency LATENCY
Maximum latency allowed
-m MAX_SERVERS, --max-servers MAX_SERVERS
Maximum pool of servers
--rate RATE Specify a constant rate
To run all the tests pytest
is required
pip install pytest
Run the following command in the root folder
pytest -v
For latency we use cloudping containing average latency to AWS during one year for implemented regions. These are applied manually in the code.