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

[develop] Introduce InstanceRequirements schema and resource #5419

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

NSsirena
Copy link
Contributor

Description of changes

  • Add InstanceRequirementDefinition class to collect instance attributes
  • Add InstanceRequirementsComputeResource class to allow the definition of a CR through IR
  • Add InstanceRequirementsSchema to define the public contract
  • Add unit tests to validate the InstanceRequirements Schema

Tests

  • Unit tests are passing.

References

  • None

Checklist

  • Make sure you are pointing to the right branch and add a label in the PR title (i.e. 2.x vs 3.x)
  • Check all commits' messages are clear, describing what and why vs how.
  • Make sure to have added unit tests or integration tests to cover the new/modified code.
  • Check if documentation is impacted by this change.

Add InstanceRequirementsDefinition class to hold all
the attributes required to define a ComputeResource.

Add a InstanceRequirementsComputeResource to model a
ComputeResource defined through IntanceRequirements.

Signed-off-by: Nicola Sirena <[email protected]>
@NSsirena NSsirena added the 3.x label Jun 21, 2023
@NSsirena NSsirena force-pushed the wip/instance-requirements branch from a27eb67 to 07aa96f Compare June 21, 2023 14:52
NSsirena added 4 commits June 21, 2023 17:07
Add InstanceRequirementsSchema class to define the
customer facing contract of the feature.

Extends SlurmComputeResourceSchema to support
InstanceRequirementsSchema definitions.

Signed-off-by: Nicola Sirena <[email protected]>
Signed-off-by: Nicola Sirena <[email protected]>
A set of InstanceRequirements may return a long list
of instance-types (or none) depening on the attributes,
the region and the architecture.

Signed-off-by: Nicola Sirena <[email protected]>
@NSsirena NSsirena force-pushed the wip/instance-requirements branch from 07aa96f to 2a45dac Compare June 21, 2023 15:08
Copy link
Contributor

@enrico-usai enrico-usai left a comment

Choose a reason for hiding this comment

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

I just opened the patch and left some comments, but I didn't look at the whole patch.

@@ -8,6 +8,7 @@ CHANGELOG
- Allow configuration of static and dynamic node priorities in Slurm compute resources via the ParallelCluster configuration YAML file.
- Add support for Ubuntu 22.
- Allow memory-based scheduling when multiple instance types are specified for a Slurm Compute Resource.
- Allow definition of a Slurm Compute Resource through InstanceRequirements.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: InstanceRequirements

}

response = self._client.get_instance_types_from_instance_requirements(config)
if "InstanceTypes" in response:
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: you could write:

instance_types = response.get("InstanceTypes", [])
return [res.get("InstanceType") for res in instance_types]

or:

return [instance_types.get("InstanceType") for instance_types in response.get("InstanceTypes", [])]

if self.accelerator_count > 0:
self.accelerator_types = ["gpu"]
self.accelerator_manufacturers = ["nvidia"]
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

if you're forcing a specific behaviour you can avoid the set in the previous lines, that is useless:

        self.accelerator_types = accelerator_types
        self.accelerator_manufacturers = accelerator_manufacturers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants