Skip to content
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

Added SU information each remaining SUs #17

Closed
wants to merge 1 commit into from

Conversation

QuanMPhm
Copy link
Contributor

@QuanMPhm QuanMPhm commented Feb 25, 2025

Closes #16. This is one of two solutions I am proposing, where the SU definition for each SU is contained in a single string with the format below:

"vCPU ,RAM , vGPU "

The other solution is #18

A sample code to retrieve SU information would look something like this:

su_names = ["GPUK80", "GPUA100SXM4", "GPUH100", "CPU"]
su_def_delimiter = ","
su_def_dict = {}

nerc_data = load_from_file()
for su_name in su_names:
    su_def_dict.setdefault(su_name, {})
    su_def_list = nerc_data.get_value_at(f"{su_name} SU Definition", "2024-12").split(su_def_delimiter)
    for su_resource in su_def_list:
        su_resource_split = su_resource.split(" ")
        su_def_dict[su_name][su_resource_split[0]] = su_resource_split[1]

Each SU will have one entry, which is a string which
follows the format below:

"vCPU <vCPU quantity>,RAM <RAM quantity>, vGPU <vGPU quantity>"
@larsks
Copy link
Member

larsks commented Feb 25, 2025

I don't like this solution because it makes the "value" field effectively an unstructured string. It's no longer possible to apply any sort of schema validation to it.

@knikolla
Copy link
Contributor

Abandon this in favor of the other approach.

@QuanMPhm QuanMPhm closed this Feb 25, 2025
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.

Add SU information for each SU
3 participants