Skip to content

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

antonio-rodriguez-tam
Copy link

  1. Add environment parameter to switch from sinfo output to fixed text file
  2. Add slurm_get_nodes_info function to utils to parse sinfo putput
  3. Create/Update resources
  4. Create/Update resources attributes

Copy link
Collaborator

@claire-peters claire-peters left a 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})
Copy link
Collaborator

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?

Choose a reason for hiding this comment

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

Done

@antonio-rodriguez-tam
Copy link
Author

There's also this issue regarding the last_updated timestamp not getting updated when this is run: https://fasrc.slack.com/archives/C07K0P7SLH3/p1743020779949709

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

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