Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Carbon-Aware-Scheduler

Overview

This application enables you to schedule tasks within a given time frame at the time when carbon intensity in the grid is lowest.

Given a desired earliest start time and latest finish time, the expected duration of the task and the region where the task is run, the scheduler will determine at which time the share of renewable generation is predicted to be highest, and initiate the task by calling a provided webhook.

You can either host your own scheduler by getting it from the Azure marketplace, or use a hosted variant under: https://carbon-aware-scheduler.bluehands.de to test out how it works.

Containers

Docker files live under deployment/ and build two images:

  • scheduler-ui: Angular frontend bundled into the API container.
  • scheduler-executor: Stand-alone executor that runs scheduled work.

Build images

docker build -f deployment/Dockerfile.scheduler-ui -t scheduler-ui .
docker build -f deployment/Dockerfile.executor -t scheduler-executor .

Run locally with Docker Compose

docker compose -f deployment/docker-compose.yml up --build

Debug backend locally

  • Start Azurite (e.g. from docker-compose and stop other containers)
  • create symlink wwwroot
    • cmd in source/backend/CarbonAwareScheduler.Api
    • mklink /D wwwroot "..\..\frontend\dist\carbon-aware-scheduler\browser"
  • Debug CarbonAwareScheduler.Api: https

The UI/API container listens on http://localhost:8080. The compose file also starts Azurite on ports 10000-10002.

Configuration notes

  • ConnectionStrings__TableStorage points to Azurite by default in deployment/docker-compose.yml.
  • Set EXECUTOR_LOOP=true to run the executor in a simple loop (default is a single run); EXECUTOR_SLEEP_SECONDS controls the interval.

GitHub Actions ACR publish

The Publish Images workflow builds and pushes scheduler-ui and executor to ACR on pushes to main and version tags.

Required GitHub secrets:

  • AZURE_CLIENT_ID
  • AZURE_TENANT_ID
  • AZURE_SUBSCRIPTION_ID
  • ACR_NAME (ACR name without .azurecr.io)

Tagging behavior:

  • GitVersion starts at 1.0.0 and increments patch on each push to main.
  • Images are tagged with the SemVer and latest (no git sha tag).
  • Version tags can be v1.2.3 or 1.2.3.

Image repositories:

  • {acr_name}.azurecr.io/carbon-aware-scheduler/scheduler-ui
  • {acr_name}.azurecr.io/carbon-aware-scheduler/executor

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages