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

Validate slice against available resources. #305

Merged
merged 53 commits into from
May 7, 2024
Merged

Conversation

kthare10
Copy link
Collaborator

  • Added validation to add_node and add_component to check if the requested node/component is feasible to provision based on available resources on the requested site. This check can be performed as nodes/components are added. By default, it is disabled for backward compatibility and due performance hit caused by list_resources. Check can be considered to be enabled by default in 1.7 if needed once perf improvements for list_resources

  • Added slice.validate() call to check the slice at the end. Users can invoke this explicitly to verify if their configuration is a valid config.

Code Snippet for Usage:
- Enable validation as nodes/components are added

# Create a slice
slice = fablib.new_slice(name="MySlice")

# Add a node
node1 = slice.add_node(name="Node1", site="RENC", host="uky-w1.fabric-testbed.net", check=True)
# Here node1 is invalid request would be errored and removed from the slice

node2 = slice.add_node(name="Node2", site="RENC", check=True)
node2.add_component(model='NIC_Basic', name='nic2')
node2.add_component(model='GPU_RTX6000', name='gpu1')
node2.add_component(model='GPU_TeslaT4', name='gpu3')
# Here node2 is invalid request as you can not have T4 and RTX600 both on a single worker

- Validate a slice

# Create a slice
slice = fablib.new_slice(name="MySlice")

# Add a node
node1 = slice.add_node(name="Node1", site="RENC", host="uky-w1.fabric-testbed.net")
# Here node1 is invalid request would be errored and removed from the slice

node2 = slice.add_node(name="Node2", site="RENC")
node2.add_component(model='NIC_Basic', name='nic2')
node2.add_component(model='GPU_RTX6000', name='gpu1')
node2.add_component(model='GPU_TeslaT4', name='gpu3')
# Here node2 is invalid request as you can not have T4 and RTX600 both on a single worker

# This call will report both the errors identified above
slice.validate()

@kthare10 kthare10 requested review from sajith and paul-ruth April 11, 2024 23:19
@kthare10 kthare10 removed request for sajith and paul-ruth April 12, 2024 00:42
@kthare10 kthare10 requested review from sajith and paul-ruth April 12, 2024 02:39
@kthare10 kthare10 marked this pull request as ready for review April 12, 2024 02:40
Copy link
Member

@sajith sajith left a comment

Choose a reason for hiding this comment

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

Asking some questions, out of curiosity mainly. :-)

fabrictestbed_extensions/fablib/component.py Show resolved Hide resolved
fabrictestbed_extensions/fablib/fablib.py Outdated Show resolved Hide resolved
fabrictestbed_extensions/fablib/fablib.py Outdated Show resolved Hide resolved
@kthare10 kthare10 changed the base branch from main to rel1.7 May 7, 2024 21:22
@kthare10 kthare10 merged commit 42b0581 into rel1.7 May 7, 2024
4 checks passed
@kthare10 kthare10 linked an issue May 29, 2024 that may be closed by this pull request
@kthare10 kthare10 deleted the validate-slice branch July 18, 2024 19:02
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.

Deny Infeasible Slices Error *may* be inaccurate or wrong when I issue an invalid configuration.
2 participants