Skip to content

Commit

Permalink
Amendments and changelog for Energy schedules (#2903) (#2907)
Browse files Browse the repository at this point in the history
* amendments for @dalazx suggestions in Slack, added changelog for #2903

* Update CHANGELOG.D/2903.feature

Co-authored-by: Oleksandr Danshyn <[email protected]>

---------

Co-authored-by: Oleksandr Danshyn <[email protected]>
  • Loading branch information
YevheniiSemendiak and dalazx authored Feb 14, 2023
1 parent 31c804b commit 0b65787
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.D/2903.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Added support of cluster energy schedules.
`neuro config show --energy` will display awailable energy schedule periods.
`neuro run --schedule-name <energy-schedule-name>` will run the job within the specified <energy-schedule-name>. Note - the selected preset should have an enabled scheduler.
`neuro status <job-id>` will include the energy schedule name if one was used for running the job.
9 changes: 5 additions & 4 deletions neuro-cli/src/neuro_cli/formatters/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import calendar
import operator
from datetime import time
from decimal import Decimal
Expand Down Expand Up @@ -164,15 +165,15 @@ def _format_cluster_energy(cluster: _ConfigCluster) -> Sequence[RenderableType]:
assert cluster.energy

summary = [
Text("Cluster energy parameters", style="i"),
Text("Cluster energy parameters:", style="i"),
Text.assemble(
Text("CO2 emmitions (g/kWh): "),
Text("CO2 eq g/kWh: "),
Text(str(cluster.energy.co2_grams_eq_per_kwh), style="b"),
),
]

schedules_tbl = Table(
title="Energy schedules",
title="Energy schedules:",
title_justify="left",
box=box.SIMPLE_HEAVY,
show_edge=False,
Expand All @@ -196,7 +197,7 @@ def _format_cluster_energy(cluster: _ConfigCluster) -> Sequence[RenderableType]:
str(schedule.price_per_kwh),
timeslot[0].strftime("%H:%M"),
timeslot[1].strftime("%H:%M"),
", ".join([str(x) for x in sorted(days)]),
", ".join([calendar.day_abbr[x - 1] for x in sorted(days)]),
)
return *summary, schedules_tbl

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ Resource Presets:
gpu-large 7 64.4 GB × × 1 x nvidia-tesla-v100 10
cpu-small 7 2.1 GB × × 10
cpu-large 7 15.0 GB × × 10
Cluster energy parameters
CO2 emmitions (g/kWh): 40.4
Energy schedules
Name Price (kW/h) Start time End time Weekday
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DEFAULT 10.4 00:00 23:59 1, 2, 3, 4, 5, 6, 7
GREEN 0.5 00:00 08:00 1, 2, 3, 4, 5, 6, 7
GREEN 0.5 20:00 23:59 1, 2, 3, 4, 5, 6, 7
SCATTERED 0.5 05:00 10:00 1, 4
SCATTERED 0.5 03:00 05:00 2
SCATTERED 0.5 00:00 23:59 3, 6, 7
SCATTERED 0.5 02:00 05:00 5
Cluster energy parameters:
CO2 eq g/kWh: 40.4
Energy schedules:
Name Price (kW/h) Start time End time Weekday
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DEFAULT 10.4 00:00 23:59 Mon, Tue, Wed, Thu, Fri, Sat, Sun
GREEN 0.5 00:00 08:00 Mon, Tue, Wed, Thu, Fri, Sat, Sun
GREEN 0.5 20:00 23:59 Mon, Tue, Wed, Thu, Fri, Sat, Sun
SCATTERED 0.5 05:00 10:00 Mon, Thu
SCATTERED 0.5 03:00 05:00 Tue
SCATTERED 0.5 00:00 23:59 Wed, Sat, Sun
SCATTERED 0.5 02:00 05:00 Fri

0 comments on commit 0b65787

Please sign in to comment.