Skip to content

Commit 55c0ab1

Browse files
Merge pull request #113 from NessieCanCode/remove-total-cluster-cores-field
Remove manual cluster core count configuration
2 parents e9a17dc + 02c1d51 commit 55c0ab1

File tree

4 files changed

+10
-19
lines changed

4 files changed

+10
-19
lines changed

src/rates-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"title": "RatesConfig",
4-
"description": "Schema for core and GPU hour rate configuration",
4+
"description": "Schema for core and GPU hour rate configuration; cluster core counts are derived from slurm.conf",
55
"type": "object",
66
"properties": {
77
"defaultRate": {

src/rates.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"defaultRate": 0.02,
33
"defaultGpuRate": 0.2,
4-
"clusterCores": 100,
54
"historicalRates": {
65
"2024-01": 0.015
76
},

src/slurmcostmanager.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,22 +1023,6 @@ function Rates({ onRatesUpdated }) {
10231023
})
10241024
)
10251025
),
1026-
React.createElement(
1027-
'div',
1028-
null,
1029-
React.createElement(
1030-
'label',
1031-
null,
1032-
'Total Cluster Cores: ',
1033-
React.createElement('input', {
1034-
type: 'number',
1035-
step: '1',
1036-
value: config.clusterCores,
1037-
onChange: e =>
1038-
setConfig({ ...config, clusterCores: e.target.value })
1039-
})
1040-
)
1041-
),
10421026
React.createElement('h3', null, 'Account Overrides'),
10431027
React.createElement(
10441028
'table',

test/unit/billing_summary.test.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,15 @@ def fake_open(path, *args, **kwargs):
207207
), mock.patch.object(SlurmDB, 'fetch_invoices', return_value=[]), mock.patch(
208208
'builtins.open', side_effect=fake_open
209209
), mock.patch.object(
210-
SlurmDB, 'cluster_resources', return_value={'cores': 100}
210+
SlurmDB,
211+
'_parse_slurm_conf',
212+
return_value={
213+
'nodes': 1,
214+
'sockets': 1,
215+
'cores': 100,
216+
'threads': 1,
217+
'gres': {},
218+
},
211219
):
212220
db = SlurmDB()
213221
summary = db.export_summary('2024-02-01', '2024-02-29')

0 commit comments

Comments
 (0)