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

Add KubeRay e2e Test for custom idleTimeoutSeconds with v2 Autoscaler #2725

Merged
merged 4 commits into from
Jan 29, 2025

Conversation

ryanaoleary
Copy link
Contributor

@ryanaoleary ryanaoleary commented Jan 10, 2025

Why are these changes needed?

This PR adds a test case for custom idleTimeoutSeconds per worker group supported by the V2 Autoscaler starting in ray 2.40.0. The test case verifies that idleTimeoutSeconds for a worker group override the default idleTimeoutSeconds set in the autoscalerOptions by scaling up replicas of each type and then checking that they are terminated within the expected period.

This PR was tested by running go test -timeout 30m -v ./test/e2eautoscaler with the nightly version of the KubeRay operator installed, since the change adding this field to the WorkerGroupSpec api is not yet part of a release.

Related issue number

#2561

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

Sorry, something went wrong.

Signed-off-by: Ryan O'Leary <ryanaoleary@google.com>
Signed-off-by: Ryan O'Leary <ryanaoleary@google.com>
Signed-off-by: Ryan O'Leary <ryanaoleary@google.com>
Signed-off-by: Ryan O'Leary <ryanaoleary@google.com>
@kevin85421 kevin85421 self-assigned this Jan 22, 2025
@kevin85421
Copy link
Member

cc @rueian would you mind reviewing this PR?

func TestRayClusterAutoscalerV2IdleTimeout(t *testing.T) {
// Only test with the V2 Autoscaler
name := "Create a RayCluster with autoscaler v2 enabled"
tc := tests["Create a RayCluster with autoscaler v2 enabled"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
tc := tests["Create a RayCluster with autoscaler v2 enabled"]
tc, ok := tests[name]

Copy link
Contributor

Choose a reason for hiding this comment

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

We can make the test fail if !ok

namespace := test.NewTestNamespace()

// Minimum Ray Version for custom idleTimeoutSeconds
idleTimeoutMinRayVersion := "2.40.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't have a convention for stating the minimum requirement in tests, so you can just use the current version by GetRayVersion().

Copy link
Member

@kevin85421 kevin85421 left a comment

Choose a reason for hiding this comment

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

It's better to update the test logic to:

  1. Deploy a detached actor on worker group 1 (wg1, idleTimeoutSeconds: 10s)
  2. Deploy a detached actor on worker group 2 (wg2, idleTimeoutSeconds: 30s)
  3. Terminate the detached actor on wg1, and make sure the worker Pod is terminated around 10s.
  4. Terminate the detached actor on wg2, and make sure the worker Pod is terminated around 30s.

I will merge this PR directly. @rueian will open a follow up PR.

@kevin85421 kevin85421 merged commit d0e8b57 into ray-project:master Jan 29, 2025
24 checks passed
@kevin85421 kevin85421 mentioned this pull request Jan 29, 2025
2 tasks
kevin85421 added a commit to kevin85421/kuberay that referenced this pull request Jan 29, 2025
@kevin85421
Copy link
Member

Revert this PR. This test is pretty flaky.

@ryanaoleary
Copy link
Contributor Author

ryanaoleary commented Jan 29, 2025

Revert this PR. This test is pretty flaky.

Are there any error outputs from the flaky test runs? When I run this locally I see it passing. I can resolve the comments in #2725 (review) and add a longer timeout in a new PR that I think would likely resolve the flakiness.

@rueian
Copy link
Contributor

rueian commented Jan 29, 2025

Hi @ryanaoleary, here is the full log:
ray-ecosystem-ci-kuberay-ci_build_6379_test-autoscaler-e2e-nightly-operator.log

You can search TestRayClusterAutoscalerV2IdleTimeout in it.

image

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.

None yet

3 participants