Skip to content

Commit

Permalink
Merge pull request #408 from celo-org/conductor-raft-bootstreap
Browse files Browse the repository at this point in the history
Raft bootstrap and tag
  • Loading branch information
alvarof2 authored Oct 16, 2024
2 parents dc1b425 + 16b5764 commit 11a5a1d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/op-conductor/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: op-conductor
apiVersion: v2
version: 0.0.4
version: 0.0.5
description: Helm chart deploying OP Conductor, a HA controller for op-node
home: https://clabs.co
sources:
Expand Down
5 changes: 3 additions & 2 deletions charts/op-conductor/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# op-conductor

![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.8.0](https://img.shields.io/badge/AppVersion-v1.8.0-informational?style=flat-square)
![Version: 0.0.5](https://img.shields.io/badge/Version-0.0.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.8.0](https://img.shields.io/badge/AppVersion-v1.8.0-informational?style=flat-square)

Helm chart deploying OP Conductor, a HA controller for op-node

Expand Down Expand Up @@ -40,6 +40,7 @@ Helm chart deploying OP Conductor, a HA controller for op-node
| config.network | string | `""` | |
| config.node.rpc | string | `"http://op-node:8547"` | |
| config.paused | bool | `false` | |
| config.raft.bootstrap | bool | `false` | |
| config.raft.server.id | int | `1` | |
| config.raft.storage.dir | string | `"/raft"` | |
| config.rpc.addr | string | `"0.0.0.0"` | |
Expand All @@ -48,7 +49,7 @@ Helm chart deploying OP Conductor, a HA controller for op-node
| config.rpc.port | int | `8545` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"us-west1-docker.pkg.dev/blockchaintestsglobaltestnet/dev-images/op-conductor"` | |
| image.tag | string | `"dev"` | |
| image.tag | string | `"ea8d7ce5425edb3d1adcf0a8bb2a98fcdb21b3e0"` | |
| init.image.pullPolicy | string | `"IfNotPresent"` | |
| init.image.repository | string | `"alpine"` | |
| init.image.tag | float | `3.19` | |
Expand Down
15 changes: 10 additions & 5 deletions charts/op-conductor/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,15 @@ spec:
- -c
args:
- |
RID=$(echo $HOSTNAME | sed 's/{{ .Release.Name }}-//')
datadir="{{ .Values.persistence.mountPath }}"
bootstrap_flag=""
# Check if we're replica 0 and if we need to bootstrap the raft cluster
if [ "$RID" == "0" ] && [ ! -f $datadir/.initialized ]; then
bootstrap_flag="--raft.bootstrap=false"
# Check if we need to bootstrap the raft cluster
{{- if .Values.config.raft.bootstrap }}
if [ ! -d $datadir/{{ .Values.config.raft.server.id }} ]; then
bootstrap_flag="--raft.bootstrap=true"
fi
{{- end }}
exec /usr/local/bin/op-conductor \
--consensus.addr=$(cat $datadir/consensus.addr) \
--consensus.port={{ .Values.config.consensus.port }} \
Expand All @@ -127,7 +128,11 @@ spec:
--healthcheck.unsafe-interval={{ .Values.config.healthcheck.unsafeInterval }} \
--log.format={{ .Values.config.log.format }} \
--log.level={{ .Values.config.log.level }} \
--metrics.addr={{ .Values.config.metrics.addr }} \
{{- if .Values.config.metrics.enabled }}
--metrics.enabled \
--metrics.addr=0.0.0.0 \
--metrics.port={{ .Values.config.metrics.port }} \
{{- end }}
{{- if .Values.config.network }}
--network={{ .Values.config.network }} \
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions charts/op-conductor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ init:

image:
repository: us-west1-docker.pkg.dev/blockchaintestsglobaltestnet/dev-images/op-conductor
tag: dev
tag: ea8d7ce5425edb3d1adcf0a8bb2a98fcdb21b3e0
pullPolicy: IfNotPresent
statefulset:
annotations: {}
Expand All @@ -29,7 +29,7 @@ config:
addr: ""
port: 50050
raft:
# bootstrap: false
bootstrap: false
server:
id: 1
storage:
Expand Down

0 comments on commit 11a5a1d

Please sign in to comment.