[Doc] Add kuberay autoscaler command overwrite#63627
Conversation
Signed-off-by: fscnick <fscnick.dev@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a new user guide for specifying custom container commands and arguments for the KubeRay autoscaler using autoscalerOptions. The documentation explains how to override the default start command and utilize the KUBERAY_GEN_AUTOSCALER_START_CMD environment variable. Review feedback suggests improving the documentation's structure by removing unnecessary section numbering and enhancing the provided kubectl examples to be more robust when multiple clusters are present by using specific labels and jsonpath for pod name retrieval.
| Sometimes, you may want to execute certain commands either before or instead of the generated autoscaler start command. | ||
| This document shows you how to do that using the `command` and `args` fields in `autoscalerOptions`. | ||
|
|
||
| ## Part 1: Specify a custom autoscaler command |
There was a problem hiding this comment.
The heading "Part 1" implies that there are subsequent parts in this document. Since this guide currently only covers one main topic, it is better to use a more descriptive heading without the part number to avoid confusion.
| ## Part 1: Specify a custom autoscaler command | |
| ## Specify a custom autoscaler command |
| kubectl get pod -l ray.io/node-type=head | ||
|
|
||
| # Check the autoscaler container's command and args inside the head Pod. | ||
| export RAYCLUSTER_HEAD_POD=$(kubectl get pods --selector=ray.io/node-type=head -o custom-columns=POD:metadata.name --no-headers) |
There was a problem hiding this comment.
The kubectl command used to retrieve the pod name can be made more robust. By adding the ray.io/cluster-name label to the selector, you ensure that the command correctly identifies the pod even if multiple RayClusters are running in the same namespace. Additionally, using jsonpath to select the first item is more reliable for variable assignment than custom-columns.
| export RAYCLUSTER_HEAD_POD=$(kubectl get pods --selector=ray.io/node-type=head -o custom-columns=POD:metadata.name --no-headers) | |
| export RAYCLUSTER_HEAD_POD=$(kubectl get pods --selector=ray.io/cluster-name=raycluster-autoscaler-overwrite-cmd,ray.io/node-type=head -o jsonpath='{.items[0].metadata.name}') |
Signed-off-by: fscnick <fscnick.dev@gmail.com>
Signed-off-by: fscnick <fscnick.dev@gmail.com>
|
|
||
| # The autoscaler container's args will look like: | ||
| # Command: ["/bin/bash","-lc","--"] | ||
| # Args: ["echo 'Starting autoscaler...'; $KUBERAY_GEN_AUTOSCALER_START_CMD"] |
There was a problem hiding this comment.
Can we merge this doc into kuberay-autoscaling?
There was a problem hiding this comment.
move to configuring-autoscaling.md. 40fc784
Signed-off-by: fscnick <fscnick.dev@gmail.com>
This reverts commit 5c565eb. Signed-off-by: fscnick <fscnick.dev@gmail.com>
Signed-off-by: fscnick <fscnick.dev@gmail.com>
| These fields override the autoscaler container's entrypoint and arguments. | ||
| When either field is set, KubeRay uses those values directly instead of generating the autoscaler start command. |
There was a problem hiding this comment.
| These fields override the autoscaler container's entrypoint and arguments. | |
| When either field is set, KubeRay uses those values directly instead of generating the autoscaler start command. | |
| These fields independently override the autoscaler container's `command` and `args`. |
Nit: instead of generating the autoscaler start command is a little bit misleading. KubeRay always generates it and injects it as the KUBERAY_GEN_AUTOSCALER_START_CMD env var.
Signed-off-by: fscnick <fscnick.dev@gmail.com>
…er-container-command-overwrite-doc Signed-off-by: fscnick <fscnick.dev@gmail.com>
Description
In ray-project/kuberay#4835, the autoscaler command overwrite is added. This document describes how to use this feature.
Related issues
Related to ray-project/kuberay#4835
Additional information