Repository navigation
Description
What is the problem?
With my previous version of Ray (0.7.7), I had a cluster.yaml file that worked well, but it has since stopped working since I upgraded to 0.9.0.dev0 to include a recent tune bug fix for PAUSED trials. When I run a test script after running ray up cluster.yaml, only the head node is visible and I’m getting this warning:
2020-03-16 19:48:44,344 WARNING worker.py:802 -- When connecting to an existing cluster, _internal_config must match the cluster's _internal_config.
I know that there is a firewall between my machines, so I had to open specific ports and force Ray to use them in my cluster YAML file previously, so maybe there were some new port changes that are blocking communication?
Ray version and other system information (Python version, TensorFlow version, OS):
Ray: 0.9.0.dev0
OS: Centos 7
Reproduction (REQUIRED)
Please provide a script that can be run to reproduce the issue. The script should have no external library dependencies (i.e., use fake or mock data / environments):
My cluster.yaml is:
cluster_name: asedler_nesu
## NOTE: Typically for local clusters, min_workers == initial_workers == max_workers.
# The minimum number of workers nodes to launch in addition to the head
# node. This number should be >= 0.
# Typically, min_workers == initial_workers == max_workers.
min_workers: 1
# The initial number of worker nodes to launch in addition to the head node.
# Typically, min_workers == initial_workers == max_workers.
initial_workers: 1
# The maximum number of workers nodes to launch in addition to the head node.
# This takes precedence over min_workers.
# Typically, min_workers == initial_workers == max_workers.
max_workers: 1
# Autoscaling parameters.
# Ignore this if min_workers == initial_workers == max_workers.
autoscaling_mode: default
target_utilization_fraction: 0.8
idle_timeout_minutes: 5
# This executes all commands on all nodes in the docker container,
# and opens all the necessary ports to support the Ray cluster.
# Empty string means disabled. Assumes Docker is installed.
docker:
image: "" # e.g., tensorflow/tensorflow:1.5.0-py3
container_name: "" # e.g. ray_docker
# If true, pulls latest version of image. Otherwise, `docker run` will only pull the image
# if no cached version is present.
pull_before_run: True
run_options: [] # Extra options to pass into "docker run"
# Local specific configuration.
provider:
type: local
head_ip: neuron.bme.emory.edu
worker_ips:
- sulcus.bme.emory.edu
# How Ray will authenticate with newly launched nodes.
auth:
ssh_user: asedler
ssh_private_key: ~/.ssh/id_rsa
# Leave this empty.
head_node: {}
# Leave this empty.
worker_nodes: {}
# Files or directories to copy to the head and worker nodes. The format is a
# dictionary from REMOTE_PATH: LOCAL_PATH, e.g.
file_mounts: {
# "/path1/on/remote/machine": "/path1/on/local/machine",
# "/path2/on/remote/machine": "/path2/on/local/machine",
}
# List of commands that will be run before `setup_commands`. If docker is
# enabled, these commands will run outside the container and before docker
# is setup.
initialization_commands: []
# List of shell commands to run to set up each nodes.
setup_commands: []
# Custom commands that will be run on the head node after common setup.
head_setup_commands: []
# Custom commands that will be run on worker nodes after common setup.
worker_setup_commands: []
# NOTE: Modified the following commands to use the tf2-gpu environment
# and to use specific ports that have been opened for this purpose
# by Andrew Sedler ([email protected])
# Command to start ray on the head node. You don't need to change this.
head_start_ray_commands:
- conda activate tf2-gpu && ray stop
- conda activate tf2-gpu && ulimit -c unlimited && ray start --head --redis-port=6379 --redis-shard-ports=59519 --node-manager-port=19580 --object-manager-port=39066 --autoscaling-config=~/ray_bootstrap_config.yaml
# Command to start ray on worker nodes. You don't need to change this.
worker_start_ray_commands:
- conda activate tf2-gpu && ray stop
- conda activate tf2-gpu && ray start --redis-address=$RAY_HEAD_IP:6379 --node-manager-port=19580 --object-manager-port=39066
The test script is:
ray.init(address="localhost:6379")
import time
from pprint import pprint
@ray.remote
def f():
time.sleep(0.01)
return ray.services.get_node_ip_address()
# Get a list of the IP addresses of the nodes that have joined the cluster.
pprint(set(ray.get([f.remote() for _ in range(1000)])))
If we cannot run your script, we cannot fix your issue.
- I have verified my script runs in a clean environment and reproduces the issue.
- I have verified the issue also occurs with the latest wheels.
Activity
richardliaw commentedon Mar 17, 2020
Hm, Can you provide a full console log from running the test script?
arsedler9 commentedon Mar 17, 2020
Sure, here's the full console output from starting the cluster to running the test script:
richardliaw commentedon Mar 17, 2020
What if you try
ray.init(address="auto")?Also, can you do
which rayon the command-line, and alsoimport ray; print(ray.__file__)in python?richardliaw commentedon Mar 17, 2020
The next thing to try is
ray start --head --redis-port 6379and then also in python, runray.init(address="auto").arsedler9 commentedon Mar 18, 2020
Sure, here's the output corresponding to your first comment. Looks like
which rayreturns what I'd expect and so doesprint(ray.__file__)but usingaddress='auto'raises an error.arsedler9 commentedon Mar 18, 2020
In response to your second comment, I tried running via the command line through the open ports with the following commands:
Head node:
On the worker node (same command used in cluster.yaml, but had to use
--addressinstead of--redis-addressand replaced$RAY_HEAD_IPwith the actual IP because that environment variable was unassigned):And then when I run the script with
address="auto", I don't get the same error as before, but I do still get the warning and still only see the head node IP:Interestingly though, I now see both machines in the dashboard:

