ray-project / ray

Ray is an AI compute engine. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
34.19k stars 5.8k forks source link

[Cluster Launcher] `ray dashboard` CLI command does not stop port-forwarding after Ctrl+C #30385

Open architkulkarni opened 2 years ago

architkulkarni commented 2 years ago

What happened + What you expected to happen

The function of the CLI ray dashboard is to port forward to the cluster. While the command is running, it blocks the terminal indefinitely as the ports are being forwarded, as expected.

However, canceling the command with Ctrl+C doesn't seem to stop the port forwarding. I don't know any other way to cancel the command.

Versions / Dependencies

MacOS 12.6.1, Python 3.8, Ray master branch

Reproduction script

  1. Ensure AWS credentials are set up
  2. edit ray/python/ray/autoscaler/aws/example-full.yaml as follows to get it to work out of the box:
    auth:
    ssh_user: ubuntu
    # By default Ray creates a new private keypair, but you can also use your own.
    # If you do so, make sure to also set "KeyName" in the head and worker node
    # configurations below.
    ssh_private_key: ~/.ssh/MyAutoscaler.pem
    [...]
    available_node_types:
    ray.head.default:        
        node_config:
            KeyName: MyAutoscaler

Here MyAutoscaler is a key I made in the AWS console.

  1. Run ray up ray/python/ray/autoscaler/aws/example-full.yaml and hit enter or Y until the cluster is up
  2. Run ray dashboard
  3. Check that the dashboard is working in your browser at localhost:8265
  4. Ctrl+C the ray dashboard command
  5. (This is the bug) The dashboard in your browser continues to update. (And you can continue to run jobs: RAY_ADDRESS="http://localhost:8265" ray job submit -- python -c 'import ray; ray.init(); print("hi")')

Issue Severity

Medium: It is a significant difficulty but I can work around it.

scottsun94 commented 1 year ago

cc: @rkooo567 @rickyyx @alanwguo