Skip to content

Commit

Permalink
[solana] update metrics and refactoring (#307)
Browse files Browse the repository at this point in the history
* solana chart refactor
* add support extra servicemonitor endpoints, add extraports for metrics svc
* update versions
* update ci tools versions
  • Loading branch information
VladStarr authored Jul 2, 2024
1 parent c68a8ce commit 95801b1
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 67 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
-
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions dysnix/solana/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
68 changes: 38 additions & 30 deletions dysnix/solana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
16 changes: 6 additions & 10 deletions dysnix/solana/templates/scripts/_download-plugins.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}.."
Expand All @@ -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() {
Expand Down
3 changes: 3 additions & 0 deletions dysnix/solana/templates/service-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ spec:
targetPort: exporter
protocol: TCP
name: exporter
{{- with .extraPorts }}
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
{{- include "solana.selectorLabels" $ | nindent 4 }}
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions dysnix/solana/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
5 changes: 4 additions & 1 deletion dysnix/solana/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions dysnix/solana/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Loading

0 comments on commit 95801b1

Please sign in to comment.