{"id":22725328,"url":"https://github.com/ovotech/vertflow","last_synced_at":"2025-04-13T20:27:09.028Z","repository":{"id":44464622,"uuid":"505800279","full_name":"ovotech/VertFlow","owner":"ovotech","description":"Run Docker containers on Airflow using green energy.","archived":false,"fork":false,"pushed_at":"2024-03-19T13:52:08.000Z","size":98,"stargazers_count":5,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-09T11:44:42.009Z","etag":null,"topics":["company-ovo"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ovotech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-06-21T10:45:26.000Z","updated_at":"2023-11-14T10:38:10.000Z","dependencies_parsed_at":"2024-03-19T14:57:26.388Z","dependency_job_id":"9111e8b6-f6af-4abf-989b-ee5cb97a81b2","html_url":"https://github.com/ovotech/VertFlow","commit_stats":{"total_commits":43,"total_committers":3,"mean_commits":"14.333333333333334","dds":0.4883720930232558,"last_synced_commit":"fc2df18aa6d90d07dd93369026e940b0d8147f49"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovotech%2FVertFlow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovotech%2FVertFlow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovotech%2FVertFlow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ovotech%2FVertFlow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ovotech","download_url":"https://codeload.github.com/ovotech/VertFlow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229089207,"owners_count":18018390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["company-ovo"],"created_at":"2024-12-10T16:09:19.574Z","updated_at":"2024-12-10T16:09:20.252Z","avatar_url":"https://github.com/ovotech.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdl\u003e\n  \u003ch1\u003e\n        \u003cdiv align=center\u003e\u003cimg src=\"https://github.com/ovotech/VertFlow/assets/68691153/7f3ba4c4-9768-4398-888b-fe9f4de6b51b\" alt=\"logo\"/\u003e\u003c/div\u003e\n    \u003cdiv align=center\u003eVertFlow\u003c/div\u003e\n  \u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\u003ci\u003eRun Docker containers on Airflow using green energy\u003c/i\u003e\u003c/p\u003e\n  \u003cp align=\"center\"\u003e\u003ca href=\"https://drive.google.com/file/d/15XDWTu4kZfxE-SHAQcyMokr52gE_zGhv/view\"\u003e\u003cimg src=\"https://github.com/ovotech/VertFlow/assets/68691153/a99aa78a-cefc-453d-b115-964f6c2702db\" width=\"358\" height=\"201\"  alt=\"Video Demo\"/\u003e\u003c/a\u003e\u003c/p\u003e\n\u003c/dl\u003e\n\n## 📖 About\n\n**VertFlow is an [Airflow](https://airflow.apache.org/) operator for\nrunning [Cloud Run Jobs](https://cloud.google.com/run/docs/create-jobs) on Google Cloud Platform in green data\ncentres.**  \nCloud Run is a serverless container runtime, meaning you BYO Docker image and emit carbon only when the job is running.\nThis is *easier, cheaper and greener* than managing a Kubernetes cluster spinning 24/7.\n\n**Not all data centres are created equal.**  \nData centres run on electricity generated from various sources, including fossil fuels which emit harmful carbon\nemissions. Some data centres are greener than others, using electricity from renewable sources such as wind and hydro.  \nWhen you deploy a container on Airflow using the VertFlow operator, it will run your container in the greenest GCP data\ncentre possible.\n\n\u003e ℹ️ Use VertFlow on [Cloud Composer 2](https://cloud.google.com/composer/docs/composer-2/composer-versioning-overview)\n\u003e to save even\n\u003e more money and CO2.\n\n## 🔧 How to install\n\n1. `pip install VertFlow` on your Airflow instance.\n2. Ensure your Airflow scheduler has outbound access to the public internet and the `roles/run.developer` Cloud IAM\n   role.\n3. Get an [API Key for CO2 Signal](https://www.co2signal.com/), free for non-commercial use. Store in an Airflow variable called `VERTFLOW_API_KEY`.\n\n\u003e ℹ️ If you're using Cloud Composer, these instructions may be helpful:\n\u003e * [Installing PyPI packages](https://cloud.google.com/composer/docs/how-to/using/installing-python-dependencies#install-package)\n\u003e * [Setting up internet access](https://cloud.google.com/composer/docs/concepts/private-ip#public_internet_access_for_your_workflows)\n\u003e * [About service accounts for Cloud Composer](https://cloud.google.com/composer/docs/composer-2/access-control#about-service)\n\n## 🖱 How to use\n\nUse the [`VertFlowOperator`](https://github.com/ovotech/VertFlow/blob/main/src/operator.py#L30) to instantiate a task in your DAG.\nProvide:\n\n* The address of the Docker image to run.\n* A runtime specification, e.g. timeout and memory limits.\n* A set of allowed regions to run the job in, based on your latency, data governance and other considerations. VertFlow\n  picks the greenest one.\n\n```python\nfrom VertFlow.operator import VertFlowOperator\nfrom airflow import DAG\n\nwith DAG(\n        dag_id=\"hourly_dag_in_green_region\",\n        schedule_interval=\"@hourly\"\n) as dag:\n    task = VertFlowOperator(\n        image_address=\"us-docker.pkg.dev/cloudrun/container/job:latest\",\n        name=\"hello-world\",\n        allowed_regions=[\"europe-west1\", \"europe-west4\"],\n        command=\"echo\",\n        arguments=[\"Hello World\"],\n        service_account_email_address=\"my-service-account@embroidered-elephant-739.iam.gserviceaccount.com\",\n        ...\n    )\n```\n\n## 🔌🗺 Shout out to CO2 Signal\n\nVertFlow works thanks to real-time global carbon intensity data, gifted to the world for non-commercial use\nby [CO2 Signal](https://www.co2signal.com/).\n\n## 🤝 How to contribute\n\nFound a bug or fancy resolving an issue? We welcome Pull Requests!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovotech%2Fvertflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovotech%2Fvertflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovotech%2Fvertflow/lists"}