question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[autoscaler] [kubernetes] Calling ray down does not remove Kubernetes services

See original GitHub issue

When creating a cluster on Kubernetes, Ray will allocate a service routing traffic to the head node when the user adds this to their cluster config:

services:
      - apiVersion: v1
        kind: Service
        metadata:
            name: local-cluster-ray-head
        spec:
            selector:
                component: local-cluster-ray-head
            ports:
                - name: client
                  protocol: TCP
                  port: 10001
                  targetPort: 10001
                - name: dashboard
                  protocol: TCP
                  port: 8265
                  targetPort: 8265

However, when calling ray down cluster.yaml, this service (unlike the pods) will not be removed. The expected behavior is that all resources created by ray up should be properly cleaned up after calling ray down.

cc @richardliaw

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
edoakescommented, Mar 16, 2021

@tgaddair yep, makes sense, a lot of users follow a similar workflow. Our intention is for this workflow to be done via the Ray client like:

ray.util.connect("k8s_service_address", working_dir="/local/path", py_modules=["/path/to/local/module"])

The files in working_dir would be available on every node in the working_dir of the tasks/actors and py_modules would be injected into the sys.path.

1reaction
tgaddaircommented, Mar 16, 2021

Nice! All of that sounds good. For my use case, I want to be able to make changes to my local Python code that are then reflected on both the head node and the workers. Right now I do this through the YAML when using ray up:

file_mounts:
    /home/ray/src: python

Here python is a directory containing my local Python files.

In general, I think being able to launch a Ray cluster using the operator, then interact with it via the ray CLI, including syncing local files, would be an ideal user experience for my workflow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autoscaler does not seem to watch head node - Ray.io
Currently, Ray down does not delete the service and Ray up creates the service if it's not already present. There's an issue open...
Read more >
Use the cluster autoscaler in Azure Kubernetes Service (AKS)
The cluster autoscaler decreases the number of nodes when there has been unused capacity for a period of time. Pods on a node...
Read more >
Deleting an Amazon EKS cluster - AWS Documentation
Learn how to delete an Amazon EKS cluster. ... You can delete a cluster with eksctl , the AWS Management Console, ... kubectl...
Read more >
Scaling Applications on Kubernetes with Ray | by Vishnu Deva
This pattern will let you eliminate the chances of a K8s cluster-wide Ray failure and more evenly distribute the load of autoscaling dozens...
Read more >
Deploying Ray on a local kubernetes cluster | Telesens
I will not describe Kubernetes concepts in any great detail below. ... the scale-down time for the kubernetes Horizontal Pod Autoscaler ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found