-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add carbon emissions admin configuration options #16307
Add carbon emissions admin configuration options #16307
Conversation
- Server location can be set as a valid ISO 3166 code. This is used to determine the carbon intensity based off of the galaxy instance server location - A non-default power usage effectiveness value can be set - Carbon emissions reporting can be toggled
- Add `geographical_server_location_code`, `geographical_server_location_name` and `carbon_intensity` flags. - Alphabetically sort the list of config flags in galaxy init file. - Add logic to set `geographical_server_location_name` and `carbon_intensity` based off of `geographical_server_location_code`.
…values - Simplify the component API by making its consumers pass all necessary props
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice @Renni771 thanks a lot!
Anyone from the backend team that wants to have a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool indeed!
Just a couple of comments below :)
…ions flags - `carbon_intensity` and `geographical_server_location_name` are automatically computed on startup and are never set by an admin. So they don't need to be in the config at all.
Thanks for the comments, @davelopez! I've addressed points you've mentioned :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you @Renni771!
Thanks a lot @Renni771! Awesome work |
This PR was merged without a "kind/" label, please correct. |
@@ -34,6 +34,7 @@ | |||
|
|||
import yaml | |||
|
|||
from galaxy.carbon_emissions import get_carbon_intensity_entry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is breaking the config module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still causing an issue and, if so, how exactly is it breaking the config module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is, the config package can't import from carbon_emissions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Work on a fix is underway in #17159
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update!
Addresses #15046. This feature branch adds admin config parameters and admin documentation for carbon emissions reporting. The following admin flags were added:
geographical_server_location_code
an ISO 3166 code specifying the geographical location of the galaxy instance.power_usage_effectiveness
the PUE value to use in carbon emissions calculations.carbon_emission_estimates
a feature toggle flag so reporting can be completely disabled when needed.The following flags are automatically set based on the value of
geographical_server_location_code
:geographical_server_location_name
the actual name corresponding togeographical_server_location_code
.carbon_intensity
the carbon intensity value corresponding to the configured location.The location is picked from a list of supported locations in ISO 3166 format which is documented over here. This standard allows users to specify both countries and regions within larger countries. If no location is set or the configured location is invalid or unsupported, the config logic defaults to global values. The UI is dynamic and will display the location name, carbon intensity and PUE values. If global values are used, the UI reflects this too. Here's what the UI looks like:
Here's a list of further additions:
doc/source/admin/carbon_emissions.md
.geographical_server_location_code
is invalid or unsupported, the global default values are used and the event is logged.What else changed:
lib/galaxy/config/__init__.py
were refactored to be sorted alphabetically.How to test the changes?
(Select all options that apply)
galaxy.yml.sample
file and assess the behaviour on the client.License