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

Adding cloud platform computation and PUE #369

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

tibosmn
Copy link
Contributor

@tibosmn tibosmn commented Jan 31, 2025

Hello,

I’ve finally implemented the methodology we proposed in BoaviztAPI: a bottom-up model to assess the environmental impacts of cloud services.

Key Updates

  • Added functionality to assess the footprint of a Cloud Platform (i.e., multiple servers).
  • Incorporated Power Usage Effectiveness (PUE) in computations.
  • Refactored terminology:
    • Replaced cloud with cloud instance (i.e., virtual machines, as per the paper’s terminology).
    • Introduced cloud platform as the underlying infrastructure hosting cloud instances.
  • Implemented an archetype for cloud platforms, following a bottom-up approach: server → cloud platform → cloud instance. Both CloudPlatform and CloudInstance are now considered services, not devices.
  • Moved complete_usage logic directly into setters to avoid breaking encapsulation. I feel this should be our approach moving forward,

Breaking Changes

Since these updates affect the computational model, I’ve implemented them gradually to ensure result consistency and verify tests coherency

Next Steps

  • Given the significance of these changes, I believe we should discuss whether the implementation I've proposed is the right one.
  • Once we validate an approach, we should integrate the paper’s embodied impact factors for cloud platforms (and instances), which will require updating all related tests.

Let me know your thoughts!

@tibosmn
Copy link
Contributor Author

tibosmn commented Feb 3, 2025

ping @PierreRust @samuelrince if you can kindly review what I proposed :)

@PierreRust
Copy link
Contributor

pff, c'est bien gros comme PR , je vais essayer de jeter un oeil 😅

@da-ekchajzer da-ekchajzer self-requested a review February 4, 2025 17:20
@da-ekchajzer
Copy link
Collaborator

Will check ! Thank you :)

@Shillaker
Copy link
Contributor

Shillaker commented Feb 25, 2025

This is a really big PR that's quite hard to read. It looks like it changes all the estimates for all the providers, but I can't tell from the code whether those changes are reasonable.

It also introduces a breaking change to the API. It would be better to add new endpoints and deprecate the old one(s), rather than just hard-delete (people need time to update tools, understand the change etc.).

Obviously just my 2 cents as I'm not a reviewer, but I would recommend 3 PRs:

  1. Implement just the cloud_instance endpoint - do this in addition to, rather than instead of, the existing cloud endpoint (this means fewer changes, and allows comparison of the numbers side-by-side, without needing to run two versions of the API)
  2. Implement all the platform endpoints - with PR 1 done, this will be purely new functionality, and much easier to review when separated from the changes to the cloud_instance endpoint
  3. Deprecate the cloud endpoint, update the docs, add warnings etc.

Another general tip is to avoid all "unnecessary" renaming. Renaming a class or variable adds a lot of noise to the diff, making it more complex to review. Definitely go ahead and rename things if you think they are wrong (e.g. get_archetype_config -> get_instance_config, which I agree with), but do this either in advance, or after the functional changes have been merged.

The same thing goes for refactorings, like the complete_usage change you mention in the PR description. If it's possible to separate them, try to put them into a separate PR that can be reviewed and merged ahead of time.

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

Successfully merging this pull request may close these issues.

4 participants