Skip to content

Commit

Permalink
feat: helm chart version 1.0.0 - gpu support, tester using bonsol-cli (
Browse files Browse the repository at this point in the history
…#38)

Co-authored-by: austbot <[email protected]>
  • Loading branch information
polasekr and austbot authored Oct 16, 2024
1 parent 8949806 commit 900ea9f
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 5 deletions.
4 changes: 2 additions & 2 deletions charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: bonsol-node
description: A Solana Verifiable compute coprocessor node
type: application
version: 0.1.0
appVersion: "0.1.0"
version: 1.0.0
appVersion: "1.0.0"
30 changes: 30 additions & 0 deletions charts/input_files/simple_execution_request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"imageId": "68f4b0c5f9ce034aa60ceb264a18d6c410a3af68fafd931bcfd9ebe7c1e42960",
"executionConfig": {
"verifyInputHash": false,
"forwardOutput": true
},
"inputs": [
{
"inputType": "PublicData",
"data": "{\"attestation\":\"test\"}"
},
{
"inputType": "Private",
"data": "https://echoserver.dev/server?response=N4IgFgpghgJhBOBnEAuA2mkBjA9gOwBcJCBaAgTwAcIQAaEIgDwIHpKAbKASzxAF0+9AEY4Y5VKArVUDCMzogYUAlBlFEBEAF96G5QFdkKAEwAGU1qA"
}
],
"tip": 12000,
"expiry": 100,
"callbackConfig": {
"programId": "exay1T7QqsJPNcwzMiWubR6vZnqrgM16jZRraHgqBGG",
"instructionPrefix": [1],
"extraAccounts": [
{
"pubkey": "exay1T7QqsJPNcwzMiWubR6vZnqrgM16jZRraHgqBGG",
"isSigner": false,
"isWritable": false
}
]
}
}
11 changes: 11 additions & 0 deletions charts/input_files/simple_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "simple2",
"binaryPath": "/images/simple2",
"imageId": "68f4b0c5f9ce034aa60ceb264a18d6c410a3af68fafd931bcfd9ebe7c1e42960",
"inputOrder": [
"Public",
"Private"
],
"signature": "4RBscJtuw32qGuCuTVEY6wF7nuTu3NFxS4phDrTBGqtZ5feY41ogNKKEptj3R5jNyVyj4UUCEJ5RoyyfXKjZxDTc",
"size": 266612
}
15 changes: 15 additions & 0 deletions charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,18 @@ Selector labels
app.kubernetes.io/name: {{ include "bonsol-tester.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Path to deployment manifest
*/}}
{{- define "bonsol-tester.manifestPath" -}}
/input_files/simple_manifest.json
{{- end }}

{{/*
Path to execution request
*/}}
{{- define "bonsol-tester.executionReqPath" -}}
/input_files/simple_execution_request.json
{{- end }}

16 changes: 16 additions & 0 deletions charts/templates/configmap_tester.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.tester.enabled }}
{{ $root := . }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "bonsol-tester.fullname" . }}
labels:
{{- include "bonsol-tester.labels" . | nindent 4 }}
data:
{{- range $f := splitList "," (printf "%s,%s" (include "bonsol-tester.manifestPath" .) (include "bonsol-tester.executionReqPath" . )) }}
{{ base $f }} : |-
{{- tpl ($root.Files.Get (printf "input_files/%s" (base $f) ) ) $root | nindent 4 }}
{{- end }}
{{- end }}

15 changes: 14 additions & 1 deletion charts/templates/deployment-tester.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ spec:
value: {{ .Values.signer.path }}
- name: RPC_ENDPOINT
value: "{{ .Values.rpc.url }}/{{ .Values.rpc.token }}"
- name: SIMPLE_IMAGE
value: "https://bonsol-public-images.s3.amazonaws.com/simple-68f4b0c5f9ce034aa60ceb264a18d6c410a3af68fafd931bcfd9ebe7c1e42960"
{{- if and (hasKey .Values.tester "env") (.Values.tester.env) }}
{{- range $k,$v := .Values.tester.env }}
- name: {{ $k }}
Expand All @@ -56,9 +58,11 @@ spec:
- bash
- -c
- |
solana config set --keypair {{ .Values.signer.path }} -u $RPC_ENDPOINT
bonsol deploy -y -m {{ include "bonsol-tester.manifestPath" . }} -t url --url $SIMPLE_IMAGE
while :
do
/root/.local/share/pnpm/pnpm jest --silent=false
bonsol execute -f {{ include "bonsol-tester.executionReqPath" . }} -x 1000 -m 10000 -w
sleep 300
done
{{- end }}
Expand All @@ -69,13 +73,22 @@ spec:
- name: key # only works with keypair signer for now
mountPath: {{ .Values.signer.path }}
subPath: {{ base .Values.signer.path }}
- name: infiles
mountPath: {{ include "bonsol-tester.manifestPath" . }}
subPath: {{ base (include "bonsol-tester.manifestPath" .) }}
- name: infiles
mountPath: {{ include "bonsol-tester.executionReqPath" . }}
subPath: {{ base (include "bonsol-tester.executionReqPath" .) }}
{{- with .Values.tester.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: key
secret:
secretName: {{ include "bonsol-provernode.fullname" . }}
- name: infiles
configMap:
name: {{ include "bonsol-tester.fullname" . }}
{{- with .Values.tester.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ provernode:
##
image:
repository: ghcr.io/anagrambuild/bonsol-node@sha256
tag: a44f47818cbbc0bafcd27ae46226fdb2271662c3a070df6a1a84d5cc6b031a6d
tag: 05d33ce69b8db9cd0755fa6ff474db8b51cc680c874ff36a17de814e70e31eae
pullPolicy: "IfNotPresent"
imagePullSecrets: []

Expand Down Expand Up @@ -158,7 +158,7 @@ tester:
##
image:
repository: docker.io/zerocomputing/bonsol-tester
tag: 0.2.0
tag: 0.4.0
pullPolicy: "IfNotPresent"
imagePullSecrets: []

Expand Down

0 comments on commit 900ea9f

Please sign in to comment.