Skip to content

RHOAIENG-27175: add RayCluster name validation#1003

Merged
openshift-merge-bot[bot] merged 1 commit into
project-codeflare:mainfrom
DavidAdaRH:RHOAIENG-27175
Feb 25, 2026
Merged

RHOAIENG-27175: add RayCluster name validation#1003
openshift-merge-bot[bot] merged 1 commit into
project-codeflare:mainfrom
DavidAdaRH:RHOAIENG-27175

Conversation

@DavidAdaRH

@DavidAdaRH DavidAdaRH commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Issue link

https://issues.redhat.com/browse/RHOAIENG-27175

What changes have been made

Added validation for the RayCluster name field. Invalid names now raise a ValueError instead of surfacing as an API error.

Verification steps

  • Check out this branch.
  • Build whl file.
  • Create a RayCluster with an invalid name (e.g. empty string, uppercase or leading/trailing hyphen) and confirm a ValueError is raised with the new message.
# Create and configure our cluster object
# The SDK will try to find the name of your default local queue based on the annotation "kueue.x-k8s.io/default-queue": "true" unless you specify the local queue manually below
cluster = Cluster(ClusterConfiguration(
    name='Raytest', 
    head_cpu_requests='500m',
    head_cpu_limits='500m',
    head_memory_requests=5,
    head_memory_limits=8,
    head_extended_resource_requests={'nvidia.com/gpu':0}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests
    worker_extended_resource_requests={'nvidia.com/gpu':0},
    num_workers=2,
    worker_cpu_requests='250m',
    worker_cpu_limits=1,
    worker_memory_requests=4,
    worker_memory_limits=6,
    # image="", # Optional Field 
    write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources 
    # local_queue="local-queue-name" # Specify the local queue manually
))
  • Try invalid cluster names such as Raytest (capitals), raytest? (invalid characters) or empty string. Each should raise a ValueError.

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • Testing is not required for this change

@openshift-ci-robot

openshift-ci-robot commented Feb 10, 2026

Copy link
Copy Markdown
Collaborator

@DavidAdaRH: This pull request references RHOAIENG-27175 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Issue link

https://issues.redhat.com/browse/RHOAIENG-27175

What changes have been made

Created an error check for name field on the RayCluster. Raises Value Error instead of api error.

Verification steps

  • Checkout this branch.
  • Build whl file.
  • Try to initialise the below RayCluster
# Create and configure our cluster object
# The SDK will try to find the name of your default local queue based on the annotation "kueue.x-k8s.io/default-queue": "true" unless you specify the local queue manually below
cluster = Cluster(ClusterConfiguration(
   name='Raytest', 
   head_cpu_requests='500m',
   head_cpu_limits='500m',
   head_memory_requests=5,
   head_memory_limits=8,
   head_extended_resource_requests={'nvidia.com/gpu':0}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests
   worker_extended_resource_requests={'nvidia.com/gpu':0},
   num_workers=2,
   worker_cpu_requests='250m',
   worker_cpu_limits=1,
   worker_memory_requests=4,
   worker_memory_limits=6,
   # image="", # Optional Field 
   write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources 
   # local_queue="local-queue-name" # Specify the local queue manually
))
  • Try RayClusters names with Raytest (capital letters), raytest? (no ?!@%), they should all raise ValueErrors

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • Testing is not required for this change

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@kryanbeane kryanbeane added test-guided-notebooks Run PR check to verify Guided notebooks test-ui-notebooks Run PR check to verify UI notebooks test-additional-notebooks labels Feb 10, 2026
@openshift-ci-robot

openshift-ci-robot commented Feb 10, 2026

Copy link
Copy Markdown
Collaborator

@DavidAdaRH: This pull request references RHOAIENG-27175 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Issue link

https://issues.redhat.com/browse/RHOAIENG-27175

What changes have been made

Added validation for the RayCluster name field. Invalid names now raise a ValueError instead of surfacing as an API error.

Verification steps

  • Check out this branch.
  • Build whl file.
  • Create a RayCluster with an invalid name (e.g. empty string, uppercase or leading/trailing hyphen) and confirm a ValueError is raised with the new message.
# Create and configure our cluster object
# The SDK will try to find the name of your default local queue based on the annotation "kueue.x-k8s.io/default-queue": "true" unless you specify the local queue manually below
cluster = Cluster(ClusterConfiguration(
   name='Raytest', 
   head_cpu_requests='500m',
   head_cpu_limits='500m',
   head_memory_requests=5,
   head_memory_limits=8,
   head_extended_resource_requests={'nvidia.com/gpu':0}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests
   worker_extended_resource_requests={'nvidia.com/gpu':0},
   num_workers=2,
   worker_cpu_requests='250m',
   worker_cpu_limits=1,
   worker_memory_requests=4,
   worker_memory_limits=6,
   # image="", # Optional Field 
   write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources 
   # local_queue="local-queue-name" # Specify the local queue manually
))
  • Try invalid cluster names such as Raytest (capitals), raytest? (invalid characters) or empty string. Each should raise a ValueError.

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • Testing is not required for this change

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@codecov

codecov Bot commented Feb 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.98%. Comparing base (b74b01b) to head (150ffdd).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1003      +/-   ##
==========================================
+ Coverage   95.97%   95.98%   +0.01%     
==========================================
  Files          23       23              
  Lines        2211     2217       +6     
