From 87cf64df07c1ab8d7a9da60b9b5b6288855dacc7 Mon Sep 17 00:00:00 2001 From: sky1045 Date: Thu, 30 May 2024 16:16:44 +0900 Subject: [PATCH 1/2] Add extraArgs to opGeth --- charts/mothership/templates/node.yaml | 23 +++---------------- .../templates/snapshot-storage.yaml | 2 ++ .../templates/snapshot-workflow.yaml | 2 ++ charts/mothership/values.yaml | 2 ++ 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/charts/mothership/templates/node.yaml b/charts/mothership/templates/node.yaml index 413f50dc4..61daf644b 100644 --- a/charts/mothership/templates/node.yaml +++ b/charts/mothership/templates/node.yaml @@ -35,26 +35,6 @@ spec: securityContext: runAsUser: 0 runAsNonRoot: false - {{- if $.Values.genesis.createSnapshot }} - - name: create-snapshot - image: alpine:3.19 - command: ["sh", "-c"] - args: - - | - apk add zstd aws-cli ; \ - TIME=`date -u +%Y%m%dT%H%M%SZ` ; \ - tar cvf - chaindata -C /data/geth | zstd - -f -o /data/snapshot-$TIME.tar.zst ; \ - aws s3 cp /data/snapshot-$TIME.tar.zst s3://$S3_SNAPSHOT_PATH/snapshot-$TIME.tar.zst --acl public-read - env: - - name: S3_SNAPSHOT_PATH - value: "{{ $.Values.genesis.s3SnapshotPath }}" - volumeMounts: - - mountPath: /data - name: op-geth-volume - securityContext: - runAsUser: 0 - runAsNonRoot: false - {{- end }} {{- if $.Values.genesis.snapshot }} - name: fetch-snapshot image: curlimages/curl @@ -148,6 +128,9 @@ spec: - --rollup.disabletxpoolgossip=true - --syncmode=full - --gcmode=archive + {{- with $.Values.node.opGeth.extraArgs }} + {{- toYaml . | nindent 12 }} + {{- end }} ports: - name: op-geth-rpc containerPort: {{ $.Values.node.opGeth.port.rpc }} diff --git a/charts/mothership/templates/snapshot-storage.yaml b/charts/mothership/templates/snapshot-storage.yaml index 766589d2a..74a95fc82 100644 --- a/charts/mothership/templates/snapshot-storage.yaml +++ b/charts/mothership/templates/snapshot-storage.yaml @@ -1,3 +1,4 @@ +{{- if .Values.genesis.createSnapshot }} apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: @@ -10,3 +11,4 @@ parameters: provisioner: ebs.csi.aws.com reclaimPolicy: Delete allowVolumeExpansion: true +{{- end }} diff --git a/charts/mothership/templates/snapshot-workflow.yaml b/charts/mothership/templates/snapshot-workflow.yaml index 020fe9ff9..32449c9bc 100644 --- a/charts/mothership/templates/snapshot-workflow.yaml +++ b/charts/mothership/templates/snapshot-workflow.yaml @@ -1,3 +1,4 @@ +{{- if .Values.genesis.createSnapshot }} apiVersion: argoproj.io/v1alpha1 kind: CronWorkflow metadata: @@ -305,3 +306,4 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} +{{- end }} diff --git a/charts/mothership/values.yaml b/charts/mothership/values.yaml index 417b407da..f9c0f2d49 100644 --- a/charts/mothership/values.yaml +++ b/charts/mothership/values.yaml @@ -4,6 +4,7 @@ externalSecret: genesis: createSnapshot: false snapshot: "" + s3SnapshotPath: "" volume: storage: 100Mi @@ -30,6 +31,7 @@ node: udp: 30303 volume: &op-geth-volume storage: 100Gi + extraArgs: [] opNode: image: &op-node-image us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.7.5 port: &op-node-port From 40d7048cc6429e53b515513fafc1c73f2a6f51c6 Mon Sep 17 00:00:00 2001 From: sky1045 Date: Thu, 30 May 2024 16:21:14 +0900 Subject: [PATCH 2/2] create snapshot on ohio networks --- mothership/holesky-devnet/values.yaml | 2 +- mothership/holesky-testnet/values.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mothership/holesky-devnet/values.yaml b/mothership/holesky-devnet/values.yaml index 8e5923990..84db58b3c 100644 --- a/mothership/holesky-devnet/values.yaml +++ b/mothership/holesky-devnet/values.yaml @@ -11,7 +11,7 @@ awsLoadBalancerSslCert: arn:aws:acm:us-east-2:319679068466:certificate/dbb84b9a- genesis: source: https://mothership-devnet-holesky-genesis.s3.us-east-2.amazonaws.com - createSnapshot: false + createSnapshot: true s3SnapshotPath: mothership-devnet-holesky-genesis/snapshot blockscout: diff --git a/mothership/holesky-testnet/values.yaml b/mothership/holesky-testnet/values.yaml index 42c3ec00b..ed17fb67a 100644 --- a/mothership/holesky-testnet/values.yaml +++ b/mothership/holesky-testnet/values.yaml @@ -11,8 +11,8 @@ awsLoadBalancerSslCert: arn:aws:acm:us-east-2:319679068466:certificate/dbb84b9a- genesis: source: https://mothership-devnet-holesky-genesis.s3.us-east-2.amazonaws.com/testnet - createSnapshot: false - s3SnapshotPath: "" + createSnapshot: true + s3SnapshotPath: "mothership-devnet-holesky-genesis/testnet/snapshot" blockscout: loadBalancerExternal: true