From 4701f7e13c47605351b36f4c51d3901e4d62b738 Mon Sep 17 00:00:00 2001 From: austbot Date: Tue, 18 Jun 2024 15:35:52 -0500 Subject: [PATCH] set new helm directive --- Dockerfile | 2 +- README.md | 2 +- charts/bonsol-node/templates/configmap.yaml | 19 +++++++++---------- charts/bonsol-node/templates/deployment.yaml | 4 ++-- charts/bonsol-node/values.yaml | 2 +- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5a7091e..429669f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,7 +50,7 @@ RUN if [ "$FLAVOR" = "cuda" ]; then \ apt-get -y install cuda-toolkit-12-5; \ fi WORKDIR /usr/opt/bonsol -ENTRYPOINT ["relay"] +CMD ["relay"] diff --git a/README.md b/README.md index 5686e63..7ea78cd 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ Fund that keypair with sol, and keep it secret, currently we only support the lo # Deploying the Helm Chart A helm chart exists for this project. You can deploy it to a kubernetes cluster. You will need to have a kubernetes cluster and helm installed. ```bash -helm install --set signer_config.local_signer_keypair_path=$(cat ./relaykp.json) bonsol ./charts/bonsol-node -f ./charts/bonsol-node/secret-values.yaml +helm install --set-file signer_config.local_signer_keypair_content=relaykp.json bonsol ./charts/bonsol-node -f ./charts/bonsol-node/secret-values.yaml ``` Ensure you set ```local_signer_keypair_content``` with the content of the relay kp. An example values file is in the helm directory at ```example-values.yaml```. diff --git a/charts/bonsol-node/templates/configmap.yaml b/charts/bonsol-node/templates/configmap.yaml index f10d5a3..7c153bb 100644 --- a/charts/bonsol-node/templates/configmap.yaml +++ b/charts/bonsol-node/templates/configmap.yaml @@ -5,30 +5,29 @@ metadata: labels: {{- include "bonsol-node.labels" . | nindent 4 }} data: - Node.toml: << | - risc0_image_folder = {{ .Values.risc0_image_folder }} - risc0_image_folder = "../elf" + Node.toml: | + risc0_image_folder = {{ .Values.risc0_image_folder | quote }} max_input_size_mb = {{ .Values.max_input_size_mb }} image_download_timeout_secs = {{ .Values.image_download_timeout_secs }} input_download_timeout_secs = {{ .Values.input_download_timeout_secs }} maximum_concurrent_proofs = {{ .Values.maximum_concurrent_proofs }} max_image_size_mb = {{ .Values.max_image_size_mb }} image_compression_ttl_hours = {{ .Values.image_compression_ttl_hours }} - env = {{ .Values.bonsol_env }} + env = {{ .Values.bonsol_env | quote }} [transaction_sender_config] {{- if eq .Values.transaction_sending_config.type "Rpc" }} - Rpc = { rpc_url = "{{ .Values.transaction_sending_config.rpc_url }}" } + Rpc = { rpc_url = {{ .Values.transaction_sending_config.rpc_url | quote }} } {{- end }} [signer_config] - {{- if eq .Values.signer_config.type "KeyPairFile" }} - KeyPairFile = { path = "{{ .Values.signer_config.path }}" } + {{- if eq .Values.signer_config.type "KeypairFile" }} + KeypairFile = { path = {{ .Values.signer_config.path | quote }} } {{- end }} [ingester_config] {{- if eq .Values.ingester_config.type "RpcBlockSubscription" }} - RpcBlockSubscription = { wss_rpc_url = "{{ .Values.ingester_config.wss_rpc_url }}" } + RpcBlockSubscription = { wss_rpc_url = {{ .Values.ingester_config.wss_rpc_url | quote }} } {{- end }} - {{- if eq .Values.ingester_config.type "GrpcSub" }} - GrpcSubscription = { grpc_url = "{{ .Values.ingester_config.grpc_url }}" } + {{- if eq .Values.ingester_config.type "GrpcSubscription" }} + GrpcSubscription = { grpc_url = {{ .Values.ingester_config.grpc_url | quote }}, token = {{ .Values.ingester_config.token | quote }}, connection_timeout_secs = {{ .Values.ingester_config.connection_timeout_secs }}, timeout_secs = {{ .Values.ingester_config.timeout_secs }} } {{- end }} \ No newline at end of file diff --git a/charts/bonsol-node/templates/deployment.yaml b/charts/bonsol-node/templates/deployment.yaml index e464ad0..530a820 100644 --- a/charts/bonsol-node/templates/deployment.yaml +++ b/charts/bonsol-node/templates/deployment.yaml @@ -36,7 +36,7 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - command: ["/usr/opt/bonsol", "-f /opt/bonsol/Node.toml"] + command: ["/usr/opt/bonsol/relay","-f", "/opt/bonsol/Node.toml"] ports: - name: http containerPort: {{ .Values.service.port }} @@ -54,7 +54,7 @@ spec: - name: images mountPath: {{ .Values.risc0_image_folder }} - name: config - mountPath: /opt/bonsol/ + mountPath: /opt/bonsol/Node.toml {{- with .Values.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/bonsol-node/values.yaml b/charts/bonsol-node/values.yaml index 8af2e32..484ccb3 100644 --- a/charts/bonsol-node/values.yaml +++ b/charts/bonsol-node/values.yaml @@ -16,7 +16,7 @@ input_download_timeout_secs: 60 maximum_concurrent_proofs: 1 max_image_size_mb: 4 image_compression_ttl_hours: 24 -env: "dev" +bonsol_env: "dev" transaction_sending_config: type: "Rpc" rpc_url: "http://localhost:8899"