==========================================
+ Hits         2122     2128       +6     
  Misses         89       89              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chipspeak chipspeak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM David and cheers for this! Love me a good regex!

@openshift-ci openshift-ci Bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 11, 2026
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 16, 2026
@openshift-ci-robot

openshift-ci-robot commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator

@DavidAdaRH: This pull request references RHOAIENG-27175 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Issue link

https://issues.redhat.com/browse/RHOAIENG-27175

What changes have been made

Added validation for the RayCluster name field. Invalid names now raise a ValueError instead of surfacing as an API error.

Verification steps

  • Check out this branch.
  • Build whl file.
  • Create a RayCluster with an invalid name (e.g. empty string, uppercase or leading/trailing hyphen) and confirm a ValueError is raised with the new message.
# Create and configure our cluster object
# The SDK will try to find the name of your default local queue based on the annotation "kueue.x-k8s.io/default-queue": "true" unless you specify the local queue manually below
cluster = Cluster(ClusterConfiguration(
   name='Raytest', 
   head_cpu_requests='500m',
   head_cpu_limits='500m',
   head_memory_requests=5,
   head_memory_limits=8,
   head_extended_resource_requests={'nvidia.com/gpu':0}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests
   worker_extended_resource_requests={'nvidia.com/gpu':0},
   num_workers=2,
   worker_cpu_requests='250m',
   worker_cpu_limits=1,
   worker_memory_requests=4,
   worker_memory_limits=6,
   # image="", # Optional Field 
   write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources 
   # local_queue="local-queue-name" # Specify the local queue manually
))
  • Try invalid cluster names such as Raytest (capitals), raytest? (invalid characters) or empty string. Each should raise a ValueError.

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • Testing is not required for this change

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot

openshift-ci-robot commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator

@DavidAdaRH: This pull request references RHOAIENG-27175 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Issue link

https://issues.redhat.com/browse/RHOAIENG-27175

What changes have been made

Added validation for the RayCluster name field. Invalid names now raise a ValueError instead of surfacing as an API error.

Verification steps

  • Check out this branch.
  • Build whl file.
  • Create a RayCluster with an invalid name (e.g. empty string, uppercase or leading/trailing hyphen) and confirm a ValueError is raised with the new message.
# Create and configure our cluster object
# The SDK will try to find the name of your default local queue based on the annotation "kueue.x-k8s.io/default-queue": "true" unless you specify the local queue manually below
cluster = Cluster(ClusterConfiguration(
   name='Raytest', 
   head_cpu_requests='500m',
   head_cpu_limits='500m',
   head_memory_requests=5,
   head_memory_limits=8,
   head_extended_resource_requests={'nvidia.com/gpu':0}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests
   worker_extended_resource_requests={'nvidia.com/gpu':0},
   num_workers=2,
   worker_cpu_requests='250m',
   worker_cpu_limits=1,
   worker_memory_requests=4,
   worker_memory_limits=6,
   # image="", # Optional Field 
   write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources 
   # local_queue="local-queue-name" # Specify the local queue manually
))
  • Try invalid cluster names such as Raytest (capitals), raytest? (invalid characters) or empty string. Each should raise a ValueError.

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • Testing is not required for this change

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot

openshift-ci-robot commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator

@DavidAdaRH: This pull request references RHOAIENG-27175 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Issue link

https://issues.redhat.com/browse/RHOAIENG-27175

What changes have been made

Added validation for the RayCluster name field. Invalid names now raise a ValueError instead of surfacing as an API error.

Verification steps

  • Check out this branch.
  • Build whl file.
  • Create a RayCluster with an invalid name (e.g. empty string, uppercase or leading/trailing hyphen) and confirm a ValueError is raised with the new message.
# Create and configure our cluster object
# The SDK will try to find the name of your default local queue based on the annotation "kueue.x-k8s.io/default-queue": "true" unless you specify the local queue manually below
cluster = Cluster(ClusterConfiguration(
   name='Raytest', 
   head_cpu_requests='500m',
   head_cpu_limits='500m',
   head_memory_requests=5,
   head_memory_limits=8,
   head_extended_resource_requests={'nvidia.com/gpu':0}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests
   worker_extended_resource_requests={'nvidia.com/gpu':0},
   num_workers=2,
   worker_cpu_requests='250m',
   worker_cpu_limits=1,
   worker_memory_requests=4,
   worker_memory_limits=6,
   # image="", # Optional Field 
   write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources 
   # local_queue="local-queue-name" # Specify the local queue manually
))
  • Try invalid cluster names such as Raytest (capitals), raytest? (invalid characters) or empty string. Each should raise a ValueError.

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • Testing is not required for this change

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Feb 25, 2026
@openshift-ci

openshift-ci Bot commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chipspeak, kryanbeane

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [chipspeak,kryanbeane]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot Bot merged commit 300c9c4 into project-codeflare:main Feb 25, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference lgtm Indicates that a PR is ready to be merged. test-additional-notebooks test-guided-notebooks Run PR check to verify Guided notebooks test-ui-notebooks Run PR check to verify UI notebooks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants