-
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 history and workflow invocation carbon emissions reporting #17542
base: dev
Are you sure you want to change the base?
Add history and workflow invocation carbon emissions reporting #17542
Conversation
* Read awsEc2ReferenceData directly in AwsEstimate component * Read config values directly in JobMetrics components * Cleanup props for AwsEstimate and JobMetrics components
…issions-reporting
…issions-reporting
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.
Can you make this all disabled by default please ? The API route should only be included in the router if carbon emission reporting is enabled, and the cards should move out of the summary tab and into its own tab if the carbon emission thing is enabled.
invocation_id: DecodedDatabaseIdField, | ||
) -> MetricsSummaryCumulative: | ||
workflow_invocation = self._workflows_manager.get_invocation(trans, invocation_id, eager=True) | ||
job_ids = [step.job_id for step in workflow_invocation.steps if step.job_id is not None] |
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.
That's excluding all subworkflows jobs and all map over jobs.
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.
I've got a rudimentary solution to accessing subworkflow jobs. Am I on the right track here, or is there a recommended way to access subworkflow jobs?
job_ids = [step.job_id for step in workflow_invocation.steps if step.job_id is not None]
for subworkflow in workflow_invocation.subworkflow_invocations:
job_ids.extend([step.job_id for step in subworkflow.steps if step.job_id is not None])
I'm actually unfamiliar with what map over jobs are. Could you please clarify what they are? :)
Given that they return the accumulated job metrics of all jobs in a history or workflow invocation (and other additional ones that could be added in the future) is it really necessary to exclude the |
/** Total Energy Needed Cpu Kwh */ | ||
total_energy_needed_cpu_kwh: number; | ||
/** Total Energy Needed Kwh */ | ||
total_energy_needed_kwh: number; | ||
/** Total Energy Needed Memory Kwh */ | ||
total_energy_needed_memory_kwh: number; |
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.
Can you move that into another model ?
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.
Do you have something like this in mind?:
# lib/galaxy/schema/schema.py
class MetricsSummaryEnergyCumulative(Model):
total_energy_needed_cpu_kwh: float
total_energy_needed_memory_kwh: float
total_energy_needed_kwh: float
class MetricsSummaryCoreCumulative(Model):
total_allocated_cores_cpu: int
total_allocated_memory_mebibyte: int
total_runtime_seconds: int
energy_usage_metrics: Optional[MetricsSummaryEnergyCumulative]
ok, that sounds good |
Adresses #17044, #15046 and usegalaxy-eu/environmental_impact/#2.
This PR implements carbon emissions reporting for histories and workflow invocations.
Backend changes:
/api/histories/{history_id}/metrics
and/api/invocations/{invocation_id}/metrics
.Frontend changes:
carbon_emission_estimates
estimates flag in the galaxy config tofalse
prevents all carbon emissions reporting from being shown in the frontend UI (Job details page, history statistics page, workflow invocation summary).CarbonEmissions.vue
component so it can be used in more places.Screenshots of new UI changes:
History statistics screen with history carbon emissions and storage overview:
Workflow invocation carbon emissions:
How to test the changes?
(Select all options that apply)
License