Skip to content

Commit

Permalink
fix: update configurations for mirror uploader sidecars (#138)
Browse files Browse the repository at this point in the history
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Deepak Mishra <deepak@swirldslabs.com>
Co-authored-by: Deepak Mishra <deepak@swirldslabs.com>
  • Loading branch information
leninmehedy and deepak-swirlds authored Jul 5, 2023
1 parent 09de701 commit 118662f
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 21 deletions.
69 changes: 68 additions & 1 deletion charts/hedera-network/templates/configmaps.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,89 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: uploader-config
name: account-balance-uploader-config
data:
DEBUG: "{{ $.Values.mirror.debug }}"
REAPER_ENABLE: "{{ $.Values.mirror.reaper.enable }}"
REAPER_MIN_KEEP: "{{ $.Values.mirror.reaper.minKeep }}"
REAPER_INTERVAL: "{{ $.Values.mirror.reaper.interval }}"
REAPER_DEFAULT_BACKOFF: "{{ $.Values.mirror.reaper.defaultBackoff }}"
STREAM_FILE_EXTENSION: "pb"
STREAM_SIG_EXTENSION: "pb_sig"
STREAM_EXTENSION: "pb.gz"
S3_ENABLE: "{{ $.Values.mirror.s3.enable }}"
GCS_ENABLE: "{{ $.Values.mirror.gcs.enable }}"
SIG_REQUIRE: "{{ $.Values.mirror.sig.require }}"
SIG_PRIORITIZE: "{{ $.Values.mirror.sig.prioritize }}"
SIG_EXTENSION: "pb_sig.gz"
BUCKET_PATH: "{{ $.Values.mirror.accountBalance.bucketPath }}"
BUCKET_NAME: "{{ $.Values.mirror.accountBalance.bucketName }}"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: record-stream-uploader-config
data:
DEBUG: "{{ $.Values.mirror.debug }}"
REAPER_ENABLE: "{{ $.Values.mirror.reaper.enable }}"
REAPER_MIN_KEEP: "{{ $.Values.mirror.reaper.minKeep }}"
REAPER_INTERVAL: "{{ $.Values.mirror.reaper.interval }}"
REAPER_DEFAULT_BACKOFF: "{{ $.Values.mirror.reaper.defaultBackoff }}"
STREAM_FILE_EXTENSION: "rcd"
STREAM_SIG_EXTENSION: "rcd_sig"
STREAM_EXTENSION: "rcd"
S3_ENABLE: "{{ $.Values.mirror.s3.enable }}"
GCS_ENABLE: "{{ $.Values.mirror.gcs.enable }}"
SIG_REQUIRE: "{{ $.Values.mirror.sig.require }}"
SIG_PRIORITIZE: "{{ $.Values.mirror.sig.prioritize }}"
SIG_EXTENSION: "rcd_sig"
BUCKET_PATH: "{{ $.Values.mirror.recordStream.bucketPath }}"
BUCKET_NAME: "{{ $.Values.mirror.recordStream.bucketName }}"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: event-stream-uploader-config
data:
DEBUG: "{{ $.Values.mirror.debug }}"
REAPER_ENABLE: "{{ $.Values.mirror.reaper.enable }}"
REAPER_MIN_KEEP: "{{ $.Values.mirror.reaper.minKeep }}"
REAPER_INTERVAL: "{{ $.Values.mirror.reaper.interval }}"
REAPER_DEFAULT_BACKOFF: "{{ $.Values.mirror.reaper.defaultBackoff }}"
STREAM_FILE_EXTENSION: "evts"
STREAM_SIG_EXTENSION: "evts_sig"
STREAM_EXTENSION: "evts"
S3_ENABLE: "{{ $.Values.mirror.s3.enable }}"
GCS_ENABLE: "{{ $.Values.mirror.gcs.enable }}"
SIG_REQUIRE: "{{ $.Values.mirror.sig.require }}"
SIG_PRIORITIZE: "{{ $.Values.mirror.sig.prioritize }}"
SIG_EXTENSION: "evts_sig"
BUCKET_PATH: "{{ $.Values.mirror.eventStream.bucketPath }}"
BUCKET_NAME: "{{ $.Values.mirror.eventStream.bucketName }}"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: record-stream-sidecar-config
data:
DEBUG: "{{ $.Values.mirror.debug }}"
REAPER_ENABLE: "{{ $.Values.mirror.reaper.enable }}"
REAPER_MIN_KEEP: "{{ $.Values.mirror.reaper.minKeep }}"
REAPER_INTERVAL: "{{ $.Values.mirror.reaper.interval }}"
REAPER_DEFAULT_BACKOFF: "{{ $.Values.mirror.reaper.defaultBackoff }}"
STREAM_FILE_EXTENSION: "rcd"
STREAM_SIG_EXTENSION: "rcd_sig"
STREAM_EXTENSION: "rcd"
S3_ENABLE: "{{ $.Values.mirror.s3.enable }}"
GCS_ENABLE: "{{ $.Values.mirror.gcs.enable }}"
SIG_REQUIRE: "{{ $.Values.mirror.sig.require }}"
SIG_PRIORITIZE: "{{ $.Values.mirror.sig.prioritize }}"
SIG_EXTENSION: "rcd_sig"
BUCKET_PATH: "{{ $.Values.mirror.recordStreamSideCar.bucketPath }}"
BUCKET_NAME: "{{ $.Values.mirror.recordStreamSideCar.bucketName }}"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: backup-config
data:
Expand Down
32 changes: 21 additions & 11 deletions charts/hedera-network/templates/network-node-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,26 @@ spec:
app: network-{{ $node.name }}
spec:
volumes:
- name: hedera-storage
- name: hgcapp-storage # change me
emptyDir: {}
{{- if $.Values.sidecars.otel.enabled }}
- name: otel-collector-config
configMap:
name: otel-collector-config
{{- end }}
initContainers:
- name: init-container
image: {{ $.Values.infrastructure.docker.images.root }}
command: [ "/bin/sh", "-c", "mkdir /opt/hgcapp/accountbalance /opt/hgcapp/events /opt/hgcapp/recordstream /opt/hgcapp/sidecar /opt/hgcapp/recordstream/uploader-stats/" ]
runAsUser: {{ $.Values.mirror.user }}
volumeMounts:
- name: hgcapp-storage
mountPath: /opt/hgcapp/
containers:
- name: root-container
image: {{ $.Values.infrastructure.docker.registry }}/{{ $.Values.infrastructure.docker.images.root }}
image: {{ $.Values.infrastructure.docker.images.root }}
command: [ "/bin/sh" ]
args: [ "-c", "while true; do echo root:heartbeat; sleep 10;done" ]
resources:
requests:
cpu: {{ $node.requests.cpu }}
Expand All @@ -37,7 +47,7 @@ spec:
cpu: {{ $node.limits.cpu }}
memory: {{ $node.limits.memory }}
volumeMounts:
- name: hedera-storage
- name: hgcapp-storage
mountPath: /opt/hgcapp/

{{- if $node.uploaderSidecars }}
Expand All @@ -55,11 +65,11 @@ spec:
- --watch-directory
- {{ $.Values.mirror.accountBalance.watchDir }}
volumeMounts:
- name: hedera-storage
- name: hgcapp-storage
mountPath: /opt/hgcapp/
envFrom:
- configMapRef:
name: uploader-config
name: account-balance-uploader-config
- secretRef:
name: uploader-secrets

Expand All @@ -76,11 +86,11 @@ spec:
- --watch-directory
- {{ $.Values.mirror.eventStream.watchDir }}
volumeMounts:
- name: hedera-storage
- name: hgcapp-storage
mountPath: /opt/hgcapp/
envFrom:
- configMapRef:
name: uploader-config
name: event-stream-uploader-config
- secretRef:
name: uploader-secrets

Expand All @@ -99,11 +109,11 @@ spec:
- --csv-stats-directory
- {{ $.Values.mirror.recordStream.csvStatsDir }}
volumeMounts:
- name: hedera-storage
- name: hgcapp-storage
mountPath: /opt/hgcapp/
envFrom:
- configMapRef:
name: uploader-config
name: record-stream-uploader-config
- secretRef:
name: uploader-secrets

Expand All @@ -120,11 +130,11 @@ spec:
- --watch-directory
- {{ $.Values.mirror.recordStreamSideCar.watchDir }}
volumeMounts:
- name: hedera-storage
- name: hgcapp-storage
mountPath: /opt/hgcapp/
envFrom:
- configMapRef:
name: uploader-config
name: record-stream-sidecar-config
- secretRef:
name: uploader-secrets
{{ end }}
Expand Down
8 changes: 4 additions & 4 deletions charts/hedera-network/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ metadata:
name: backup-secrets
type: Opaque
data:
# add your secrets here
# Note: Kubernetes secrets should be base64 encoded
secret1: "c2VjcmV0"
secret2: "c2VjcmV0"
S3_ACCESS_KEY: ""
S3_SECRET_KEY: ""
GCS_ACCESS_KEY: ""
GCS_SECRET_KEY: ""
12 changes: 7 additions & 5 deletions charts/hedera-network/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ infrastructure:
docker:
registry: docker.io
images:
root: docker:24.0.2-dind
root: ghcr.io/hashgraph/full-stack-testing/ubi8-init-dind:0.1.2
envoyproxy: envoyproxy/envoy:v1.26-latest
haproxy: haproxy:lts-alpine3.18
jsonrpcrelay: jsonrpcrelay
Expand All @@ -55,17 +55,21 @@ mirror:
accountBalance:
watchDir: /opt/hgcapp/accountbalance
bucketPath: /accountbalance
bucketName: "dev"
recordStream:
watchDir: /opt/hgcapp/recordstream
csvStatsDir: /uploader-stats/recordstreams/gcs
csvStatsDir: /opt/hgcapp/recordstream/uploader-stats/
bucketPath: /recordstream
bucketName: "dev"
recordStreamSideCar:
watchDir: /opt/hgcapp/sidecar
bucketPath: /recordstreamsidecar
bucketName: "dev"
eventStream:
watchDir: /opt/hgcapp/events
bucketPath: /events
user: 1000
bucketName: "dev"
user: 2000
debug: true
reaper:
enable: true
Expand All @@ -79,8 +83,6 @@ mirror:
enable: true
gcs:
enable: false
bucket:
path: bucket

proxies:
# 1 Haproxy Deployment is created for 1 hedera network node (StatefulSet)
Expand Down

0 comments on commit 118662f

Please sign in to comment.