richardliaw commentedon Mar 18, 2020
The warning is a bug (#7647). The dashboard looks good; is it possible to print
ray.cluster_resources()?richardliaw commentedon Mar 18, 2020
Also, in terms of port blocking communication, can you try opening a large range of ports between each machine (or maybe all ports)? We recently enabled direct actor calls, which requires each worker to communicate with all other workers.
arsedler9 commentedon Mar 18, 2020
The
ray.cluster_resources()command seems to report the resources from both machines:Okay, as far as I know, nothing has changed since the last time I tested, other than a lab-mate using these machines to run a separate job, but now when I run the test script, I'm seeing this error message repeated a bunch of times. Will try the port idea next.
arsedler9 commentedon Mar 18, 2020
With all ports open, I'm seeing both of the machine IP's reported, like I expected! So it must be a port issue. With our current setup, though, we'd prefer not to keep all ports open. How can I tell which ports I should open for the direct actor calls? Is there a way I can specify which ports to use, like I did with the other options:
--redis-port=6379 --redis-shard-ports=59519 --node-manager-port=19580 --object-manager-port=39066?EDIT: But unfortunately, I still only see one IP reported and only one machine in the dashboard when I use my old cluster.yaml, even with all ports open.
richardliaw commentedon Mar 19, 2020
Is there a way to specify ports with direct actor calls? @ericl @edoakes
RE: old cluster yaml, what's the difference between the "start_ray_commands" on the old cluster yaml and what you ran just now?
arsedler9 commentedon Mar 19, 2020
Ahh, okay I figured it out the issue with my
cluster.yaml. I updated--redis-addressto--addressin the worker command and now I can runray up cluster.yamlsuccessfully when all ports are open.Now just need to be able to specify the direct actor ports.
edoakes commentedon Mar 19, 2020
@arsedler9 unfortunately there isn't currently an option to specify direct actor ports, but we can prioritize adding that option soon. Would it suffice for you to be able to specify a range of ports, e.g., 8000-9000, that workers/actors will bind on each node?
arsedler9 commentedon Mar 19, 2020
Thanks @edoakes , I think that being able to specify a range of ports for Ray to use would work well! If we could also have Ray choose
redis-port,redis-shard-ports,node-manager-port, andobject-manager-portfrom within that specified range, that would be great. How many direct actor ports will need to be opened?11 remaining items
arsedler9 commentedon Jun 1, 2020
Hi @edoakes @richardliaw , I just wanted to post here again because I don't think the issue above has been resolved. I'm still not able to run Ray on multiple machines when the firewall is on. Here are my steps to reproduce (using the latest nightly build of Ray):
On machine
neuron, make sure that the ports to use (10000-10099) are open:On machine
neuron, start the head node:On machine
sulcus, check that the desired ports are open (10000-10099)On machine
sulcus, start the worker node:Run the testing python script. Note that it only shows the head node.
Stop ray on both machines and deactivate the firewalls:
Re-run the same exact Ray start commands and test script as above:
So, I think some ports that Ray requires are still blocked. Can you help me figure this out? Thanks!
edoakes commentedon Jun 15, 2020
@arsedler9 do you think you could post the logs in the raylet from the worker nodes? They should be in
~/tmp/ray/session_latest/logs/raylet.{out,err}. That should help us figure out what's going wrong.arsedler9 commentedon Jun 16, 2020
Thanks @edoakes! Here is the output from the raylet logs. Looks like
.outhas some info, but.erris empty.rkooo567 commentedon Jun 23, 2020
@edoakes Is supporting GCS port resolving this issue? If so, I will assign myself to this issue.
edoakes commentedon Jun 25, 2020
@rkooo567 yes I believe it should
rkooo567 commentedon Jul 14, 2020
This PR is merged, and now you can set
--gcs-server-port#8962. Can you verify if it works? There should be no more ports that should be opened afaikrkooo567 commentedon Jul 14, 2020
@arsedler9
rkooo567 commentedon Jul 17, 2020
I assume this should be closed by that PR. Please reopen if the issue still occurs.
arsedler9 commentedon Jul 20, 2020
Sorry for the delay @rkooo567, but I just ran my test script from earlier after adding
--gcs-server-portand it seems to work! (see below) Thanks so much. One thing I noticed is that my Ray Dashboard seems to be having issues now - when I loadlocalhost:8265I see it flash on briefly in my browser, but then it disappears. Is that a known issue? Thanks again!chanshing commentedon Aug 26, 2020
It would be really great if someone could lay down ALL the ports that are used by Ray. I'm also facing this issue and I can't just ask IT to open all ports for me. I tried to figure out what services need port and how to specify them. I noticed that
reporter.pyseems to be using a port, also some metrics port. I found these by inspecting the processess viahtop. @arsedler9 maybe this is related to your last issue? Again, would be nice if someone just provided all the ports that need to be opened 👍rkooo567 commentedon Aug 26, 2020
@mfitton for @arsedler9's issue. Sorry again I didn't see this message!
@chanshing It is actually in progress! Here is the PR. Please read it and give me some review :) #10281
mfitton commentedon Aug 26, 2020
@arsedler9 Hi, sorry for not seeing this sooner. The dashboard's nightly release had a glitch with multi-node clusters around the time you posted that could have led to the dashboard appearing blank. Could you let me know if this is still a problem that you're encountering?