Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Repository- or Organization-level aggregate data #109

Open
Zeitsperre opened this issue Jan 16, 2025 · 1 comment
Open

Comments

@Zeitsperre
Copy link

Hi there,

I'm curious to know if there is a way (or if there may be interest) in delivering aggregated statistics for repository/organization-level energy use.

Context

You can imagine a use-case resembling:

  • Three or four repositories in an organization;
  • The eco-ci-energy-estimation action configured for two workflows on each;
  • The two workflows are run against both commits Pull Requests and on Push to main branch.

It's easy enough to report statistics within Pull Requests and have a static reference to the energy/carbon statistic for the two workflows running against the main branch, but from what I can tell, the information on badges and in the summary dashboard requires three unique pieces of information:

  • The repository name
  • A workflow ID
  • A specific branch

But let's say that I want to know the total energy for all runs of a specific (or multiple) workflow(s) within a repository or all runs within a specific repository, how would I get this information (besides parsing the JSON output from every run artifact)? What if I want to know these statistics across several repositories under my ownership?

Another issue I can imagine is what if someone forks a repository with this action? How can I ensure that their usage statistic are explicitly included/excluded from this calculation?

Potential Solution (user-side)

I can imagine that if the start-mesurement task could accept a few new variables, this could be simple on the user end:

      - name: Start Measurement
        uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0
        with:
          task: start-measurement
          branch: ${{ github.head_ref || github.ref_name }}
          organization: ${{ secrets.ORG_ID }}
          # This could be set at the org level and would not be shared when creating forks
          # If '', no association is made to an organization
          workflow: ${{ secrets.WORKFLOW_ID || '' }}
          # This would allow multiple YAML workflows to share the same ID
          # If empty, eco-ci associates a Workflow-ID based on the name

Does there already exist a way to gather this information?

Thanks!

@ArneTR
Copy link
Member

ArneTR commented Jan 17, 2025

Jap, such a functionality already exists. However we see this as an enterprise feature and thus do not deliver it in the free open source version of our tools.

The feature in our tool landscape is called CarbonDB

Effectively we are thinking this aggregation idea even a bit wider and not only allow aggreagation of energy/carbon data from CI/CD pipelines to be displayed, but also data fro development (we call this PowerHOG) or data from the runtime of the software, when it is either deploayed on live servers or undergoing regression tests (we call this Energy ID and we have separate Agents)

You can see a demo of how this looks like when multiple products are connected here: https://metrics.green-coding.io/carbondb.html?users_include=0,1,2,3,4,5,6

In the charts you can see distribution by users, by machines, by type etc.

The probalby most important part for your request is the option to set project tags and then filter / segment by those.

The tags are settable in all of our tools. In Eco-CI specifically they are set with the flag project. See the documentation here: https://github.com/green-coding-solutions/eco-ci-energy-estimation?tab=readme-ov-file#github-action-mandatory-and-optional-variables

Happy for your feedback if that fits your need.

Although we distribute it as an enterprise feature we often times give out free tiers to open source projects and if you like to try it just hit me up. Happy to give you a key in case you have an open source project to try it with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants