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

Fixed GPU resource parsing and pydantic support #105

Merged
merged 4 commits into from
Aug 22, 2023
Merged

Conversation

t20100
Copy link
Member

@t20100 t20100 commented Aug 22, 2023

This PR fixes 2 issues:

  • GPU resource parsing failures when there is more than one GPU or other resources (Related to issue spawner.py fails to parse when multiple gpu types in same node #104). Some unit tests were added for the parsing. As it stands, there is no real support for multiple GPUs, this PR only avoids to raise an exception and pick the first GPU in the list (this can be overridden in the config).

  • An error occuring with current latest version of pydantic (v2.2.1):

PydanticUserError: RootModel does not support setting `model_config['extra']`

@t20100 t20100 added this to the 7.0.0 milestone Aug 22, 2023
@t20100 t20100 requested a review from loichuder August 22, 2023 13:40
jupyterhub_moss/models.py Show resolved Hide resolved
:returns: (GPU resource template, number of GPUs) or None if the resource is not a GPU.
:raises ValueError: If parsing failed.
"""
for resource in generic_resources.split(","):
Copy link
Member Author

Choose a reason for hiding this comment

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

SLURM "generic resources" can be a comma-separated list of many different things, here we only pick the first gpu with a correct syntax.

jupyterhub_moss/utils.py Outdated Show resolved Hide resolved
jupyterhub_moss/utils.py Show resolved Hide resolved
Co-authored-by: Loïc Huder <42204205+loichuder@users.noreply.github.com>
@t20100 t20100 merged commit 82600a9 into main Aug 22, 2023
1 check passed
@t20100 t20100 deleted the fix-gpu-pydantic branch August 22, 2023 14:18
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