From d150d49b6df4ecbc890750465f6b4ae61d3f164d Mon Sep 17 00:00:00 2001 From: Philex Date: Wed, 25 Sep 2024 15:46:12 -0700 Subject: [PATCH 1/3] Fix: Fetch Juno version from API. --- charts/juno-node/Chart.yaml | 2 +- .../templates/juno-data-backup-cronjob.yaml | 8 +++-- charts/juno-node/values.yaml | 32 ------------------- 3 files changed, 6 insertions(+), 36 deletions(-) diff --git a/charts/juno-node/Chart.yaml b/charts/juno-node/Chart.yaml index f043b956..5bd506dc 100644 --- a/charts/juno-node/Chart.yaml +++ b/charts/juno-node/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: juno-chart -version: 0.1.5 +version: 0.1.6 appVersion: "1" description: A Helm chart for deploying Juno service maintainers: diff --git a/charts/juno-node/templates/juno-data-backup-cronjob.yaml b/charts/juno-node/templates/juno-data-backup-cronjob.yaml index 22f91371..24afa5f4 100644 --- a/charts/juno-node/templates/juno-data-backup-cronjob.yaml +++ b/charts/juno-node/templates/juno-data-backup-cronjob.yaml @@ -146,10 +146,12 @@ data: - | apk add --no-cache curl && apk add --no-cache jq && - latestBlockNumber=$(curl --location '{{ .Values.backupJunoDataJob.junoFreeEndpoint }}/{{ .Values.backupJunoDataJob.network }}-juno' --header 'Content-Type: application/json' --data '{ "jsonrpc": "2.0","method": "starknet_blockNumber", "id": 1}' | jq '.result') && + latestBlockNumber=$(curl --location '{{ .Values.backupJunoDataJob.junoFreeEndpoint }}/{{ .Values.backupJunoDataJob.network }}-juno' --header 'Content-Type: application/json' --data '{ "jsonrpc": "2.0","method": "starknet_blockNumber", "id": 1}' | jq '.result') && echo "latestBlockNumber is $latestBlockNumber" && - mv /mnt/juno-tar-backup/juno_{{ .Values.backupJunoDataJob.network }}_{{ .Values.deployment.imagetag }}*.tar /mnt/juno-tar-backup/juno_{{ .Values.backupJunoDataJob.network }}_{{ .Values.deployment.imagetag }}_$latestBlockNumber.tar && - echo "/mnt/juno-tar-backup/juno_{{ .Values.backupJunoDataJob.network }}_{{ .Values.deployment.imagetag }}_$latestBlockNumber.tar" && + junoVersion=$(curl --location '{{ .Values.backupJunoDataJob.junoFreeEndpoint }}/{{ .Values.backupJunoDataJob.network }}-juno' --header 'Content-Type: application/json' --data '{ "jsonrpc": "2.0","method": "juno_version", "id": 1}' | jq -r '.result') && + echo "junoVersion is $junoVersion " && + mv /mnt/juno-tar-backup/juno_{{ .Values.backupJunoDataJob.network }}_*.tar /mnt/juno-tar-backup/juno_{{ .Values.backupJunoDataJob.network }}_${junoVersion}_${latestBlockNumber}.tar && + echo "/mnt/juno-tar-backup/juno_{{ .Values.backupJunoDataJob.network }}_${junoVersion}_${latestBlockNumber}.tar" && rclone copy /mnt/juno-tar-backup/*.tar R2:/{{ .Values.backupJunoDataJob.bucketName }}/{{ .Values.backupJunoDataJob.network }} volumeMounts: - name: {{ .Values.deployment.namespace }}-rclone-config diff --git a/charts/juno-node/values.yaml b/charts/juno-node/values.yaml index 32e90ade..c457627e 100644 --- a/charts/juno-node/values.yaml +++ b/charts/juno-node/values.yaml @@ -221,35 +221,3 @@ env: data: - name: NETWORK value: "juno" - -secret: - feederGateway: - refreshInterval: 10m - secretStoreName: juno-store - secretStoreKind: ClusterSecretStore - targetName: juno-goerli # name of the k8s secret to be created - targetCreationPolicy: Owner - key: feeder-gateway # name of the secret to target secret manager - property: testnet # name of the property to retrieve from secret manager - version: "1" # version of secret - secretKey: testnet # name of the secret data key - data: - refreshInterval: 10m - secretStoreName: juno-store # external store name (ClusterSecretStore), it is used to connect to a secret manager. - secretStoreKind: ClusterSecretStore # external store name - targetName: juno-sepolia-common # name of the k8s secret to be created - targetCreationPolicy: Owner - dataFromKey: secret-store # name of the secret in secret manager (GCP secret manager) - -### Back up juno data and upload to R2 cloud -backupJunoDataJob: - enabled: true - dataSource: "juno-sepolia-pv-ssd-juno-sepolia-0" - backupSchedule: "0 3 * * *" - cleanupSchedule: "0 10 * * *" - network: "sepolia" - storageSize: 250Gi - bucketName: "juno-snapshot" - enableRetention: false - retentionLimit: 10 - junoFreeEndpoint: "https://free-rpc-staging.nethermind.dev" From 37643ca5321cbc2bd1666191c81a55cf8890e000 Mon Sep 17 00:00:00 2001 From: Philex Date: Wed, 25 Sep 2024 15:54:24 -0700 Subject: [PATCH 2/3] Fix: Add default values --- charts/juno-node/values.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/charts/juno-node/values.yaml b/charts/juno-node/values.yaml index c457627e..a4b9217b 100644 --- a/charts/juno-node/values.yaml +++ b/charts/juno-node/values.yaml @@ -221,3 +221,25 @@ env: data: - name: NETWORK value: "juno" + +secret: + data: + refreshInterval: 10m + secretStoreName: juno-store # external store name (ClusterSecretStore), it is used to connect to a secret manager. + secretStoreKind: ClusterSecretStore # external store name + targetName: juno-sepolia-common # name of the k8s secret to be created + targetCreationPolicy: Owner + dataFromKey: secret-store # name of the secret in secret manager (GCP secret manager) + +### Back up juno data and upload to R2 cloud +backupJunoDataJob: + enabled: false + dataSource: "juno-sepolia-pv-ssd-juno-sepolia-0" + backupSchedule: "0 3 * * *" + cleanupSchedule: "0 10 * * *" + network: "sepolia" + storageSize: 250Gi + bucketName: "juno-snapshot" + enableRetention: false + retentionLimit: 10 + junoFreeEndpoint: "https://free-rpc-staging.nethermind.dev" From 0e86ca3717cf9ed83901435d6954a9aaae8b7ce9 Mon Sep 17 00:00:00 2001 From: Philex Date: Wed, 25 Sep 2024 16:02:48 -0700 Subject: [PATCH 3/3] Fix: Add default values --- charts/juno-node/values.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/charts/juno-node/values.yaml b/charts/juno-node/values.yaml index a4b9217b..dbd27528 100644 --- a/charts/juno-node/values.yaml +++ b/charts/juno-node/values.yaml @@ -223,6 +223,16 @@ env: value: "juno" secret: + feederGateway: + refreshInterval: 10m + secretStoreName: juno-store + secretStoreKind: ClusterSecretStore + targetName: juno-goerli # name of the k8s secret to be created + targetCreationPolicy: Owner + key: feeder-gateway # name of the secret to target secret manager + property: testnet # name of the property to retrieve from secret manager + version: "1" # version of secret + secretKey: testnet # name of the secret data key data: refreshInterval: 10m secretStoreName: juno-store # external store name (ClusterSecretStore), it is used to connect to a secret manager.