{"id":21601391,"url":"https://github.com/dominodatalab/rayclusterscaler","last_synced_at":"2025-08-01T08:34:17.880Z","repository":{"id":208363370,"uuid":"721375745","full_name":"dominodatalab/rayclusterscaler","owner":"dominodatalab","description":"Basic Ray Cluster Scaler (Beta)","archived":false,"fork":false,"pushed_at":"2023-11-21T14:36:55.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-26T20:04:53.707Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dominodatalab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-20T23:47:51.000Z","updated_at":"2023-11-21T13:43:36.000Z","dependencies_parsed_at":"2023-11-21T05:40:09.371Z","dependency_job_id":"884ee6dc-6fad-4221-8cdd-569c806ac169","html_url":"https://github.com/dominodatalab/rayclusterscaler","commit_stats":null,"previous_names":["dominodatalab/rayclusterscaler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dominodatalab/rayclusterscaler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominodatalab%2Frayclusterscaler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominodatalab%2Frayclusterscaler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominodatalab%2Frayclusterscaler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominodatalab%2Frayclusterscaler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dominodatalab","download_url":"https://codeload.github.com/dominodatalab/rayclusterscaler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dominodatalab%2Frayclusterscaler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268192592,"owners_count":24210541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T19:09:22.990Z","updated_at":"2025-08-01T08:34:17.852Z","avatar_url":"https://github.com/dominodatalab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ray Cluster Custom Scaler (Beta)\nThis is a basic Ray Cluster Scaler\n\n\n\n## Installation\n\nIf `domino-field` namespace is not present create using below command\n\n```shell\nkubectl create namespace domino-field\nkubectl label namespace domino-field  domino-compute=true\nkubectl label namespace domino-field  domino-platform=true\n```\n\n```shell\nexport field_namespace=domino-field\nhelm install -f ./values.yaml rayclusterscaler helm/rayclusterscaler -n ${field_namespace}\n```\n## Upgrade\n\n```shell\nexport field_namespace=domino-field\n\nhelm upgrade -f ./values.yaml rayclusterscaler helm/rayclusterscaler -n ${field_namespace}\n```\n\n## Delete \n\n```shell\nexport field_namespace=domino-field\nhelm delete  rayclusterscaler -n ${field_namespace}\n```\n\n## Endpoints\n\nThis service `http://rayclusterscaler-svc.domino-field/` provides the following endpoints\n\n1. GET `/raycluster/list` - To list all ray clusters which are either owned by the caller or all clusters if an Admin invokes the endpoint\n2. GET `/raycluster/\u003cname\u003e` - Get the ray cluster owned by the caller (or any for an admin). Returns `403-Unauthorized` if\nthe caller tries to retrieve a Ray cluster now permitted to fetch\n3. POST `/raycluster/scale` - This scale scales the Ray Cluster. It takes the payload\n   ```json\n    {\n        \"cluster_name\":\"ray-....\",\n        \"replicas\" : 5\n    }\n   ```\n\nEach of these endpoints can be authenticated from inside the workspace by passing a header as follows:\n\n```shell\nimport requests\nimport os\naccess_token_endpoint='http://localhost:8899/access-token'\nresp = requests.get(access_token_endpoint)\n\n\ntoken = resp.text\nheaders = {\n             \"Content-Type\": \"application/json\",\n             \"Authorization\": \"Bearer \" + token,\n        }\n#Example\nendpoint='http://rayclusterscaler-svc.domino-field/rayclusterscaler/list'\nresp = requests.get(endpoint,headers=headers)\n```\n\nAlternatively you can also pass the `DOMINO_API_KEY`\n\n```shell\nimport requests\nimport os\naccess_token_endpoint='http://localhost:8899/access-token'\nresp = requests.get(access_token_endpoint)\ndomino_api_key = os.environ['DOMINO_USER_API_KEY']\n\ntoken = resp.text\nheaders = {\n             \"Content-Type\": \"application/json\",\n             \"X-Domino-Api-Key\": domino_api_key,\n        }\n#Example\nendpoint='http://rayclusterscaler-svc.domino-field/rayclusterscaler/list'\nresp = requests.get(endpoint,headers=headers)\n```\n\n\n## Note on the scale endpoint\n\nWhen you call the scale endpoint follow up with the GET `/raycluster/\u003cname\u003e` endpoint to verify that the cluster has \nscaled. This information is obtained by the checking the `status` section of the returned `json` which should appear\nsomething like this\n\n```json\n\"status\": {\n        \"clusterStatus\": \"Running\",\n        \"nodes\": [\n          \"ray-655cb2de368ad4624b1e7d7b-ray-head-0\",\n          \"ray-655cb2de368ad4624b1e7d7b-ray-worker-0\",\n          \"ray-655cb2de368ad4624b1e7d7b-ray-worker-1\",\n          \"ray-655cb2de368ad4624b1e7d7b-ray-worker-2\",\n          \"ray-655cb2de368ad4624b1e7d7b-ray-worker-3\",\n          \"ray-655cb2de368ad4624b1e7d7b-ray-worker-4\"\n        ],\n        \"startTime\": \"2023-11-21T13:38:58Z\",\n        \"workerReplicas\": 5,\n        \"workerSelector\": \"app.kubernetes.io/component=worker,app.kubernetes.io/instance=ray-655cb2de368ad4624b1e7d7b,app.kubernetes.io/name=ray\"\n      }\n```\n\nAdditionally verify that the `spec.autoscaling` section reflects the scale correctly. For a scaling number of `5` the\nvalues for the `minReplicas` and `maxReplicas` should be as below\n\n```json\n\"autoscaling\": {\n          \"maxReplicas\": 6,\n          \"minReplicas\": 5\n        }\n```\n\nLastly, the `spec.worker.replicas` attribute in the above example should be equal to the value for `minReplicas` (`5` in our example)\n\n\u003e Also make sure you review the Ray Cluster UI to verify that every worker has joined the cluster before launching the\n\u003e job. The `RayCluster` CRD will indicate running pods. Only the Ray Cluster UI (or API) will confirm that the workers\n\u003e have joined the cluster\n\n\n***WARNING/ALERT***\n\nRemember to scale down the ray cluster when you have finished. Note that the value for\n`minReplicas` does not permit the cluster to scale down on its own.\n\nRemember to call the  POST endpoint `/raycluster/scale` with the following payload \n   ```json\n    {\n        \"cluster_name\":\"ray-....\",\n        \"replicas\" : 1\n    }\n   ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominodatalab%2Frayclusterscaler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdominodatalab%2Frayclusterscaler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdominodatalab%2Frayclusterscaler/lists"}