-
Notifications
You must be signed in to change notification settings - Fork 321
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
[Feature] Test sample RayService YAML to catch invalid or out of date one #731
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank @jasoonn for your contribution!
@kevin85421 Thanks for the suggestions. I have updated the pr. |
@shrekris-anyscale Can you help review the |
@kevin85421 Thanks for the suggestions. I have updated the pr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are too many shell = ..., check = ...
. Can we simplify it?
@kevin85421 Thanks for the suggestion. I have updated the pr. |
@kevin85421 Thanks for the suggestion. I have updated the pr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @kevin85421 @jasoonn , is this test enabled in ci? (I don't see it is enabled.) |
@sihanwang41 No, KubeRay CI (2 CPUs) does not have enough CPUs to run this test. I will deploy these tests in Ray CI (#695). |
… one (ray-project#731) Use ray-project#605 to test sample RayService YAML. The test includes the following two checking rules. 1. It is able to [submit a simple job](https://github.com/jasoonn/kuberay/blob/69efe590970f9d8a4fe0fff66300049f008c6ae9/tests/framework/prototype.py#L188-L197) to the created raycluster. 2. It is able to use [curl in the pod](https://github.com/jasoonn/kuberay/blob/69efe590970f9d8a4fe0fff66300049f008c6ae9/tests/framework/prototype.py#L199-L216) to access the service.
Why are these changes needed?
Use #605 to test sample RayService YAML.
The test includes the following two checking rules.
Why we choose Subprocess instead of os.system
According to doc of
os.system
, the subprocess module provides more powerful facilities for spawning new processes and retrieving their results; usingsubprocess
is preferable to using this function.shell=True
in subprocess.run(): The specified command will be executed through the shell.check=True
in some of subprocess.run(): If the process exits with a non-zero exit code, a CalledProcessError exception will be raised.Why removing the
kubectl wait
when creating kind clusterkuberay/tests/framework/prototype.py
Lines 46 to 50 in 12225db
Sometimes when calling
"kubectl wait --for=condition=ready pod -n kube-system --all --timeout=900s"
, it will report an errorerror: no matching resources found
(example log in line 1157), which I think because the namespace has not yet been created. When this situation happened, the test in the past still passed because we only use os.system() to execute the command and do not check the return code. In this pr, we updatedos.system
tosubprocess.run(..., check=True)
which will automatically raise an error when the return code of the exection is not 0. To solve this, we utilize--wait
flag in kind to substitute thekubectl wait
functionality.Why we set
tail=-1
in getting log?kuberay/tests/framework/prototype.py
Line 128 in 48b0b05
The argument
tail
default is -1 with no selector, showing all log lines. However, we utilize a selector in this case. Hence, we need to specify--tail=-1
to display all of the log.Related issue number
Closes #719
Checks