-
Notifications
You must be signed in to change notification settings - Fork 1
Parse sinfo output to manage resources #370
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
base: master
Are you sure you want to change the base?
Parse sinfo output to manage resources #370
Conversation
antonio-rodriguez-tam
commented
Mar 19, 2025
- Add environment parameter to switch from sinfo output to fixed text file
- Add slurm_get_nodes_info function to utils to parse sinfo putput
- Create/Update resources
- Create/Update resources attributes
coldfront/plugins/slurm/management/commands/slurm_manage_resources.py
Outdated
Show resolved
Hide resolved
…revent bulk update error
…revent bulk update error. Fix merge error
…fasrc-coldfront into sinfo_resource_management
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.
There's also this issue regarding the last_updated timestamp not getting updated when this is run: https://fasrc.slack.com/archives/C07K0P7SLH3/p1743020779949709
bulk_update_resource = [] | ||
processed_resource_attribute = [] | ||
for row in output: | ||
new_resource, compute_node_created_created = Resource.objects.get_or_create(name=row['nodelist'], defaults={'is_allocatable':False, 'resource_type':compute_node}) |
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.
Could we also add parent_resource=(Cluster Resource where the node is installed) to the defaults here?
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.
Done
We tracked this to the use of modified = AutoLastModifiedField(_('modified')) preventing modified field to be updated anywhere but on save(). Since we use bulk_update_with_history the models save() is bypassed |