Skip to content

[Core] [no_early_kickoff] Fix ray start command output - #34081

Merged
jjyao merged 10 commits into
ray-project:masterfrom
jjyao:jjyao/msg
Apr 11, 2023
Merged

jjyao merged 10 commits into
ray-project:masterfrom
jjyao:jjyao/msg

Conversation

@jjyao

@jjyao jjyao commented Apr 4, 2023 •

Copy link
Copy Markdown
Contributor

Why are these changes needed?

With #32409, we stopped printing out information like dashboard url when creating a single node ray cluster on OSX and windows. This is a regression and this PR reverts back to the old behavior.

OSX and windows:

(test) jjyao@Jiajuns-MacBook-Pro:~/Workspace/ray1 jjyao/msg$ ray start --head
Usage stats collection is disabled.

Local node IP: 127.0.0.1

--------------------
Ray runtime started.
--------------------

Next steps
  
  To connect to this Ray cluster:
    import ray
    ray.init()
  
  To submit a Ray job using the Ray Jobs CLI:
    RAY_ADDRESS='http://127.0.0.1:8265' ray job submit --working-dir . -- python my_script.py
  
  See https://docs.ray.io/en/latest/cluster/running-applications/job-submission/index.html 
  for more information on submitting Ray jobs to the Ray cluster.
  
  To terminate the Ray runtime, run
    ray stop
  
  To view the status of the cluster, use
    ray status
  
  To monitor and debug Ray, view the dashboard at 
    127.0.0.1:8265
  
  If connection to the dashboard fails, check your firewall settings and network configuration.

Linux:

Local node IP: 172.31.34.95

--------------------
Ray runtime started.
--------------------

Next steps
  To add another node to this Ray cluster, run
    ray start --address='172.31.34.95:6379'
  
  To connect to this Ray cluster:
    import ray
    ray.init()
  
  To submit a Ray job using the Ray Jobs CLI:
    RAY_ADDRESS='http://127.0.0.1:8265' ray job submit --working-dir . -- python my_script.py
  
  See https://docs.ray.io/en/latest/cluster/running-applications/job-submission/index.html 
  for more information on submitting Ray jobs to the Ray cluster.
  
  To terminate the Ray runtime, run
    ray stop
  
  To view the status of the cluster, use
    ray status
  
  To monitor and debug Ray, view the dashboard at 
    127.0.0.1:8265
  
  If connection to the dashboard fails, check your firewall settings and network configuration.

Related issue number

Checks

@rkooo567 rkooo567 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.

do we still disallow to connect to win/mac nodes, and it can be enabled only by env var? If so, we should probably add that sentence to the default output?

