diff --git a/src/rates-schema.json b/src/rates-schema.json index 0a4458f..ed0844b 100644 --- a/src/rates-schema.json +++ b/src/rates-schema.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "RatesConfig", - "description": "Schema for core and GPU hour rate configuration", + "description": "Schema for core and GPU hour rate configuration; cluster core counts are derived from slurm.conf", "type": "object", "properties": { "defaultRate": { diff --git a/src/rates.json b/src/rates.json index 1ebfac3..48665f5 100644 --- a/src/rates.json +++ b/src/rates.json @@ -1,7 +1,6 @@ { "defaultRate": 0.02, "defaultGpuRate": 0.2, - "clusterCores": 100, "historicalRates": { "2024-01": 0.015 }, diff --git a/src/slurmcostmanager.js b/src/slurmcostmanager.js index 2330589..a1ebdab 100644 --- a/src/slurmcostmanager.js +++ b/src/slurmcostmanager.js @@ -1023,22 +1023,6 @@ function Rates({ onRatesUpdated }) { }) ) ), - React.createElement( - 'div', - null, - React.createElement( - 'label', - null, - 'Total Cluster Cores: ', - React.createElement('input', { - type: 'number', - step: '1', - value: config.clusterCores, - onChange: e => - setConfig({ ...config, clusterCores: e.target.value }) - }) - ) - ), React.createElement('h3', null, 'Account Overrides'), React.createElement( 'table', diff --git a/test/unit/billing_summary.test.py b/test/unit/billing_summary.test.py index 3b96e22..5d5a934 100644 --- a/test/unit/billing_summary.test.py +++ b/test/unit/billing_summary.test.py @@ -207,7 +207,15 @@ def fake_open(path, *args, **kwargs): ), mock.patch.object(SlurmDB, 'fetch_invoices', return_value=[]), mock.patch( 'builtins.open', side_effect=fake_open ), mock.patch.object( - SlurmDB, 'cluster_resources', return_value={'cores': 100} + SlurmDB, + '_parse_slurm_conf', + return_value={ + 'nodes': 1, + 'sockets': 1, + 'cores': 100, + 'threads': 1, + 'gres': {}, + }, ): db = SlurmDB() summary = db.export_summary('2024-02-01', '2024-02-29')