Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update configurations for mirror uploader sidecars #138

Merged
merged 4 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" ]
Copy link
Member Author

@leninmehedy leninmehedy Jul 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are having this sleep block to keep the root container running.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behavior is incorrect as the root container should be our standard image running the full init process. If we are using the ubi8-init-dind or ubi8-init-java17 images then we should not be overriding the entrypoint/command.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this was just a temporary change. The root image didn't have an entry-point so it was terminating. I'll remove it with my next PR.

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