Skip to content

Restore purchasedNodes After Job Block#12

Open
2Ryan09 wants to merge 5 commits intomainfrom
node-overage-restore
Open

Restore purchasedNodes After Job Block#12
2Ryan09 wants to merge 5 commits intomainfrom
node-overage-restore

Conversation

@2Ryan09
Copy link
Copy Markdown

@2Ryan09 2Ryan09 commented Apr 16, 2026

Sister of slaclab/sdf-cli#10

Comment thread schema.py Outdated
{ "$lookup": { "from": "clusters", "localField": "clustername", "foreignField": "name", "as": "cluster"}},
{ "$unwind": "$cluster" },
{ "$project": { "_id": 0, "facility": "$facility", "clustername": "$clustername", "purchasedNodes": { "$multiply": [ "$servers", "$cluster.nodecpucount" ] } }},
{ "$project": { "_id": 0, "facility": "$facility", "clustername": "$clustername", "purchasedNodes": { "$toInt": { "$multiply": [ "$servers", "$cluster.nodecpucount" ] } } }},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this affect floats?

@2Ryan09
Copy link
Copy Markdown
Author

2Ryan09 commented Apr 17, 2026

Turns out I missed the call to sacctmgr within FacilityUsage.format_data that would allow us to not have to ping coact-api to gather the purchased nodes, making this PR unnecessary. All changes this PR intended are fully encapsulated in slaclab/sdf-cli#10 I second guessed myself, the original implementation was correct

@2Ryan09 2Ryan09 closed this Apr 17, 2026
@2Ryan09 2Ryan09 reopened this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants