-
Notifications
You must be signed in to change notification settings - Fork 6.6k
[Dashboard] Add flush()
after job_id
is populated
#52780
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
Conversation
Signed-off-by: LeoLiao123 <[email protected]>
@MortalHappiness PTAL |
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. Thanks!
This is not a good thing to rely on, it's not a public API... do we have plans to fix it? You should be able to use the REST API directly instead? |
@@ -302,6 +302,7 @@ def submit( | |||
cli_logger.print(cf.bold(f"ray job stop {job_id}")) | |||
|
|||
cli_logger.newline() | |||
cli_logger.flush() |
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.
please leave a comment here so that it isn't inadvertently broken again in the future
and see my other feedback, we really shouldn't rely on these types of behavior
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.
@edoakes I’ve added the comment. Thanks for the review!
The kubectl Ray plugin is for interactive use in non-production environments, so I thought it was acceptable. But if you think we should not depend on it, I can open an issue in KubeRay and find some contributors to work on replacing it with the dashboard API instead. Currently |
Created issue ray-project/kuberay#3556. I'll add more description on that issue. |
Wrapping |
Okay I got your point. We'll still call the |
Signed-off-by: LeoLiao123 <[email protected]>
Head branch was pushed to by a user without write access
Signed-off-by: LeoLiao123 <[email protected]>
Signed-off-by: LeoLiao123 <[email protected]>
b4d64b5
to
f42e485
Compare
) See the issue description and [debugging details](ray-project/kuberay#3508 (comment)) in [ray-project/kuberay#3508](ray-project/kuberay#3508). ## Manual Test command : ```bash kubectl ray job submit\ --working-dir . \ --name my-rayjob \ --runtime-env-json='{"excludes":[ "ray-operator/bin", "ray-operator/bin/k8s", ".git", "apiserver/pkg/swagger/datafile.go" ]}' \ -- python task.py | ts '[%Y-%m-%d %H:%M:%S]' ``` `task.py` : ```python import time import ray ray.init(address="auto") @ray.remote def f(): for i in range(20): print(i) time.sleep(1) return 1 print(ray.get([f.remote()])) ``` **Result before adding `flush()`** Log output is delayed until after `task.py` completes :  `my-rayjob` remains in the `Waiting` state until the script finishes :  **Result after adding `flush()`** Log output appears immediately after submission :  `my-rayjob` transitions to `Running` state right after submission.  Closes ray-project/kuberay#3508 --------- Signed-off-by: LeoLiao123 <[email protected]> Signed-off-by: zhaoch23 <[email protected]>
) See the issue description and [debugging details](ray-project/kuberay#3508 (comment)) in [ray-project/kuberay#3508](ray-project/kuberay#3508). ## Manual Test command : ```bash kubectl ray job submit\ --working-dir . \ --name my-rayjob \ --runtime-env-json='{"excludes":[ "ray-operator/bin", "ray-operator/bin/k8s", ".git", "apiserver/pkg/swagger/datafile.go" ]}' \ -- python task.py | ts '[%Y-%m-%d %H:%M:%S]' ``` `task.py` : ```python import time import ray ray.init(address="auto") @ray.remote def f(): for i in range(20): print(i) time.sleep(1) return 1 print(ray.get([f.remote()])) ``` **Result before adding `flush()`** Log output is delayed until after `task.py` completes :  `my-rayjob` remains in the `Waiting` state until the script finishes :  **Result after adding `flush()`** Log output appears immediately after submission :  `my-rayjob` transitions to `Running` state right after submission.  Closes ray-project/kuberay#3508 --------- Signed-off-by: LeoLiao123 <[email protected]> Signed-off-by: Vicky Tsang <[email protected]>
) See the issue description and [debugging details](ray-project/kuberay#3508 (comment)) in [ray-project/kuberay#3508](ray-project/kuberay#3508). ## Manual Test command : ```bash kubectl ray job submit\ --working-dir . \ --name my-rayjob \ --runtime-env-json='{"excludes":[ "ray-operator/bin", "ray-operator/bin/k8s", ".git", "apiserver/pkg/swagger/datafile.go" ]}' \ -- python task.py | ts '[%Y-%m-%d %H:%M:%S]' ``` `task.py` : ```python import time import ray ray.init(address="auto") @ray.remote def f(): for i in range(20): print(i) time.sleep(1) return 1 print(ray.get([f.remote()])) ``` **Result before adding `flush()`** Log output is delayed until after `task.py` completes :  `my-rayjob` remains in the `Waiting` state until the script finishes :  **Result after adding `flush()`** Log output appears immediately after submission :  `my-rayjob` transitions to `Running` state right after submission.  Closes ray-project/kuberay#3508 --------- Signed-off-by: LeoLiao123 <[email protected]> Signed-off-by: Scott Lee <[email protected]>
Why are these changes needed?
See the issue description and debugging details in ray-project/kuberay#3508.
Manual Test
command :
task.py
:Result before adding

flush()
Log output is delayed until after
task.py
completes :my-rayjob
remains in theWaiting
state until the script finishes :Result after adding


flush()
Log output appears immediately after submission :
my-rayjob
transitions toRunning
state right after submission.Related issue number
Closes ray-project/kuberay#3508
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.