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 cluster nodes info test #299

Merged
merged 2 commits into from
Jun 28, 2022

Conversation

wilsonwang371
Copy link
Collaborator

Why are these changes needed?

add more tests for kuberay

Related issue number

#298

Checks

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

@wilsonwang371 wilsonwang371 force-pushed the wilson/cluster_info_test branch 6 times, most recently from 95dbc93 to 5ed0807 Compare June 9, 2022 20:09
@wilsonwang371
Copy link
Collaborator Author

cc. @Jeffwan @DmitriGekhtman

@DmitriGekhtman
Copy link
Collaborator

Looks good to me -- are we just adding a check that the worker is connected to Ray?

@wilsonwang371
Copy link
Collaborator Author

Looks good to me -- are we just adding a check that the worker is connected to Ray?

so far this code checks the number of nodes in the cluster, not the details. I think this simple check is ok for now.

@DmitriGekhtman
Copy link
Collaborator

so far this code checks the number of nodes in the cluster, not the details. I think this simple check is ok for now.

Checking len(ray.nodes) does confirm that the worker was registered to the Ray cluster -- there are internally a lot of details for that happen, so this simple check is valuable!

def tearDown(self):
def test_cluster_info(self):
client = docker.from_env()
container = client.containers.run(ray_image,
Copy link
Collaborator

Choose a reason for hiding this comment

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

containers.run is equivalent to docker run or docker exec? Seems it just create a new container based on ray_image and execute the following scripts locally but not test against kuberay cluster. @wilsonwang371

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

correct. This container is using hostnetwork and will connect to the ray cluster through host port exposed by kind.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add a couple of comments in the code explaining the use of the docker client?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@wilsonwang371 Let's add a comment here? otherwise, I feel people may have similar confusion like me. This code snippet assumes the following prerequisite

https://github.com/ray-project/kuberay/blob/7f16c1205ee7f484ee08e68d38d563947e31a5fa/tests/config/raycluster-service.yaml#L18-L21

https://github.com/ray-project/kuberay/blob/7f16c1205ee7f484ee08e68d38d563947e31a5fa/tests/config/cluster-config.yaml#L20-L23

Using ray.util.connect probably makes more sense because it won't init the cluster in any scenario.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The reason for not calling ray.util.connect is because we want exactly the same version of ray for both the ray cluster and the ray client.

@wilsonwang371 Let's add a comment here? otherwise, I feel people may have similar confusion like me. This code snippet assumes the following prerequisite

https://github.com/ray-project/kuberay/blob/7f16c1205ee7f484ee08e68d38d563947e31a5fa/tests/config/raycluster-service.yaml#L18-L21

https://github.com/ray-project/kuberay/blob/7f16c1205ee7f484ee08e68d38d563947e31a5fa/tests/config/cluster-config.yaml#L20-L23

Using ray.util.connect probably makes more sense because it won't init the cluster in any scenario.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For KubeRay tests in the Ray CI, we install Ray in the host environment to test Ray Client and Job Submission.

Using docker directly works as well. Kubectl exec would probably work too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe later we can switch to install particular version of Ray on the host environment too.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The reason for not calling ray.util.connect is because we want exactly the same version of ray for both the ray cluster and the ray client.

em. Is this related? We can still use the exact same version by using ray.util.connect instead of ray.init. Am i missing something?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The reason for not calling ray.util.connect is because we want exactly the same version of ray for both the ray cluster and the ray client.

em. Is this related? We can still use the exact same version by using ray.util.connect instead of ray.init. Am i missing something?

Copy link
Collaborator

Choose a reason for hiding this comment

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

ray.init("ray://...") is the preferred API for Ray client these days.

If I understand right, the issue is that we don't currently have the same Ray version installed in the host CI environment as in the Ray pods in KinD, so Ray Client in the host will fail to connect to the server in the Ray head pod.

@Jeffwan
Copy link
Collaborator

Jeffwan commented Jun 28, 2022

The change looks good to me and let's merge it

@Jeffwan Jeffwan merged commit b2f733e into ray-project:master Jun 28, 2022
@wilsonwang371 wilsonwang371 deleted the wilson/cluster_info_test branch June 29, 2022 19:57
lowang-bh pushed a commit to lowang-bh/kuberay that referenced this pull request Sep 24, 2023
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