From 95801b12c5876bea80769fd16ef5f7970053a5be Mon Sep 17 00:00:00 2001 From: Vladyslav Deryhin Date: Tue, 2 Jul 2024 15:40:54 +0300 Subject: [PATCH] [solana] update metrics and refactoring (#307) * solana chart refactor * add support extra servicemonitor endpoints, add extraports for metrics svc * update versions * update ci tools versions --- .github/workflows/lint-test.yaml | 12 +-- .github/workflows/release.yaml | 2 +- dysnix/solana/Chart.yaml | 4 +- dysnix/solana/README.md | 68 +++++++------- .../templates/scripts/_download-plugins.tpl | 16 ++-- dysnix/solana/templates/service-metrics.yaml | 3 + dysnix/solana/templates/service.yaml | 4 +- dysnix/solana/templates/servicemonitor.yaml | 5 +- dysnix/solana/templates/statefulset.yaml | 4 +- dysnix/solana/values.yaml | 89 ++++++++++++++++--- 10 files changed, 140 insertions(+), 67 deletions(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 21d145aa..6110cf5d 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - @@ -21,14 +21,14 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Helm - uses: azure/setup-helm@v3 + uses: azure/setup-helm@v4 with: - version: v3.13.3 + version: v3.15.2 - uses: actions/setup-python@v4 with: @@ -62,9 +62,9 @@ jobs: fi - name: Create Kubernetes Cluster (kind) - uses: helm/kind-action@v1.8.0 + uses: helm/kind-action@v1.10.0 with: - node_image: kindest/node:v1.27.3 + node_image: kindest/node:v1.29.4 if: steps.charts.outputs.testing == 'true' - name: Install Charts chart-testing diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3cbc54ff..b2a95c88 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -23,7 +23,7 @@ jobs: helm repo add bitnami-archive https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.5.0 + uses: helm/chart-releaser-action@v1.6.0 with: charts_dir: dysnix/ env: diff --git a/dysnix/solana/Chart.yaml b/dysnix/solana/Chart.yaml index 2835d380..eac19a53 100644 --- a/dysnix/solana/Chart.yaml +++ b/dysnix/solana/Chart.yaml @@ -3,8 +3,8 @@ name: solana description: Solana blockchain node Helm chart type: application -version: 0.1.28 -appVersion: "v1.17.34" +version: 0.1.32 +appVersion: "v1.18.15" keywords: - solana diff --git a/dysnix/solana/README.md b/dysnix/solana/README.md index 896c2d5e..f867ea2c 100644 --- a/dysnix/solana/README.md +++ b/dysnix/solana/README.md @@ -36,17 +36,18 @@ A Helm chart to deploy Solana node inside Kubernetes cluster. ### Services configuration -| Name | Description | Value | -| ------------------------------------------- | ------------------------------------------ | ----------- | -| `services.rpc.enabled` | Enable Solana RPC service | `true` | -| `services.rpc.type` | Solana RPC service type | `ClusterIP` | -| `services.rpc.port` | Solana RPC service port (+1 for websocket) | `8899` | -| `services.rpc.extraPorts` | Solana RPC service extra ports to expose | `[]` | -| `services.rpc.publishNotReadyAddresses` | Route trafic even when pod is not ready | `false` | -| `services.metrics.enabled` | Enable Solana metrics service | `false` | -| `services.metrics.type` | Solana metrics service type | `ClusterIP` | -| `services.metrics.port` | Solana metrics service port | `9122` | -| `services.metrics.publishNotReadyAddresses` | Route trafic even when pod is not ready | `true` | +| Name | Description | Value | +| ------------------------------------------- | -------------------------------------------- | ----------- | +| `services.rpc.enabled` | Enable Solana RPC service | `true` | +| `services.rpc.type` | Solana RPC service type | `ClusterIP` | +| `services.rpc.port` | Solana RPC service port (+1 for websocket) | `8899` | +| `services.rpc.extraPorts` | Solana RPC service extra ports to expose | `[]` | +| `services.rpc.publishNotReadyAddresses` | Route trafic even when pod is not ready | `false` | +| `services.metrics.enabled` | Enable Solana metrics service | `false` | +| `services.metrics.type` | Solana metrics service type | `ClusterIP` | +| `services.metrics.port` | Solana metrics service port | `9122` | +| `services.metrics.extraPorts` | Solana metrics service extra ports to expose | `[]` | +| `services.metrics.publishNotReadyAddresses` | Route trafic even when pod is not ready | `true` | ### Ingress configuration @@ -68,25 +69,32 @@ A Helm chart to deploy Solana node inside Kubernetes cluster. ### Solana node configuration -| Name | Description | Value | -| -------------------------------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------- | -| `solanaArgs` | `solana-validator` arguments | `{}` | -| `gracefulShutdown.timeout` | Seconds to wait for graceful shutdown | `120` | -| `gracefulShutdown.options` | `solana-validator exit` arguments | `{}` | -| `gracefulShutdown.options.force` | Do not wait for restart-window, useful for non-validators | `false` | -| `gracefulShutdown.options.skip-health-check` | Skip health check before exit | `false` | -| `gracefulShutdown.options.skip-health-check` | Skip check for a new snapshot before exit | `false` | -| `rustLog` | Logging configuration | `solana=info,solana_metrics=warn` | -| `plugins.enabled` | Enable download of Geyser plugins | `false` | -| `plugins.yellowstoneGRPC.enabled` | Enable download of Yellowstone gRPC | `false` | -| `plugins.yellowstoneGRPC.version` | Yellowstone gRPC version | `v1.14.2+solana.1.17.33` | -| `plugins.yellowstoneGRPC.baseUrl` | URL from where the plugin is downloaded | `https://github.com/rpcpool/yellowstone-grpc/releases/download/` | -| `plugins.yellowstoneGRPC.listenIP` | Yellowstone gRPC listen IP address, without port | `$(MY_POD_IP)` | -| `plugins.yellowstoneGRPC.config` | Yellowstone gRPC config.json file | `look in values.yaml` | -| `identity.validatorKeypair` | Validator keypair string (required) | `""` | -| `identity.voteKeypair` | Vote keypair string (required only for validator) | `""` | -| `identity.existingSecret` | Use existing secret with keypairs instead of specifying them above | `""` | -| `identity.mountPath` | Keypair files mount path | `/secrets` | +| Name | Description | Value | +| -------------------------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `solanaArgs` | `solana-validator` arguments | `{}` | +| `gracefulShutdown.timeout` | Seconds to wait for graceful shutdown | `120` | +| `gracefulShutdown.options` | `solana-validator exit` arguments | `{}` | +| `gracefulShutdown.options.force` | Do not wait for restart-window, useful for non-validators | `false` | +| `gracefulShutdown.options.skip-health-check` | Skip health check before exit | `false` | +| `gracefulShutdown.options.skip-health-check` | Skip check for a new snapshot before exit | `false` | +| `rustLog` | Logging configuration | `solana=info,solana_metrics=warn` | +| `plugins.enabled` | Enable download of Geyser plugins | `false` | +| `plugins.containerPorts` | Extra container ports for added plugins | `[]` | +| `plugins.servicePorts` | Extra service ports for added plugins | `[]` | +| `plugins.yellowstoneGRPC.enabled` | Enable download of Yellowstone gRPC | `false` | +| `plugins.yellowstoneGRPC.version` | Yellowstone gRPC version | `v1.15.0+solana.1.17.33` | +| `plugins.yellowstoneGRPC.downloadURL` | From where the plugin needs to be downloaded | `https://github.com/rpcpool/yellowstone-grpc/releases/download/` | +| `plugins.yellowstoneGRPC.listenIP` | Yellowstone gRPC listen IP address, without port | `$(MY_POD_IP)` | +| `plugins.yellowstoneGRPC.config` | Yellowstone gRPC config.json file | `look in values.yaml` | +| `plugins.jitoGRPC.enabled` | Enable download of Jito gRPC | `false` | +| `plugins.jitoGRPC.version` | Jito gRPC version | `v1.17.20` | +| `plugins.jitoGRPC.downloadURL` | From where the plugin needs to be downloaded | `https://github.com/jito-foundation/geyser-grpc-plugin/releases/download/v1.17.20/libgeyser_grpc_plugin_server.so` | +| `plugins.jitoGRPC.listenIP` | Jito gRPC listen IP address, without port | `$(MY_POD_IP)` | +| `plugins.jitoGRPC.config` | Jito gRPC config.json file | `look in values.yaml` | +| `identity.validatorKeypair` | Validator keypair string (required) | `""` | +| `identity.voteKeypair` | Vote keypair string (required only for validator) | `""` | +| `identity.existingSecret` | Use existing secret with keypairs instead of specifying them above | `""` | +| `identity.mountPath` | Keypair files mount path | `/secrets` | ### Solana ledger db persistence config diff --git a/dysnix/solana/templates/scripts/_download-plugins.tpl b/dysnix/solana/templates/scripts/_download-plugins.tpl index e8330103..77f65fa4 100644 --- a/dysnix/solana/templates/scripts/_download-plugins.tpl +++ b/dysnix/solana/templates/scripts/_download-plugins.tpl @@ -4,7 +4,7 @@ set -e YELLOWSTONE_GRPC__PLUGIN_DIR="$PLUGINS_DIR/yellowstone-grpc" -JITO_GRPC_DIR="$PLUGINS_DIR/jito-grpc" +JITO_GRPC__PLUGIN_DIR="$PLUGINS_DIR/jito-grpc" yellowstone_grpc_bootstrap() { echo "Yellowstone gRPC: Downloading plugin version ${YELLOWSTONE_GRPC__VERSION}.." @@ -27,19 +27,15 @@ yellowstone_grpc_bootstrap() { } jito_grpc_bootstrap() { -{{- if .Values.plugins.jitoGRPC.enabled }} -{{- with .Values.plugins.jitoGRPC }} - mkdir -p "$JITO_GRPC_DIR" + mkdir -p "$JITO_GRPC__PLUGIN_DIR" - echo "Jito gRPC: Copying config file to ${YELLOWSTONE_GRPC__PLUGIN_DIR}.." - cp -L "$JITO_GRPC__CONFIG_PATH" "$JITO_GRPC_DIR/config.json" + echo "Jito gRPC: Copying config file to ${JITO_GRPC__PLUGIN_DIR}.." + cp -L "$JITO_GRPC__CONFIG_PATH" "$JITO_GRPC__PLUGIN_DIR/config.json" - echo "Jito gRPC: Changing listen IP address in config file to ${YELLOWSTONE_GRPC__LISTEN_IP}.." - sed -i "s/LISTEN_IP/${JITO_GRPC__LISTEN_IP}/g" "$JITO_GRPC_DIR/config.json" + echo "Jito gRPC: Changing listen IP address in config file to ${JITO_GRPC__LISTEN_IP}.." + sed -i "s/LISTEN_IP/${JITO_GRPC__LISTEN_IP}/g" "$JITO_GRPC__PLUGIN_DIR/config.json" echo "Jito gRPC: Bootstrap done!" -{{- end }} -{{- end }} } main() { diff --git a/dysnix/solana/templates/service-metrics.yaml b/dysnix/solana/templates/service-metrics.yaml index c2972c34..3d7a4dba 100644 --- a/dysnix/solana/templates/service-metrics.yaml +++ b/dysnix/solana/templates/service-metrics.yaml @@ -30,6 +30,9 @@ spec: targetPort: exporter protocol: TCP name: exporter + {{- with .extraPorts }} + {{- toYaml . | nindent 4 }} + {{- end }} selector: {{- include "solana.selectorLabels" $ | nindent 4 }} {{- end }} diff --git a/dysnix/solana/templates/service.yaml b/dysnix/solana/templates/service.yaml index fa82de90..bd1c2ff0 100644 --- a/dysnix/solana/templates/service.yaml +++ b/dysnix/solana/templates/service.yaml @@ -35,8 +35,8 @@ spec: protocol: TCP name: ws {{- if $.Values.plugins.enabled }} - {{- if or $.Values.plugins.yellowstoneGRPC.enabled $.Values.plugins.jitoGRPC.enabled }} - {{- toYaml $.Values.plugins.grpc.service_ports | nindent 4 }} + {{- with $.Values.plugins.servicePorts }} + {{- toYaml . | nindent 4 }} {{- end }} {{- end }} {{- with .extraPorts }} diff --git a/dysnix/solana/templates/servicemonitor.yaml b/dysnix/solana/templates/servicemonitor.yaml index b5131726..044dcb3e 100644 --- a/dysnix/solana/templates/servicemonitor.yaml +++ b/dysnix/solana/templates/servicemonitor.yaml @@ -14,9 +14,12 @@ spec: endpoints: - port: exporter path: /metrics - {{- with (omit .Values.metrics.serviceMonitor "enabled") }} + {{- with (omit .Values.metrics.serviceMonitor "enabled" "extraEndpoints") }} {{- toYaml . | nindent 6 }} {{- end }} + {{- with .Values.metrics.serviceMonitor.extraEndpoints }} + {{- toYaml . | nindent 4 }} + {{- end }} namespaceSelector: matchNames: - {{ .Release.Namespace | quote }} diff --git a/dysnix/solana/templates/statefulset.yaml b/dysnix/solana/templates/statefulset.yaml index af9afb23..dc65c055 100644 --- a/dysnix/solana/templates/statefulset.yaml +++ b/dysnix/solana/templates/statefulset.yaml @@ -139,8 +139,8 @@ spec: containerPort: {{ get .Values.solanaArgs "rpc-port" | add 1 }} protocol: TCP {{- if .Values.plugins.enabled }} - {{- if or .Values.plugins.yellowstoneGRPC.enabled .Values.plugins.jitoGRPC.enabled }} - {{- toYaml .Values.plugins.grpc.ports | nindent 12 }} + {{- with .Values.plugins.containerPorts }} + {{- toYaml . | nindent 12 }} {{- end }} {{- end }} {{- with .Values.extraContainerPorts }} diff --git a/dysnix/solana/values.yaml b/dysnix/solana/values.yaml index 50c80872..4df84951 100644 --- a/dysnix/solana/values.yaml +++ b/dysnix/solana/values.yaml @@ -190,6 +190,14 @@ services: ## @param services.metrics.port Solana metrics service port ## port: 9122 + ## @param services.metrics.extraPorts Solana metrics service extra ports to expose + ## Example: + ## - name: grpc-prom + ## protocol: TCP + ## port: 8999 + ## targetPort: grpc-prom + ## + extraPorts: [] ## @param services.metrics.publishNotReadyAddresses Route trafic even when pod is not ready ## publishNotReadyAddresses: true @@ -262,6 +270,11 @@ metrics: # honorLabels: true # relabelings: [] # metricRelabelings: [] + # extraEndpoints: + # - port: exporter + # path: /metrics + # interval: 10s + # scrapeTimeout: 2s influxdb: existingSecret: ## @param metrics.influxdb.existingSecret.name Name of secret containing InfluxDB credentials @@ -340,24 +353,30 @@ plugins: ## @param plugins.enabled Enable download of Geyser plugins ## enabled: false - grpc: - ports: - - name: grpc - containerPort: 10000 - protocol: TCP - service_ports: - - name: grpc - protocol: TCP - port: 10000 - targetPort: grpc - + ## @param plugins.containerPorts [array] Extra container ports for added plugins + ## Example: + ## - name: grpc + ## containerPort: 10000 + ## protocol: TCP + ## + containerPorts: [] + ## @param plugins.servicePorts [array] Extra service ports for added plugins + ## Example: + ## - name: grpc + ## protocol: TCP + ## port: 10000 + ## targetPort: grpc + ## + servicePorts: [] + ## Yellowstone gRPC plugin config + ## yellowstoneGRPC: ## @param plugins.yellowstoneGRPC.enabled Enable download of Yellowstone gRPC ## enabled: false ## @param plugins.yellowstoneGRPC.version Yellowstone gRPC version ## - version: v1.14.2+solana.1.17.33 + version: v1.15.0+solana.1.18.15 ## @param plugins.yellowstoneGRPC.downloadURL From where the plugin needs to be downloaded ## downloadURL: https://github.com/rpcpool/yellowstone-grpc/releases/download/ @@ -383,6 +402,48 @@ plugins: "unary_concurrency_limit": 100, "unary_disabled": false, "filters": { + "accounts": { + "max": 1, + "any": false, + "account_max": 10, + "account_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], + "owner_max": 10, + "owner_reject": ["11111111111111111111111111111111"] + }, + "slots": { + "max": 1 + }, + "transactions": { + "max": 1, + "any": false, + "account_include_max": 10, + "account_include_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], + "account_exclude_max": 10, + "account_required_max": 10 + }, + "transactions_status": { + "max": 1, + "any": false, + "account_include_max": 10, + "account_include_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], + "account_exclude_max": 10, + "account_required_max": 10 + }, + "blocks": { + "max": 1, + "account_include_max": 10, + "account_include_any": false, + "account_include_reject": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"], + "include_transactions": true, + "include_accounts" : false, + "include_entries" : false + }, + "blocks_meta": { + "max": 1 + }, + "entry": { + "max": 1 + } } }, "prometheus": { @@ -390,6 +451,8 @@ plugins: }, "block_fail_action": "log" } + ## Jito gRPC plugin config + ## jitoGRPC: ## @param plugins.jitoGRPC.enabled Enable download of Jito gRPC ## @@ -410,7 +473,7 @@ plugins: config: |- { "libpath": "/lib/libgeyser_grpc_plugin_server.so", - "bind_address": "0.0.0.0:10000", + "bind_address": "LISTEN_IP:10000", "account_update_buffer_size": 100000, "slot_update_buffer_size": 100000, "block_update_buffer_size": 100000,