Comment thread python/ray/scripts/scripts.py Outdated
# of the cluster. Please be careful when updating this line.
cli_logger.print(
cf.bold(" {} ray start --address='{}'"),
f"{ray_constants.ENABLE_RAY_CLUSTERS_ENV_VAR}=1"

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.

is this env var still useful?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yea, if you want to start a multi-node mac cluster, you need this env var.

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.

So, I'd like to understand the user journey here. Is this correct?

  1. win/mac users start ray using ray start --head
  2. they connect a worker node using ray start --address
  3. Get an error message that it needs an env var when starting ray start --head, and it is not recommended and not tested.
  4. users start env_var ray start --head

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. Also with this PR, the output of ray start --head won't contain instructions about how to create a worker node if it's osx or windows (it's hidden since it's not supported).

if bootstrap_address.startswith("127.0.0.1:"):
if ray_constants.ENABLE_RAY_CLUSTER:
if ray_constants.ENABLE_RAY_CLUSTER:
cli_logger.print("To add another node to this Ray cluster, run")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is now only printed when you want to start a multi-node cluster. This means by default you won't see this on OSX and windows unless you set the RAY_ENABLE_WINDOWS_OR_OSX_CLUSTER env.

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.

what's happening if you run ray start --address in win/mac? Does it raise an exception to set this env var?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I didn't change that behavior. Yes it will abort and raise an exception.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was also thinking whether we should check the value of address, if it's 127.0.0.1 we proceed (basically saying multi-node Ray cluster on a single machine is supported) otherwise we raise an exception to set this env var.

cf.magenta("."),
"ray{}init({})",
cf.magenta("."),
"_node_ip_address{}{}".format(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added this back because it's needed even for Linux when the node has multiple IPs, this make sure driver and the node use the same ip.

@scottsun94

scottsun94 commented Apr 5, 2023 •

Copy link
Copy Markdown
Contributor

To connect to this Ray instance from outside of the cluster, for example
when connecting to a remote cluster from your laptop, make sure the
dashboard (127.0.0.1:8265) is accessible and use the Ray Jobs API. For example:
RAY_ADDRESS='http://:8265' ray job submit --working-dir . -- python my_script.py

What do you mean by "To connect to this Ray instance from outside of the cluster"

  • use ray client?
  • use ray jobs api?
  • connect a worker node to the head node?
  • anything else?

I assume that it's about running ray jobs remotely via jobs api? ray client doesn't even use this port right? How about re-writing in this way?

To externally submit ray jobs to this cluster via Jobs API, make sure the dashboard address (127.0.0.1:8265) is accessible. View https://docs.ray.io/en/latest/cluster/running-applications/job-submission/index.html for more information.

One thing I'm not sure about is serve. Serve seems to rely on ray client port 100001? Maybe we don't have to cover it here since it's focused on ray core.

@scottsun94

Copy link
Copy Markdown
Contributor

If users only install ray instead of ray[default], all the output about dashboard, jobs, etc. will go away right?

Comment thread python/ray/scripts/scripts.py Outdated
"a remote client."
)
cli_logger.newline()
cli_logger.print("To see the status of the cluster, use")

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.

Suggested change
cli_logger.print("To see the status of the cluster, use")
cli_logger.print("To view the status of the cluster, use")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is view better than see?

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.

I think so. I don't find "see" used very often. It seems @angelinalg also suggested this kind of change here: #32854 (comment).

Comment thread python/ray/scripts/scripts.py Resolved
Comment thread python/ray/scripts/scripts.py Outdated
cli_logger.newline()
cli_logger.print(
cf.underlined(
"If connection fails, check your "

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.

What does this "connection" refer to?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question. @rkooo567 is it about dashboard cannot be seen?

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.

I think it is the case when you try accessing the dashboard outside the cluster. I am open to change the term. The current one sounds pretty bad. @scottsun94 any good suggestion?

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.

Just a bit more explicit? "If connection to Ray Dashboard fails, check your firewall settings and network configuration."

Comment thread python/ray/scripts/scripts.py Resolved
Signed-off-by: Jiajun Yao <[email protected]>

@rkooo567 rkooo567 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.

I will run and do final review tmrw

Comment thread python/ray/scripts/scripts.py Outdated
cli_logger.newline()
cli_logger.print(
cf.underlined(
"If connection fails, check your "

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.

I think it is the case when you try accessing the dashboard outside the cluster. I am open to change the term. The current one sounds pretty bad. @scottsun94 any good suggestion?

@rkooo567 rkooo567 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. But I wonder if we should change the order of command explanation. cc @scottsun94 for input.

I think the most important commands should be printed at the top/bottom because most of ppl probably don't read the full sentence. that said, we should not print ray stop at the end (it is not that useful). I'd like to suggest to make this change;

  1. Remove If connection to the dashboard fails, check your "... -> this sentence. It is not useful at all. Let's rather include the URL to the dashboard.
  2. For the order, I think it is ideal. Wdyt?
  • worker node connection
  • ray.init()
  • job submission
  • stop
  • ray status
  • dashboard

@scottsun94

Copy link
Copy Markdown
Contributor

LGTM. But I wonder if we should change the order of command explanation. cc @scottsun94 for input.

I think the most important commands should be printed at the top/bottom because most of ppl probably don't read the full sentence. that said, we should not print ray stop at the end (it is not that useful). I'd like to suggest to make this change;

  1. Remove If connection to the dashboard fails, check your "... -> this sentence. It is not useful at all. Let's rather include the URL to the dashboard.
  2. For the order, I think it is ideal. Wdyt?
  • worker node connection
  • ray.init()
  • job submission
  • stop
  • ray status
  • dashboard

The order makes sense to me.

@scottsun94

scottsun94 commented Apr 6, 2023 •

Copy link
Copy Markdown
Contributor

@jjyao
Just want to confirm: the common output for linux should be consistent with it of mac/windows?
It looked different in the example output above.

Signed-off-by: Jiajun Yao <[email protected]>

@rkooo567 rkooo567 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. Give me the merge sign when you think it is ready @scottsun94

@scottsun94

Copy link
Copy Markdown
Contributor

LGTM. Give me the merge sign when you think it is ready @scottsun94

Go ahead.

@jjyao jjyao added the release-blocker P0 Issue that blocks the release label Apr 10, 2023
Signed-off-by: Jiajun Yao <[email protected]>
@jjyao jjyao changed the title [Core] Fix ray start command output [Core] [no_early_kickoff] Fix ray start command output Apr 10, 2023
@jjyao

jjyao commented Apr 11, 2023

Copy link
Copy Markdown
Contributor Author

Failed tests are unrelated.

@jjyao
jjyao merged commit 3530ed0 into ray-project:master Apr 11, 2023
@jjyao
jjyao deleted the jjyao/msg branch April 11, 2023 04:06
jjyao added a commit that referenced this pull request Apr 11, 2023
With #32409, we stopped printing out information like dashboard url when creating a single node ray cluster on OSX and windows. This is a regression and this PR reverts back to the old behavior.

Signed-off-by: Jiajun Yao <[email protected]>
jjyao added a commit that referenced this pull request Apr 11, 2023
With #32409, we stopped printing out information like dashboard url when creating a single node ray cluster on OSX and windows. This is a regression and this PR reverts back to the old behavior.

Signed-off-by: Jiajun Yao <[email protected]>
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
With ray-project#32409, we stopped printing out information like dashboard url when creating a single node ray cluster on OSX and windows. This is a regression and this PR reverts back to the old behavior.

Signed-off-by: Jiajun Yao <[email protected]>
Signed-off-by: elliottower <[email protected]>
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request May 4, 2023
With ray-project#32409, we stopped printing out information like dashboard url when creating a single node ray cluster on OSX and windows. This is a regression and this PR reverts back to the old behavior.

Signed-off-by: Jiajun Yao <[email protected]>
Signed-off-by: Jack He <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-blocker P0 Issue that blocks the release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants