From 4e8613497531da811bdfb0f383b5cd0d0e51c618 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2024 18:23:42 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- helm-charts/common/embedding-usvc/README.md | 11 ++++++----- .../common/embedding-usvc/templates/deployment.yaml | 2 +- .../embedding-usvc/templates/servicemonitor.yaml | 2 +- helm-charts/common/teirerank/README.md | 13 +++++++------ .../common/teirerank/templates/deployment.yaml | 2 +- .../common/teirerank/templates/servicemonitor.yaml | 2 +- helm-charts/common/tgi/README.md | 13 +++++++------ helm-charts/common/tgi/templates/deployment.yaml | 2 +- .../common/tgi/templates/servicemonitor.yaml | 2 +- 9 files changed, 26 insertions(+), 23 deletions(-) diff --git a/helm-charts/common/embedding-usvc/README.md b/helm-charts/common/embedding-usvc/README.md index 1919e35ce..ca88a18ed 100644 --- a/helm-charts/common/embedding-usvc/README.md +++ b/helm-charts/common/embedding-usvc/README.md @@ -43,16 +43,17 @@ https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-promet ### Gotchas Why HPA is opt-in: -* Enabling chart `horizontalPodAutoscaler` option will _overwrite_ cluster's current + +- Enabling chart `horizontalPodAutoscaler` option will _overwrite_ cluster's current `PrometheusAdapter` configuration with its own custom metrics configuration. Take copy of the existing one before install, if that matters: `kubectl -n monitoring get cm/adapter-config -o yaml > adapter-config.yaml` -* `PrometheusAdapter` needs to be restarted after install, for it to read the new configuration: +- `PrometheusAdapter` needs to be restarted after install, for it to read the new configuration: `ns=monitoring; kubectl -n $ns delete $(kubectl -n $ns get pod --selector app.kubernetes.io/name=prometheus-adapter -o name)` -* By default Prometheus adds [k8s RBAC rules](https://github.com/prometheus-operator/kube-prometheus/blob/main/manifests/prometheus-roleBindingSpecificNamespaces.yaml) - for accessing metrics from `default`, `kube-system` and `monitoring` namespaces. If Helm is +- By default Prometheus adds [k8s RBAC rules](https://github.com/prometheus-operator/kube-prometheus/blob/main/manifests/prometheus-roleBindingSpecificNamespaces.yaml) + for accessing metrics from `default`, `kube-system` and `monitoring` namespaces. If Helm is asked to install OPEA services to some other namespace, those rules need to be updated accordingly -* Provided HPA rules are examples for Xeon, for efficient scaling they need to be fine-tuned for given setup +- Provided HPA rules are examples for Xeon, for efficient scaling they need to be fine-tuned for given setup (underlying HW, used models, OPEA version etc) ## Verify diff --git a/helm-charts/common/embedding-usvc/templates/deployment.yaml b/helm-charts/common/embedding-usvc/templates/deployment.yaml index acde12477..c9ab9059d 100644 --- a/helm-charts/common/embedding-usvc/templates/deployment.yaml +++ b/helm-charts/common/embedding-usvc/templates/deployment.yaml @@ -83,4 +83,4 @@ spec: {{- if .Values.horizontalPodAutoscaler.enabled }} # extra time to finish processing buffered requests before HPA forcibly terminates pod terminationGracePeriodSeconds: 60 - {{- end }} \ No newline at end of file + {{- end }} diff --git a/helm-charts/common/embedding-usvc/templates/servicemonitor.yaml b/helm-charts/common/embedding-usvc/templates/servicemonitor.yaml index efadcd313..140861b0e 100644 --- a/helm-charts/common/embedding-usvc/templates/servicemonitor.yaml +++ b/helm-charts/common/embedding-usvc/templates/servicemonitor.yaml @@ -14,4 +14,4 @@ spec: - interval: 4s port: embedding-usvc scheme: http -{{- end }} \ No newline at end of file +{{- end }} diff --git a/helm-charts/common/teirerank/README.md b/helm-charts/common/teirerank/README.md index 6f42b2e5d..5609eae75 100644 --- a/helm-charts/common/teirerank/README.md +++ b/helm-charts/common/teirerank/README.md @@ -37,16 +37,17 @@ https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-promet ### Gotchas Why HPA is opt-in: -* Enabling chart `horizontalPodAutoscaler` option will _overwrite_ cluster's current + +- Enabling chart `horizontalPodAutoscaler` option will _overwrite_ cluster's current `PrometheusAdapter` configuration with its own custom metrics configuration. Take copy of the existing one before install, if that matters: `kubectl -n monitoring get cm/adapter-config -o yaml > adapter-config.yaml` -* `PrometheusAdapter` needs to be restarted after install, for it to read the new configuration: +- `PrometheusAdapter` needs to be restarted after install, for it to read the new configuration: `ns=monitoring; kubectl -n $ns delete $(kubectl -n $ns get pod --selector app.kubernetes.io/name=prometheus-adapter -o name)` -* By default Prometheus adds [k8s RBAC rules](https://github.com/prometheus-operator/kube-prometheus/blob/main/manifests/prometheus-roleBindingSpecificNamespaces.yaml) - for accessing metrics from `default`, `kube-system` and `monitoring` namespaces. If Helm is +- By default Prometheus adds [k8s RBAC rules](https://github.com/prometheus-operator/kube-prometheus/blob/main/manifests/prometheus-roleBindingSpecificNamespaces.yaml) + for accessing metrics from `default`, `kube-system` and `monitoring` namespaces. If Helm is asked to install OPEA services to some other namespace, those rules need to be updated accordingly -* Provided HPA rules are examples for Xeon, for efficient scaling they need to be fine-tuned for given setup +- Provided HPA rules are examples for Xeon, for efficient scaling they need to be fine-tuned for given setup (underlying HW, used models, OPEA version etc) ## Verify @@ -101,4 +102,4 @@ NOTE: HuggingFace TGI and TEI services provide metrics endpoint only after they' | global.modelUseHostPath | string | `"/mnt/opea-models"` | Cached models directory, teirerank will not download if the model is cached here. The host path "modelUseHostPath" will be mounted to container as /data directory. Set this to null/empty will force it to download model. | | image.repository | string | `"ghcr.io/huggingface/text-embeddings-inference"` | | | image.tag | string | `"cpu-1.5"` | | -| horizontalPodAutoscaler.enabled | bool | false | Enable HPA autoscaling for the service deployments based on metrics it provides. See #pre-conditions and #gotchas before enabling! | \ No newline at end of file +| horizontalPodAutoscaler.enabled | bool | false | Enable HPA autoscaling for the service deployments based on metrics it provides. See #pre-conditions and #gotchas before enabling! | diff --git a/helm-charts/common/teirerank/templates/deployment.yaml b/helm-charts/common/teirerank/templates/deployment.yaml index 2889fe9b0..9c7a712a4 100644 --- a/helm-charts/common/teirerank/templates/deployment.yaml +++ b/helm-charts/common/teirerank/templates/deployment.yaml @@ -108,4 +108,4 @@ spec: {{- if .Values.horizontalPodAutoscaler.enabled }} # extra time to finish processing buffered requests before HPA forcibly terminates pod terminationGracePeriodSeconds: 60 - {{- end }} \ No newline at end of file + {{- end }} diff --git a/helm-charts/common/teirerank/templates/servicemonitor.yaml b/helm-charts/common/teirerank/templates/servicemonitor.yaml index 10713e818..09af3b2c4 100644 --- a/helm-charts/common/teirerank/templates/servicemonitor.yaml +++ b/helm-charts/common/teirerank/templates/servicemonitor.yaml @@ -14,4 +14,4 @@ spec: - interval: 4s port: teirerank scheme: http -{{- end }} \ No newline at end of file +{{- end }} diff --git a/helm-charts/common/tgi/README.md b/helm-charts/common/tgi/README.md index dad8c4b8e..88b728bf4 100644 --- a/helm-charts/common/tgi/README.md +++ b/helm-charts/common/tgi/README.md @@ -40,16 +40,17 @@ https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-promet ### Gotchas Why HPA is opt-in: -* Enabling chart `horizontalPodAutoscaler` option will _overwrite_ cluster's current + +- Enabling chart `horizontalPodAutoscaler` option will _overwrite_ cluster's current `PrometheusAdapter` configuration with its own custom metrics configuration. Take copy of the existing one before install, if that matters: `kubectl -n monitoring get cm/adapter-config -o yaml > adapter-config.yaml` -* `PrometheusAdapter` needs to be restarted after install, for it to read the new configuration: +- `PrometheusAdapter` needs to be restarted after install, for it to read the new configuration: `ns=monitoring; kubectl -n $ns delete $(kubectl -n $ns get pod --selector app.kubernetes.io/name=prometheus-adapter -o name)` -* By default Prometheus adds [k8s RBAC rules](https://github.com/prometheus-operator/kube-prometheus/blob/main/manifests/prometheus-roleBindingSpecificNamespaces.yaml) - for accessing metrics from `default`, `kube-system` and `monitoring` namespaces. If Helm is +- By default Prometheus adds [k8s RBAC rules](https://github.com/prometheus-operator/kube-prometheus/blob/main/manifests/prometheus-roleBindingSpecificNamespaces.yaml) + for accessing metrics from `default`, `kube-system` and `monitoring` namespaces. If Helm is asked to install OPEA services to some other namespace, those rules need to be updated accordingly -* Provided HPA rules are examples for Xeon, for efficient scaling they need to be fine-tuned for given setup +- Provided HPA rules are examples for Xeon, for efficient scaling they need to be fine-tuned for given setup (underlying HW, used models, OPEA version etc) ## Verify @@ -105,4 +106,4 @@ NOTE: HuggingFace TGI and TEI services provide metrics endpoint only after they' | global.modelUseHostPath | string | `"/mnt/opea-models"` | Cached models directory, tgi will not download if the model is cached here. The host path "modelUseHostPath" will be mounted to container as /data directory. Set this to null/empty will force it to download model. | | image.repository | string | `"ghcr.io/huggingface/text-generation-inference"` | | | image.tag | string | `"1.4"` | | -| horizontalPodAutoscaler.enabled | bool | false | Enable HPA autoscaling for the service deployments based on metrics it provides. See #pre-conditions and #gotchas before enabling! | \ No newline at end of file +| horizontalPodAutoscaler.enabled | bool | false | Enable HPA autoscaling for the service deployments based on metrics it provides. See #pre-conditions and #gotchas before enabling! | diff --git a/helm-charts/common/tgi/templates/deployment.yaml b/helm-charts/common/tgi/templates/deployment.yaml index 742ec1a1c..a568bc575 100644 --- a/helm-charts/common/tgi/templates/deployment.yaml +++ b/helm-charts/common/tgi/templates/deployment.yaml @@ -100,4 +100,4 @@ spec: {{- if .Values.horizontalPodAutoscaler.enabled }} # extra time to finish processing buffered requests before HPA forcibly terminates pod terminationGracePeriodSeconds: 120 - {{- end }} \ No newline at end of file + {{- end }} diff --git a/helm-charts/common/tgi/templates/servicemonitor.yaml b/helm-charts/common/tgi/templates/servicemonitor.yaml index a8a373e9d..7ff5f7895 100644 --- a/helm-charts/common/tgi/templates/servicemonitor.yaml +++ b/helm-charts/common/tgi/templates/servicemonitor.yaml @@ -19,4 +19,4 @@ spec: - interval: 4s port: tgi scheme: http -{{- end }} \ No newline at end of file +{{- end }}