diff --git a/charts/celestia-local/Chart.yaml b/charts/celestia-local/Chart.yaml index 42156026..1098f54b 100644 --- a/charts/celestia-local/Chart.yaml +++ b/charts/celestia-local/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.5 +version: 0.3.6 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/celestia-local/files/scripts/init-bridge.sh b/charts/celestia-local/files/scripts/init-bridge.sh index 8d46c7e9..8c2a0868 100755 --- a/charts/celestia-local/files/scripts/init-bridge.sh +++ b/charts/celestia-local/files/scripts/init-bridge.sh @@ -14,3 +14,6 @@ celestia bridge init \ --core.grpc.port $celestia_app_grpc_port \ --gateway.port $bridge_host_port cp -r "$home_dir/keyring-test" "$home_dir/bridge/keys/" + +sed -i 's/PeersLimit = 5/PeersLimit = 1/' $home_dir/bridge/config.toml +sed -i 's/Low = 50/Low = 0/' $home_dir/bridge/config.toml diff --git a/charts/celestia-local/files/scripts/start-bridge.sh b/charts/celestia-local/files/scripts/start-bridge.sh index a1316bf7..879cecde 100755 --- a/charts/celestia-local/files/scripts/start-bridge.sh +++ b/charts/celestia-local/files/scripts/start-bridge.sh @@ -59,4 +59,6 @@ exec celestia bridge start \ --gateway.port "$bridge_host_port" \ --rpc.addr 0.0.0.0 \ --rpc.port "$bridge_rpc_port" \ - --keyring.accname "$validator_key_name" + --keyring.accname "$validator_key_name" \ + --log.level "debug" \ + --log.level.module "share/discovery:error" diff --git a/charts/celestia-local/templates/deployment.yaml b/charts/celestia-local/templates/deployment.yaml index cae1350d..ed26cc64 100644 --- a/charts/celestia-local/templates/deployment.yaml +++ b/charts/celestia-local/templates/deployment.yaml @@ -85,6 +85,13 @@ spec: port: bridge-rest failureThreshold: 30 periodSeconds: 10 + resources: + requests: + cpu: 1 + memory: 4Gi + limits: + cpu: 2 + memory: 8Gi - name: token-server image: {{ .Values.tokenServerImage }} command: [ "/bin/httpd", "-v", "-f", "-p", "5353", "-h", "/home/celestia/token-server/" ] diff --git a/charts/celestia-local/templates/ingress.yaml b/charts/celestia-local/templates/ingress.yaml new file mode 100644 index 00000000..72ed4a93 --- /dev/null +++ b/charts/celestia-local/templates/ingress.yaml @@ -0,0 +1,53 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: celestia-local-network-ingress + namespace: {{ $.Values.global.namespace }} + labels: + app: celestia-local-network + annotations: + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" + nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" +spec: + ingressClassName: nginx + rules: + - host: rpc.node.celestia.localdev.me + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: celestia-service + port: + name: bridge-jsonrpc + - host: rest.node.celestia.localdev.me + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: celestia-service + port: + name: bridge-rest + - host: token.node.celestia.localdev.me + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: celestia-service + port: + name: token-svc + - host: rpc.app.celestia.localdev.me + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: celestia-app-service + port: + name: app-rpc diff --git a/charts/celestia-local/templates/storageclasses.yaml b/charts/celestia-local/templates/storageclasses.yaml index e3f7b6a4..0c818479 100644 --- a/charts/celestia-local/templates/storageclasses.yaml +++ b/charts/celestia-local/templates/storageclasses.yaml @@ -6,7 +6,7 @@ apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: {{ $value.persistentVolumeName }}-local - namespace: {{ .Values.global.namespace }} + namespace: {{ $.Values.global.namespace }} # NOTE - gce-pd provisioner has not been tested yet provisioner: kubernetes.io/no-provisioner volumeBindingMode: WaitForFirstConsumer diff --git a/charts/celestia-local/templates/volumes.yaml b/charts/celestia-local/templates/volumes.yaml index 5b798cb9..4943a228 100644 --- a/charts/celestia-local/templates/volumes.yaml +++ b/charts/celestia-local/templates/volumes.yaml @@ -7,7 +7,7 @@ apiVersion: v1 kind: PersistentVolume metadata: name: {{ $value.persistentVolumeName }}-pv - namespace: {{ .Values.global.namespace }} + namespace: {{ $.Values.global.namespace }} spec: capacity: storage: {{ $value.size }} diff --git a/charts/celestia-node/Chart.yaml b/charts/celestia-node/Chart.yaml index 0268c0da..02f7e265 100644 --- a/charts/celestia-node/Chart.yaml +++ b/charts/celestia-node/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.11 +version: 0.2.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/celestia-node/templates/_helpers.tpl b/charts/celestia-node/templates/_helpers.tpl index 81a5d1be..49772a43 100644 --- a/charts/celestia-node/templates/_helpers.tpl +++ b/charts/celestia-node/templates/_helpers.tpl @@ -1,3 +1,10 @@ +{{/* +Namepsace to deploy elements into. +*/}} +{{- define "celestiaNode.namespace" -}} +{{- default .Release.Namespace .Values.global.namespaceOverride | trunc 63 | trimSuffix "-" -}} +{{- end }} + {{/* Define the base label */}} @@ -15,8 +22,26 @@ Define the service name {{/* Define the k8s path to rpc service */}} -{{- define "celestiaNode.service.adresses.rpc" -}} -http://{{ include "celestiaNode.service.name" . }}.{{ .Values.global.namespace }}.svc.cluster.local:{{ .Values.ports.celestia.rpc }} +{{- define "celestiaNode.service.addresses.base" -}} +{{ include "celestiaNode.service.name" . }}.{{ .Values.global.namespace }}.svc.cluster.local:{{ .Values.ports.celestia.rpc }} +{{- end }} + + +{{/* +Define the k8s path to rpc service as http rpc +*/}} +{{- define "celestiaNode.service.addresses.rpc" -}} +http://{{ include "celestiaNode.service.addresses.base" . }} +{{- end }} + +{{/* +{{- end }} + +{{/* +Define the k8s path to rpc service as ws +*/}} +{{- define "celestiaNode.service.addresses.ws" -}} +ws://{{ include "celestiaNode.service.addresses.base" . }} {{- end }} {{/* @@ -28,7 +53,7 @@ Define the token service name {{/* Define the k8s path to token service */}} -{{- define "celestiaNode.service.adresses.token" -}} +{{- define "celestiaNode.service.addresses.token" -}} http://{{ include "celestiaNode.service.token.name" . }}.{{ .Values.global.namespace }}.svc.cluster.local:{{ .Values.ports.tokenServer }} {{- end }} diff --git a/charts/celestia-node/templates/configmap.yaml b/charts/celestia-node/templates/configmap.yaml index 27470e56..e32a52ae 100644 --- a/charts/celestia-node/templates/configmap.yaml +++ b/charts/celestia-node/templates/configmap.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ $label }}-files-env - namespace: {{ .Values.global.namespace }} + namespace: {{ include "celestiaNode.namespace" . }} data: config.toml: | {{- tpl (.Files.Get "files/config.toml") $ | nindent 4 }} @@ -12,7 +12,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ $label }}-scripts-env - namespace: {{ .Values.global.namespace }} + namespace: {{ include "celestiaNode.namespace" . }} data: start-node.sh: | {{- tpl (.Files.Get "files/scripts/start-node.sh") $ | nindent 4 }} @@ -23,7 +23,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ $label }}-env - namespace: {{ .Values.global.namespace }} + namespace: {{ include "celestiaNode.namespace" . }} data: CELESTIA_CUSTOM_TO_BE: {{ .Values.config.chainId }}:{{ $customInfo }} {{- end }} diff --git a/charts/celestia-node/templates/service.yaml b/charts/celestia-node/templates/service.yaml index 98f4c03d..e28b60a2 100644 --- a/charts/celestia-node/templates/service.yaml +++ b/charts/celestia-node/templates/service.yaml @@ -3,7 +3,7 @@ kind: Service apiVersion: v1 metadata: name: {{ include "celestiaNode.service.name" . }} - namespace: {{ .Values.global.namespace }} + namespace: {{ include "celestiaNode.namespace" . }} spec: selector: app: {{ $label }} @@ -18,7 +18,7 @@ kind: Service apiVersion: v1 metadata: name: {{ include "celestiaNode.service.token.name" . }} - namespace: {{ .Values.global.namespace }} + namespace: {{ include "celestiaNode.namespace" . }} spec: selector: app: {{ $label }} diff --git a/charts/celestia-node/templates/statefulset.yaml b/charts/celestia-node/templates/statefulset.yaml index 297c1d89..de13278c 100644 --- a/charts/celestia-node/templates/statefulset.yaml +++ b/charts/celestia-node/templates/statefulset.yaml @@ -6,7 +6,7 @@ metadata: name: {{ $label }} labels: app: {{ $label }} - namespace: {{ .Values.global.namespace }} + namespace: {{ include "celestiaNode.namespace" . }} spec: replicas: {{ .Values.global.replicaCount }} selector: diff --git a/charts/celestia-node/templates/volumes.yaml b/charts/celestia-node/templates/volumes.yaml index 3932d91d..93c5a583 100644 --- a/charts/celestia-node/templates/volumes.yaml +++ b/charts/celestia-node/templates/volumes.yaml @@ -33,7 +33,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ $label }}-{{ $key }}-pvc - namespace: {{ $.Values.global.namespace }} + namespace: {{ include "celestiaNode.namespace" $ }} labels: "app.kubernetes.io/name": "{{ $label }}-{{ $.Chart.Name }}" "app.kubernetes.io/managed-by": {{ $.Release.Service | quote }} diff --git a/charts/celestia-node/values.yaml b/charts/celestia-node/values.yaml index 1d4216df..c28826bf 100644 --- a/charts/celestia-node/values.yaml +++ b/charts/celestia-node/values.yaml @@ -2,7 +2,7 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. global: - namespace: "astria-dev-cluster" + namespaceOverride: '' replicaCount: 1 config: @@ -10,10 +10,10 @@ config: network: mocha-4 chainId: mocha-4 coreIp: "full.consensus.mocha-4.celestia-mocha.com" - configInfo: false type: light coreGrpcPort: 9090 tokenAuthLevel: 'read' + customInfo: '' images: pullPolicy: IfNotPresent diff --git a/charts/rollup/Chart.lock b/charts/rollup/Chart.lock index e1e4c3a5..fd78036c 100644 --- a/charts/rollup/Chart.lock +++ b/charts/rollup/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: celestia-node repository: file://../celestia-node - version: 0.1.11 -digest: sha256:d8bafe8e16323154332ee709b38754df209a51d4577b1d9c80a29898d7733421 -generated: "2024-01-22T12:37:57.716528-08:00" + version: 0.2.0 +digest: sha256:d259cf4f2d0f17d0c70a2e88f9735ab011831410284dade0f5846677fc836ba4 +generated: "2024-02-15T15:04:33.506122-08:00" diff --git a/charts/rollup/Chart.yaml b/charts/rollup/Chart.yaml index 8336c2b3..64af9d44 100644 --- a/charts/rollup/Chart.yaml +++ b/charts/rollup/Chart.yaml @@ -16,7 +16,7 @@ type: application # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.8.10 +version: 0.9.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to @@ -26,7 +26,7 @@ appVersion: "0.5.2" dependencies: - name: celestia-node - version: "0.1.11" + version: "0.2.0" repository: "file://../celestia-node" condition: celestia-node.enabled diff --git a/charts/rollup/charts/celestia-node-0.1.11.tgz b/charts/rollup/charts/celestia-node-0.1.11.tgz deleted file mode 100644 index 1670abb8..00000000 Binary files a/charts/rollup/charts/celestia-node-0.1.11.tgz and /dev/null differ diff --git a/charts/rollup/charts/celestia-node-0.2.0.tgz b/charts/rollup/charts/celestia-node-0.2.0.tgz new file mode 100644 index 00000000..8ac82373 Binary files /dev/null and b/charts/rollup/charts/celestia-node-0.2.0.tgz differ diff --git a/charts/rollup/files/genesis/geth-genesis.json b/charts/rollup/files/genesis/geth-genesis.json index e24a64b4..9ae9c8e2 100644 --- a/charts/rollup/files/genesis/geth-genesis.json +++ b/charts/rollup/files/genesis/geth-genesis.json @@ -16,11 +16,17 @@ "ethash": {}, {{- if .Values.config.rollup.genesis.extraDataOverride }} "astriaExtraDataOverride": "{{ .Values.config.rollup.genesis.extraDataOverride }}", - {{ end -}} + {{- end }} "astriaOverrideGenesisExtraData": {{ .Values.config.rollup.genesis.overrideGenesisExtraData }}, "astriaSequencerInitialHeight": {{ .Values.config.sequencer.initialBlockHeight }}, + {{- if not .Values.global.dev }} "astriaDataAvailabilityInitialHeight": {{ .Values.config.celestia.initialBlockHeight }}, "astriaDataAvailabilityHeightVariance": {{ .Values.config.celestia.heightVariance }} + {{- else }} + "astriaRollupName": "{{ .Values.config.rollup.name }}", + "astriaCelestiaInitialHeight": {{ .Values.config.celestia.initialBlockHeight }}, + "astriaCelestiaHeightVariance": {{ .Values.config.celestia.heightVariance }} + {{- end }} }, "difficulty": "10000000", "gasLimit": "8000000", diff --git a/charts/rollup/templates/_helpers.tpl b/charts/rollup/templates/_helpers.tpl index 177da164..c9b1ac68 100644 --- a/charts/rollup/templates/_helpers.tpl +++ b/charts/rollup/templates/_helpers.tpl @@ -1,3 +1,10 @@ +{{/* +Namepsace to deploy elements into. +*/}} +{{- define "rollup.namespace" -}} +{{- default .Release.Namespace .Values.global.namespaceOverride | trunc 63 | trimSuffix "-" -}} +{{- end }} + {{/* Expand the name of the chart. */}} @@ -19,6 +26,18 @@ Selector labels app: {{ include "rollup.name" . }} {{- end }} +{{/* +Full image paths for Astria built images +*/}} +{{- define "rollup.image" -}} +{{ .Values.images.geth.repo }}:{{ if .Values.global.dev }}{{ .Values.images.geth.devTag }}{{ else }}{{ .Values.images.geth.tag }}{{ end }} +{{- end }} +{{- define "conductor.image" -}} +{{ .Values.images.conductor.repo }}:{{ if .Values.global.dev }}{{ .Values.images.conductor.devTag }}{{ else }}{{ .Values.images.conductor.tag }}{{ end }} +{{- end }} +{{- define "composer.image" -}} +{{ .Values.images.composer.repo }}:{{ if .Values.global.dev }}{{ .Values.images.composer.devTag }}{{ else }}{{ .Values.images.composer.tag }}{{ end }} +{{- end }} {{/* diff --git a/charts/rollup/templates/configmap.yaml b/charts/rollup/templates/configmap.yaml index 34437829..88e19004 100644 --- a/charts/rollup/templates/configmap.yaml +++ b/charts/rollup/templates/configmap.yaml @@ -2,31 +2,55 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ .Values.config.rollup.name }}-conductor-env - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} data: ASTRIA_CONDUCTOR_LOG: "astria_conductor={{ .Values.config.logLevel }}" {{- if (index .Values "celestia-node").enabled }} - ASTRIA_CONDUCTOR_CELESTIA_NODE_URL: "{{ include "celestiaNode.service.adresses.rpc" (index .Subcharts "celestia-node") }}" - TOKEN_SERVER_URL: "{{ include "celestiaNode.service.adresses.token" (index .Subcharts "celestia-node") }}" + TOKEN_SERVER_URL: "{{ include "celestiaNode.service.addresses.token" (index .Subcharts "celestia-node") }}" {{- else }} - ASTRIA_CONDUCTOR_CELESTIA_NODE_URL: "{{ .Values.config.celestia.rpc }}" TOKEN_SERVER_URL: "{{ .Values.config.celestia.token }}" {{- end }} - ASTRIA_CONDUCTOR_CHAIN_ID: "{{ .Values.config.rollup.chainId }}" ASTRIA_CONDUCTOR_EXECUTION_RPC_URL: "http://127.0.0.1:{{ .Values.ports.executionGRPC }}" ASTRIA_CONDUCTOR_EXECUTION_COMMIT_LEVEL: "{{ .Values.config.rollup.executionCommitLevel }}" ASTRIA_CONDUCTOR_SEQUENCER_URL: "{{ .Values.config.sequencer.websocket }}" ASTRIA_CONDUCTOR_INITIAL_SEQUENCER_BLOCK_HEIGHT: "{{ .Values.config.sequencer.initialBlockHeight }}" + {{- if not .Values.global.dev }} + ASTRIA_CONDUCTOR_CHAIN_ID: "{{ .Values.config.rollup.name }}" ASTRIA_CONDUCTOR_ENABLE_OPTIMISM: "{{ .Values.config.rollup.optimism.enabled }}" ASTRIA_CONDUCTOR_ETHEREUM_L1_URL: "{{ .Values.config.rollup.optimism.ethereumL1Websocket }}" ASTRIA_CONDUCTOR_OPTIMISM_PORTAL_CONTRACT_ADDRESS: "{{ .Values.config.rollup.optimism.portalContractAddress }}" ASTRIA_CONDUCTOR_INITIAL_ETHEREUM_L1_BLOCK_HEIGHT: "{{ .Values.config.rollup.optimism.initialEthereumL1BlockHeight }}" + {{- if (index .Values "celestia-node").enabled }} + ASTRIA_CONDUCTOR_CELESTIA_NODE_URL: "{{ include "celestiaNode.service.addresses.rpc" (index .Subcharts "celestia-node") }}" + {{- else }} + ASTRIA_CONDUCTOR_CELESTIA_NODE_URL: "{{ .Values.config.celestia.rpc }}" + {{- end }} + {{- else }} + {{- if (index .Values "celestia-node").enabled }} + ASTRIA_CONDUCTOR_CELESTIA_NODE_HTTP_URL: "{{ include "celestiaNode.service.addresses.rpc" (index .Subcharts "celestia-node") }}" + ASTRIA_CONDUCTOR_CELESTIA_NODE_WEBSOCKET_URL: "{{ include "celestiaNode.service.addresses.ws" (index .Subcharts "celestia-node") }}" + {{- else }} + ASTRIA_CONDUCTOR_CELESTIA_NODE_HTTP_URL: "{{ .Values.config.celestia.rpc }}" + ASTRIA_CONDUCTOR_CELESTIA_NODE_WEBSOCKET_URL: "{{ .Values.config.celestia.ws }}" + {{- end }} + ASTRIA_CONDUCTOR_NO_METRICS: "{{ not .Values.config.rollup.metrics.enabled }}" + ASTRIA_CONDUCTOR_METRICS_HTTP_LISTENER_ADDR: "127.0.0.1:{{ .Values.ports.conductorMetrics }}" + ASTRIA_CONDUCTOR_FORCE_STDOUT: "{{ .Values.global.useTTY }}" + ASTRIA_CONDUCTOR_PRETTY_PRINT: "{{ .Values.global.useTTY }}" + ASTRIA_CONDUCTOR_NO_OTEL: "{{ not .Values.config.rollup.otel.enabled }}" + OTEL_EXPORTER_OTLP_ENDPOINT: "{{ .Values.config.rollup.otel.endpoint }}" + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "{{ .Values.config.rollup.otel.tracesEndpoint }}" + OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: "{{ .Values.config.rollup.otel.tracesTimeout }}" + OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: "{{ .Values.config.rollup.otel.tracesCompression }}" + OTEL_EXPORTER_OTLP_HEADERS: "{{ .Values.config.rollup.otel.otlpHeaders }}" + OTEL_EXPORTER_OTLP_TRACE_HEADERS: "{{ .Values.config.rollup.otel.traceHeaders }}" + {{- end }} --- apiVersion: v1 kind: ConfigMap metadata: name: {{ .Values.config.rollup.name }}-conductor-scripts - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} data: start-conductor.sh: | {{- .Files.Get "files/scripts/start-conductor.sh" | nindent 4 }} @@ -35,21 +59,37 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ .Values.config.rollup.name }}-composer-env - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} data: ASTRIA_COMPOSER_LOG: "astria_composer={{ .Values.config.logLevel }}" ASTRIA_COMPOSER_API_LISTEN_ADDR: "0.0.0.0:0" ASTRIA_COMPOSER_SEQUENCER_URL: "{{ .Values.config.sequencer.rpc }}" - ASTRIA_COMPOSER_ROLLUPS: "{{ .Values.config.rollup.chainId }}::ws://127.0.0.1:{{ .Values.ports.wsRPC }}" + ASTRIA_COMPOSER_ROLLUPS: "{{ .Values.config.rollup.name }}::ws://127.0.0.1:{{ .Values.ports.wsRPC }}" {{- if not .Values.secretProvider.enabled }} ASTRIA_COMPOSER_PRIVATE_KEY: "{{ .Values.config.sequencer.privateKey }}" {{- end }} + {{- if not .Values.global.dev }} + {{- else }} + ASTRIA_COMPOSER_MAX_BYTES_PER_BUNDLE: "{{ .Values.config.rollup.maxBytesPerBundle }}" + ASTRIA_COMPOSER_MAX_SUBMIT_INTERVAL_MS: "{{ .Values.config.rollup.maxSubmitInterval }}" + ASTRIA_COMPOSER_NO_METRICS: "{{ not .Values.config.rollup.metrics.enabled }}" + ASTRIA_COMPOSER_METRICS_HTTP_LISTENER_ADDR: "127.0.0.1:{{ .Values.ports.composerMetrics }}" + ASTRIA_COMPOSER_FORCE_STDOUT: "{{ .Values.global.useTTY }}" + ASTRIA_COMPOSER_PRETTY_PRINT: "{{ .Values.global.useTTY }}" + ASTRIA_COMPOSER_NO_OTEL: "{{ not .Values.config.rollup.otel.enabled }}" + OTEL_EXPORTER_OTLP_ENDPOINT: "{{ .Values.config.rollup.otel.endpoint }}" + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "{{ .Values.config.rollup.otel.tracesEndpoint }}" + OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: "{{ .Values.config.rollup.otel.tracesTimeout }}" + OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: "{{ .Values.config.rollup.otel.tracesCompression }}" + OTEL_EXPORTER_OTLP_HEADERS: "{{ .Values.config.rollup.otel.otlpHeaders }}" + OTEL_EXPORTER_OTLP_TRACE_HEADERS: "{{ .Values.config.rollup.otel.traceHeaders }}" + {{- end }} --- apiVersion: v1 kind: ConfigMap metadata: name: {{ .Values.config.rollup.name }}-faucet-env - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} data: ETH_FAUCET_PROXYCOUNT: "{{ .Values.config.faucet.proxyCount }}" ETH_FAUCET_PORT: "{{ .Values.ports.faucet }}" @@ -63,7 +103,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ .Values.config.rollup.name }}-geth-env - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} data: home_dir: "/home/geth" data_dir: "/home/geth/{{ .Values.config.rollup.name }}geth" @@ -72,7 +112,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ .Values.config.rollup.name }}-executor-scripts - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} data: geth-genesis.json: | {{- tpl (.Files.Get "files/genesis/geth-genesis.json") $ | nindent 4 }} @@ -83,7 +123,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ .Values.config.rollup.name }}-blockscout-env - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} data: ACCOUNT_CLOAK_KEY: "" ACCOUNT_ENABLED: "false" @@ -168,7 +208,7 @@ data: MICROSERVICE_SIG_PROVIDER_URL: "http://localhost:8050/" MICROSERVICE_VISUALIZE_SOL2UML_ENABLED: "true" MICROSERVICE_VISUALIZE_SOL2UML_URL: "http://localhost:8151/" - NETWORK: "{{ .Values.config.rollup.chainId }}" + NETWORK: "{{ .Values.config.rollup.name }}" NETWORK_PATH: "/" POOL_SIZE: "90" POOL_SIZE_API: "10" @@ -201,7 +241,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ .Values.config.rollup.name }}-smart-contract-verifier-env - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} data: SMART_CONTRACT_VERIFIER__JAEGER__AGENT_ENDPOINT: "localhost:6831" SMART_CONTRACT_VERIFIER__JAEGER__ENABLED: "false" @@ -229,7 +269,7 @@ data: apiVersion: v1 kind: ConfigMap metadata: - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} name: {{ .Values.config.rollup.name }}-visualizer-env data: VISUALIZER__SERVER__GRPC__ENABLED: "false" diff --git a/charts/rollup/templates/deployment.yaml b/charts/rollup/templates/deployment.yaml index 6f179d25..195bf0d0 100644 --- a/charts/rollup/templates/deployment.yaml +++ b/charts/rollup/templates/deployment.yaml @@ -4,7 +4,7 @@ metadata: name: {{ .Values.config.rollup.name }}-geth labels: app: {{ .Values.config.rollup.name }}-astria-dev-cluster - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} spec: replicas : {{ .Values.global.replicaCount }} selector: @@ -19,7 +19,7 @@ spec: initContainers: - name: init-geth command: [ "/scripts/init-geth.sh" ] - image: {{ .Values.images.geth }} + image: {{ include "rollup.image" . }} volumeMounts: - mountPath: /scripts/ name: {{ .Values.config.rollup.name }}-executor-scripts-volume @@ -49,6 +49,7 @@ spec: - --grpc.addr=0.0.0.0 - --grpc.port={{ .Values.ports.executionGRPC }} - --db.engine={{ .Values.config.rollup.dbEngine }} + - --maxpeers=0 {{- if .Values.config.rollup.archiveNode }} - --gcmode=archive - --history.transactions=0 @@ -60,7 +61,7 @@ spec: - --metrics.addr=0.0.0.0 - --metrics.port={{ .Values.ports.metrics }} {{- end }} - image: {{ .Values.images.geth }} + image: {{ include "rollup.image" . }} volumeMounts: - mountPath: /scripts/ name: {{ .Values.config.rollup.name }}-executor-scripts-volume @@ -81,9 +82,11 @@ spec: {{- if .Values.config.rollup.metrics.enabled }} - containerPort: {{ .Values.ports.metrics }} name: geth-metrics - {{- end }} + {{- end }} + resources: + {{- toYaml .Values.resources.geth | trim | nindent 12 }} - name: composer - image: {{ .Values.images.composer }} + image: {{ include "composer.image" . }} command: [ "/usr/local/bin/astria-composer" ] stdin: {{ .Values.global.useTTY }} tty: {{ .Values.global.useTTY }} @@ -103,8 +106,15 @@ spec: - mountPath: "/var/secrets" name: sequencer-private-key {{- end }} + {{- if .Values.config.rollup.metrics.enabled }} + ports: + - containerPort: {{ .Values.ports.composerMetrics }} + name: composer-metrics + {{- end }} + resources: + {{- toYaml .Values.resources.composer | trim | nindent 12 }} - name: conductor - image: {{ .Values.images.conductor }} + image: {{ include "conductor.image" . }} command: [ "/scripts/start-conductor.sh" ] stdin: {{ .Values.global.useTTY }} tty: {{ .Values.global.useTTY }} @@ -115,6 +125,13 @@ spec: envFrom: - configMapRef: name: {{ .Values.config.rollup.name }}-conductor-env + resources: + {{- toYaml .Values.resources.conductor | trim | nindent 12 }} + {{- if .Values.config.rollup.metrics.enabled }} + ports: + - containerPort: {{ .Values.ports.conductorMetrics }} + name: conductor-metrics + {{- end }} volumes: - name: {{ .Values.config.rollup.name }}-executor-scripts-volume configMap: @@ -147,7 +164,7 @@ metadata: name: {{ .Values.config.rollup.name }}-faucet labels: app: {{ .Values.config.rollup.name }}-astria-dev-cluster - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} spec: replicas : {{ .Values.global.replicaCount }} selector: @@ -211,7 +228,7 @@ metadata: name: {{ .Values.config.rollup.name }}-blockscout labels: app: {{ .Values.config.rollup.name }}-astria-dev-cluster - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} spec: replicas : {{ .Values.global.replicaCount }} selector: diff --git a/charts/rollup/templates/ingress.yaml b/charts/rollup/templates/ingress.yaml index 8f75d3ea..f5e182ae 100644 --- a/charts/rollup/templates/ingress.yaml +++ b/charts/rollup/templates/ingress.yaml @@ -15,7 +15,7 @@ apiVersion: {{ include "rollup.ingress.apiVersion" $ }} kind: Ingress metadata: name: {{ $.Values.config.rollup.name }}-{{ $service }}-ingress - namespace: {{ $.Values.global.namespace }} + namespace: {{ include "rollup.namespace" $ }} labels: {{- with $ingress.labels }} {{- toYaml . | nindent 4 }} diff --git a/charts/rollup/templates/service.yaml b/charts/rollup/templates/service.yaml index 084433c8..8865115f 100644 --- a/charts/rollup/templates/service.yaml +++ b/charts/rollup/templates/service.yaml @@ -2,7 +2,7 @@ kind: Service apiVersion: v1 metadata: name: {{ .Values.config.rollup.name }}-evm-service - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} spec: selector: app: {{ .Values.config.rollup.name }}-astria-dev-cluster @@ -21,7 +21,7 @@ kind: Service apiVersion: v1 metadata: name: {{ .Values.config.rollup.name }}-faucet-service - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} spec: selector: app: {{ .Values.config.rollup.name }}-astria-dev-cluster @@ -34,7 +34,7 @@ kind: Service apiVersion: v1 metadata: name: {{ .Values.config.rollup.name }}-blockscout-svc - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} spec: selector: app: {{ .Values.config.rollup.name }}-astria-dev-cluster @@ -48,7 +48,7 @@ kind: Service apiVersion: v1 metadata: name: {{ .Values.config.rollup.name }}-metrics - namespace: {{ .Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} labels: app: {{ .Values.config.rollup.name }}-astria-dev-cluster spec: @@ -58,4 +58,10 @@ spec: - name: geth-metrics port: {{ .Values.ports.metrics }} targetPort: geth-metrics + - name: composer-metrics + port: {{ .Values.ports.composerMetrics }} + targetPort: composer-metrics + - name: conductor-metrics + port: {{ .Values.ports.conductorMetrics }} + targetPort: conductor-metrics {{- end }} diff --git a/charts/rollup/templates/servicemonitor.yaml b/charts/rollup/templates/servicemonitor.yaml index 31866ad5..9e8a00ef 100644 --- a/charts/rollup/templates/servicemonitor.yaml +++ b/charts/rollup/templates/servicemonitor.yaml @@ -12,7 +12,7 @@ spec: jobLabel: geth-metrics namespaceSelector: matchNames: - - {{ .Values.global.namespace }} + - {{ include "rollup.namespace" . }} selector: matchLabels: app: {{ .Values.config.rollup.name }}-astria-dev-cluster @@ -25,4 +25,20 @@ spec: {{- with .Values.config.rollup.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ . }} {{- end }} + - port: composer-metrics + path: / + {{- with .Values.config.rollup.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.config.rollup.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} + - port: conductor-metrics + path: / + {{- with .Values.config.rollup.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.config.rollup.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} {{- end }} diff --git a/charts/rollup/templates/volumes.yaml b/charts/rollup/templates/volumes.yaml index 7fe3408f..36f09a38 100644 --- a/charts/rollup/templates/volumes.yaml +++ b/charts/rollup/templates/volumes.yaml @@ -32,7 +32,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ $.Values.config.rollup.name }}-{{ $value.persistentVolumeName }}-pvc-geth - namespace: {{ $.Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} labels: "app.kubernetes.io/name": "{{ $.Values.config.rollup.name }}-{{ $.Chart.Name }}" "app.kubernetes.io/managed-by": {{ $.Release.Service | quote }} @@ -54,7 +54,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ $.Values.config.rollup.name }}-{{ $value.persistentVolumeName }}-pvc-blockscout - namespace: {{ $.Values.global.namespace }} + namespace: {{ include "rollup.namespace" . }} labels: "app.kubernetes.io/name": {{ $.Values.config.rollup.name }}-{{ $.Chart.Name }} "app.kubernetes.io/managed-by": {{ $.Release.Service | quote }} diff --git a/charts/rollup/values.yaml b/charts/rollup/values.yaml index 5e73c5e2..f4654bc9 100644 --- a/charts/rollup/values.yaml +++ b/charts/rollup/values.yaml @@ -1,9 +1,36 @@ global: - namespace: "astria-dev-cluster" + namespaceOverride: "" replicaCount: 1 # Whether to use tty readable logging for astria services, when false use json. # Best to be false in production environments, true for clean logs on local dev. - useTTY: true + useTTY: false + dev: false + +images: + geth: + repo: "ghcr.io/astriaorg/go-ethereum" + tag: "0.5.2" + devTag: "0.6.0" + conductor: + repo: "ghcr.io/astriaorg/conductor" + tag: "0.11.1" + devTag: "latest" + composer: + repo: "ghcr.io/astriaorg/composer" + tag: "0.3.1" + devTag: "latest" + + # Rollup faucet + faucet: "ghcr.io/astriaorg/ria-faucet:0.0.1" + + # Pertaining to deploying blockscout block explorer + blockscout: + core: "docker.io/blockscout/blockscout:5.1.0" + postgres: "docker.io/library/postgres:14" + redis: "docker.io/library/redis:alpine" + sigProvider: "ghcr.io/blockscout/sig-provider@sha256:ae371ce8d0a20993bf61ca81b3394416f4778c9edd398250fd4d81a8d6820950" + smartContractVerifier: "ghcr.io/blockscout/smart-contract-verifier@sha256:f07b2d874c28d45f5ba81f297c868a746a03771e8b6d9b8e96f0eba0beeb1016" + visualizer: "ghcr.io/blockscout/visualizer@sha256:99479da126248e0aba5c32b1e32625f8c527b72924f55cb510b50e5f854b2d15" config: # The level at which core astria components will log out @@ -11,10 +38,8 @@ config: logLevel: "debug" rollup: - # Default name for the rollup chain + # Default name for the rollup chain, used to generate Rollup ID name: astria - # Chain ID used for submission to shared sequencer, and generating DA namespace - chainId: astria # Can be set to 'pebble' or 'leveldb' dbEngine: pebble # Set to true to keep history of all blocks @@ -26,6 +51,8 @@ config: # - "FirmOnly" -> blocks are only pulled from DA # - "SoftAndFirm" -> blocks are pulled from both the sequencer and DA executionCommitLevel: 'SoftAndFirm' + maxBytesPerBundle: 200000 + maxSubmitInterval: 2000 # Configuration specific to EVM rollup genesis genesis: # Set to a hex set of bytes if your rollup has manually configured extra data @@ -50,6 +77,14 @@ config: metrics: # set to enable prometheus metrics enabled: false + otel: + enabled: false + endpoint: + tracesEndpoint: + tracesCompression: gzip + tracesTimeout: 10 + otlpHeaders: + traceHeaders: serviceMonitor: # set to enable port svc and service monitor enabled: false @@ -93,7 +128,7 @@ config: # Configuration related to sequencer connection for rollup sequencer: # Block height to start syncing rollup from - initialBlockHeight: 1 + initialBlockHeight: 2 # Websocket connection used for websocket: "ws://node0-sequencer-rpc-service.astria-dev-cluster.svc.cluster.local:26657/websocket" # URL path for the sequencer @@ -105,10 +140,11 @@ config: celestia: # if config.rollup.executionLevel is NOT 'SoftOnly' AND celestia-node is not enabled - # this must be set to access celestia network. + # the rpc, ws, and token fields must be set to access celestia network. rpc: "" + ws: "" token: "" - initialBlockHeight: 1 + initialBlockHeight: 2 heightVariance: 10 blockscout: @@ -132,24 +168,6 @@ celestia-node: # # The custom info below must be grabbed from the custom network bridge on startup # customInfo: ":" -images: - # Core images for the rollup, developed for Astria - geth: "ghcr.io/astriaorg/go-ethereum:0.5.2" - conductor: "ghcr.io/astriaorg/conductor:0.11.1" - composer: "ghcr.io/astriaorg/composer:0.3.1" - - # Rollup faucet - faucet: "ghcr.io/astriaorg/ria-faucet:0.0.1" - - # Pertaining to deploying blockscout block explorer - blockscout: - core: "docker.io/blockscout/blockscout:5.1.0" - postgres: "docker.io/library/postgres:14" - redis: "docker.io/library/redis:alpine" - sigProvider: "ghcr.io/blockscout/sig-provider@sha256:ae371ce8d0a20993bf61ca81b3394416f4778c9edd398250fd4d81a8d6820950" - smartContractVerifier: "ghcr.io/blockscout/smart-contract-verifier@sha256:f07b2d874c28d45f5ba81f297c868a746a03771e8b6d9b8e96f0eba0beeb1016" - visualizer: "ghcr.io/blockscout/visualizer@sha256:99479da126248e0aba5c32b1e32625f8c527b72924f55cb510b50e5f854b2d15" - # When deploying in a production environment should use a secret provider # This is configured for use with GCP, need to set own resource names # and keys @@ -251,6 +269,29 @@ ingress: # NOTE - `rollupName` will be used with `persistentVolumeName` to generate names for kubernetes resources. # e.g. astria-executor-pv, astria-executor-pvc +resources: + conductor: + requests: + cpu: 0.01 + memory: 1Mi + limits: + cpu: 0.1 + memory: 20Mi + composer: + requests: + cpu: 0.01 + memory: 1Mi + limits: + cpu: 0.1 + memory: 20Mi + geth: + requests: + cpu: 0.25 + memory: 256Mi + limits: + cpu: 2 + memory: 1Gi + storage: enabled: false local: true @@ -269,3 +310,5 @@ ports: faucet: 8080 blockscout: 4000 metrics: 6060 + conductorMetrics: 9000 + composerMetrics: 9001 diff --git a/charts/sequencer-relayer/Chart.yaml b/charts/sequencer-relayer/Chart.yaml index c8b39663..aee9e329 100644 --- a/charts/sequencer-relayer/Chart.yaml +++ b/charts/sequencer-relayer/Chart.yaml @@ -15,13 +15,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.2 +version: 0.4.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.9.1" +appVersion: "0.10.0" maintainers: - name: wafflesvonmaple diff --git a/charts/sequencer-relayer/files/scripts/start-relayer.sh b/charts/sequencer-relayer/files/scripts/start-relayer.sh index 992af874..0b854727 100644 --- a/charts/sequencer-relayer/files/scripts/start-relayer.sh +++ b/charts/sequencer-relayer/files/scripts/start-relayer.sh @@ -18,5 +18,15 @@ if [ -z "$ASTRIA_SEQUENCER_RELAYER_CELESTIA_BEARER_TOKEN" ]; then fi echo "ASTRIA_SEQUENCER_RELAYER_CELESTIA_BEARER_TOKEN set" +if ! [ -f "$ASTRIA_SEQUENCER_RELAYER_PRE_SUBMIT_PATH" ]; then + echo "Pre-submit storage file not found, instantiating with ignore state. Post submit storage file will be created on first submit." + echo "{\"state\": \"ignore\"}" > $ASTRIA_SEQUENCER_RELAYER_PRE_SUBMIT_PATH +fi + +if ! [ -f "$ASTRIA_SEQUENCER_RELAYER_POST_SUBMIT_PATH" ]; then + echo "Post-submit storage file does not exist, instantiating with fresh state. Will start relaying from first sequencer block." + echo "{\"state\": \"fresh\"}" > $ASTRIA_SEQUENCER_RELAYER_POST_SUBMIT_PATH +fi + exec /usr/local/bin/astria-sequencer-relayer diff --git a/charts/sequencer-relayer/templates/_helpers.tpl b/charts/sequencer-relayer/templates/_helpers.tpl new file mode 100644 index 00000000..11857987 --- /dev/null +++ b/charts/sequencer-relayer/templates/_helpers.tpl @@ -0,0 +1,22 @@ +{{/* +Namepsace to deploy elements into. +*/}} +{{- define "sequencer-relayer.namespace" -}} +{{- default .Release.Namespace .Values.global.namespaceOverride | trunc 63 | trimSuffix "-" -}} +{{- end }} + +{{- define "sequencer-relayer.image" -}} +{{ .Values.images.sequencerRelayer.repo }}:{{ if .Values.global.dev }}{{ .Values.images.sequencerRelayer.devTag }}{{ else }}{{ .Values.images.sequencerRelayer.tag }}{{ end }} +{{- end }} + +{{- define "sequencer-relayer.storage.mountPath" -}} +/astria-sequencer-relayer +{{- end }} + +{{- define "sequencer-relayer.storage.preSubmitPath" -}} +{{ include "sequencer-relayer.storage.mountPath" . }}/presubmit.json +{{- end }} + +{{- define "sequencer-relayer.storage.postSubmitPath" -}} +{{ include "sequencer-relayer.storage.mountPath" . }}/postsubmit.json +{{- end }} diff --git a/charts/sequencer-relayer/templates/configmaps.yaml b/charts/sequencer-relayer/templates/configmaps.yaml index 071e6dc8..693bc68c 100644 --- a/charts/sequencer-relayer/templates/configmaps.yaml +++ b/charts/sequencer-relayer/templates/configmaps.yaml @@ -2,23 +2,40 @@ apiVersion: v1 kind: ConfigMap metadata: name: relayer-env - namespace: {{ .Values.global.namespace }} + namespace: {{ include "sequencer-relayer.namespace" . }} data: ASTRIA_SEQUENCER_RELAYER_LOG: "astria_sequencer_relayer=debug" ASTRIA_SEQUENCER_RELAYER_SEQUENCER_ENDPOINT: "{{ .Values.config.relayer.sequencerRpc }}" ASTRIA_SEQUENCER_RELAYER_CELESTIA_ENDPOINT: "{{ .Values.config.relayer.celestiaRpc }}" ASTRIA_SEQUENCER_RELAYER_BLOCK_TIME: "1000" ASTRIA_SEQUENCER_RELAYER_VALIDATOR_KEY_FILE: /cometbft/config/priv_validator_key.json - ASTRIA_SEQUENCER_RELAYER_RPC_PORT: "{{ .Values.ports.relayerRPC }}" ASTRIA_SEQUENCER_RELAYER_RELAY_ONLY_VALIDATOR_KEY_BLOCKS: "false" ASTRIA_SEQUENCER_RELAYER_CELESTIA_BEARER_TOKEN: "{{ .Values.config.relayer.celestiaBearerToken }}" TOKEN_SERVER: "{{ .Values.config.relayer.tokenServer }}" + {{- if not .Values.global.dev }} + ASTRIA_SEQUENCER_RELAYER_RPC_PORT: "{{ .Values.ports.relayerRPC }}" + {{- else }} + ASTRIA_SEQUENCER_RELAYER_API_ADDR: "127.0.0.1:{{ .Values.ports.relayerRPC }}" + ASTRIA_SEQUENCER_RELAYER_PRE_SUBMIT_PATH: "{{ include "sequencer-relayer.storage.preSubmitPath" . }}" + ASTRIA_SEQUENCER_RELAYER_POST_SUBMIT_PATH: "{{ include "sequencer-relayer.storage.postSubmitPath" . }}" + ASTRIA_SEQUENCER_RELAYER_NO_METRICS: "{{ not .Values.config.relayer.metrics.enabled }}" + ASTRIA_SEQUENCER_RELAYER_METRICS_HTTP_LISTENER_ADDR: "127.0.0.1:{{ .Values.ports.metrics }}" + ASTRIA_SEQUENCER_RELAYER_FORCE_STDOUT: "{{ .Values.global.useTTY }}" + ASTRIA_SEQUENCER_RELAYER_PRETTY_PRINT: "{{ .Values.global.useTTY }}" + ASTRIA_SEQUENCER_RELAYER_NO_OTEL: "{{ not .Values.config.relayer.otel.enabled }}" + OTEL_EXPORTER_OTLP_ENDPOINT: "{{ .Values.config.relayer.otel.endpoint }}" + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "{{ .Values.config.relayer.otel.tracesEndpoint }}" + OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: "{{ .Values.config.relayer.otel.tracesTimeout }}" + OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: "{{ .Values.config.relayer.otel.tracesCompression }}" + OTEL_EXPORTER_OTLP_HEADERS: "{{ .Values.config.relayer.otel.otlpHeaders }}" + OTEL_EXPORTER_OTLP_TRACE_HEADERS: "{{ .Values.config.relayer.otel.traceHeaders }}" + {{- end }} --- apiVersion: v1 kind: ConfigMap metadata: name: relayer-scripts - namespace: {{ .Values.global.namespace }} + namespace: {{ include "sequencer-relayer.namespace" . }} data: start-relayer.sh: | {{- .Files.Get "files/scripts/start-relayer.sh" | nindent 4 }} diff --git a/charts/sequencer-relayer/templates/service.yaml b/charts/sequencer-relayer/templates/service.yaml new file mode 100644 index 00000000..cd7c4c9e --- /dev/null +++ b/charts/sequencer-relayer/templates/service.yaml @@ -0,0 +1,16 @@ +{{- if .Values.serviceMonitor.enabled }} +kind: Service +apiVersion: v1 +metadata: + name: sequencer-relayer-metrics + namespace: {{ include "sequencer-relayer.namespace" . }} +spec: + selector: + app: sequencer-relayer + ports: + {{- if .Values.config.relayer.metrics.enabled }} + - name: metrics + port: {{ .Values.ports.metrics }} + targetPort: metrics + {{- end }} +{{- end }} diff --git a/charts/sequencer-relayer/templates/servicemonitor.yaml b/charts/sequencer-relayer/templates/servicemonitor.yaml new file mode 100644 index 00000000..45d12e16 --- /dev/null +++ b/charts/sequencer-relayer/templates/servicemonitor.yaml @@ -0,0 +1,29 @@ +{{- if and .Values.serviceMonitor.enabled .Values.config.sequencer.metrics.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: sequencer-relayer-metrics + labels: + {{- include "sequencer.labels" . | nindent 4 }} + {{- with .Values.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + jobLabel: sequencer-relayer-metric + namespaceSelector: + matchNames: + - {{ include "sequencer-relayer.namespace" . }} + selector: + matchLabels: + app: sequencer-relayer + name: sequencer-relayer-metrics + endpoints: + - port: metric + path: / + {{- with .Values.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} +{{- end }} diff --git a/charts/sequencer-relayer/templates/deployment.yaml b/charts/sequencer-relayer/templates/statefulset.yaml similarity index 58% rename from charts/sequencer-relayer/templates/deployment.yaml rename to charts/sequencer-relayer/templates/statefulset.yaml index 286713b2..484dd8e9 100644 --- a/charts/sequencer-relayer/templates/deployment.yaml +++ b/charts/sequencer-relayer/templates/statefulset.yaml @@ -1,10 +1,10 @@ apiVersion: apps/v1 -kind: Deployment +kind: StatefulSet metadata: name: sequencer-relayer labels: app: sequencer-relayer - namespace: {{ .Values.global.namespace }} + namespace: {{ include "sequencer-relayer.namespace" . }} spec: replicas: {{ .Values.global.replicaCount }} selector: @@ -20,7 +20,7 @@ spec: containers: - name: sequencer-relayer imagePullPolicy: IfNotPresent - image: "{{ .Values.images.sequencerRelayer }}" + image: {{ include "sequencer-relayer.image" . }} command: [ "/scripts/start-relayer.sh" ] stdin: {{ .Values.global.useTTY }} tty: {{ .Values.global.useTTY }} @@ -30,8 +30,20 @@ spec: volumeMounts: - mountPath: /scripts/ name: relayer-scripts-volume + - mountPath: {{ include "sequencer-relayer.storage.mountPath" . }} + name: relayer-storage-vol + ports: + - containerPort: {{ .Values.ports.metrics }} + name: metrics volumes: - name: relayer-scripts-volume configMap: name: relayer-scripts defaultMode: 0500 + - name: relayer-storage-vol + {{- if .Values.storage.enabled }} + persistentVolumeClaim: + claimName: {{ .Values.storage.entities.sequencerRelayerStorage.persistentVolumeName }}-pvc + {{- else }} + emptyDir: {} + {{- end }} diff --git a/charts/sequencer-relayer/templates/storageclasses.yaml b/charts/sequencer-relayer/templates/storageclasses.yaml new file mode 100644 index 00000000..e747550d --- /dev/null +++ b/charts/sequencer-relayer/templates/storageclasses.yaml @@ -0,0 +1,14 @@ +{{/* We only want to create a storage class if we are local. */}} +{{/* For production, you need to create a StorageClass on GKE. */}} +{{- if and .Values.storage.enabled .Values.storage.local }} + {{- range $key, $value := .Values.storage.entities }} +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: sequencer-relayer-{{ $value.persistentVolumeName }}-local +provisioner: kubernetes.io/no-provisioner +volumeBindingMode: WaitForFirstConsumer +reclaimPolicy: Retain +--- + {{- end }} +{{- end }} diff --git a/charts/sequencer-relayer/templates/volumes.yaml b/charts/sequencer-relayer/templates/volumes.yaml new file mode 100644 index 00000000..4107f054 --- /dev/null +++ b/charts/sequencer-relayer/templates/volumes.yaml @@ -0,0 +1,54 @@ +{{/* We need to manually create a PersistentVolume when local. */}} +{{/* In prod, a PV will be created by the StorageClass' provisioner using dynamic provisioning feature. */}} +{{- if .Values.storage.enabled }} + {{- range $key, $value := .Values.storage.entities }} + {{- if $.Values.storage.local }} +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ $value.persistentVolumeName }}-pv +spec: + capacity: + storage: {{ $value.size }} + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + storageClassName: {{ $value.persistentVolumeName }}-local + local: + path: {{ $value.path }} + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - astria-dev-cluster-control-plane + - astria-dev-cluster-worker +--- + {{- end }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ $value.persistentVolumeName }}-pvc + namespace: {{ include "sequencer-relayer.namespace" $ }} + labels: + "app.kubernetes.io/name": "{{ $.Chart.Name }}" + "app.kubernetes.io/managed-by": {{ $.Release.Service | quote }} + "helm.sh/chart": {{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_" }} +spec: + {{- if $.Values.storage.local }} + storageClassName: {{ $value.persistentVolumeName }}-local + {{- end }} + {{- if $value.storageClassName }} + storageClassName: {{ $value.storageClassName }} + {{- end }} + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ $value.size }} +--- + {{- end }} +{{- end }} diff --git a/charts/sequencer-relayer/values.yaml b/charts/sequencer-relayer/values.yaml index 6fba8693..43d598fd 100644 --- a/charts/sequencer-relayer/values.yaml +++ b/charts/sequencer-relayer/values.yaml @@ -2,11 +2,19 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. global: - namespace: "astria-dev-cluster" + namespaceOverride: "" replicaCount: 1 # Whether to use tty readable logging for astria services, when false use json. # Best to be false in production environments, true for clean logs on local dev. useTTY: true + dev: false + +# sequencer core images +images: + sequencerRelayer: + repo: ghcr.io/astriaorg/sequencer-relayer + tag: "0.9.1" + devTag: latest config: relayer: @@ -15,9 +23,33 @@ config: tokenServer: http://celestia-service.astria-dev-cluster.svc.cluster.local:5353 sequencerRpc: "" -# sequencer core images -images: - sequencerRelayer: ghcr.io/astriaorg/sequencer-relayer:0.9.1 + metrics: + enabled: false + + otel: + enabled: false + endpoint: + tracesEndpoint: + tracesCompression: gzip + tracesTimeout: 10 + otlpHeaders: + traceHeaders: ports: relayerRPC: 2450 + metrics: 9000 + +serviceMonitor: + enabled: false + port: 26660 + additionalLabels: + release: kube-prometheus-stack + +storage: + enabled: false + local: true + entities: + sequencerRelayerStorage: + size: "1Gi" + persistentVolumeName: "sequencer-relayer-storage" + path: "/data/sequencer-relayer-data" diff --git a/charts/sequencer/Chart.lock b/charts/sequencer/Chart.lock index 3835c70f..a5a64672 100644 --- a/charts/sequencer/Chart.lock +++ b/charts/sequencer/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: sequencer-relayer repository: file://../sequencer-relayer - version: 0.3.2 -digest: sha256:8d6e757ca3db3992d652c80ef724728af0586e7c0161d3e40fcce2a2c0549d41 -generated: "2024-01-10T13:47:30.697022-08:00" + version: 0.4.0 +digest: sha256:03184a36655bfc3c7bc556dc8ac6d78281980ceb7723bec5b06128c94b5194cf +generated: "2024-02-15T14:14:12.699205-08:00" diff --git a/charts/sequencer/Chart.yaml b/charts/sequencer/Chart.yaml index cfd924ce..498382de 100644 --- a/charts/sequencer/Chart.yaml +++ b/charts/sequencer/Chart.yaml @@ -15,17 +15,17 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.9.5 +version: 0.10.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.8.0" +appVersion: "0.9.0" dependencies: - name: sequencer-relayer - version: "0.3.2" + version: "0.4.0" repository: "file://../sequencer-relayer" condition: sequencer-relayer.enabled diff --git a/charts/sequencer/charts/sequencer-relayer-0.3.2.tgz b/charts/sequencer/charts/sequencer-relayer-0.3.2.tgz deleted file mode 100644 index 52d47ab0..00000000 Binary files a/charts/sequencer/charts/sequencer-relayer-0.3.2.tgz and /dev/null differ diff --git a/charts/sequencer/charts/sequencer-relayer-0.4.0.tgz b/charts/sequencer/charts/sequencer-relayer-0.4.0.tgz new file mode 100644 index 00000000..a653224e Binary files /dev/null and b/charts/sequencer/charts/sequencer-relayer-0.4.0.tgz differ diff --git a/charts/sequencer/files/cometbft/config/genesis.json b/charts/sequencer/files/cometbft/config/genesis.json index 079e79da..03b1adf9 100644 --- a/charts/sequencer/files/cometbft/config/genesis.json +++ b/charts/sequencer/files/cometbft/config/genesis.json @@ -10,8 +10,31 @@ } {{- end }} ], - "authority_sudo_key": "{{ .Values.config.sequencer.sudoAuthorityKey }}", + {{- if not .Values.global.dev }} + "authority_sudo_key": "{{ .Values.config.sequencer.authoritySudoAddress }}", "native_asset_base_denomination": "nria" + {{- else }} + "authority_sudo_address": "{{ .Values.config.sequencer.authoritySudoAddress }}", + "native_asset_base_denomination": "{{ .Values.config.sequencer.nativeAssetBaseDenomination }}", + "allowed_fee_assets": [ + {{- range $index, $value := .Values.config.sequencer.allowedFeeAssets }} + {{- if $index }},{{- end }} + "{{ $value }}" + {{- end }} + ], + "ibc_sudo_address": "{{ .Values.config.sequencer.ibc.sudoAddress }}", + "ibc_relayer_addresses": [ + {{- range $index, $value := .Values.config.sequencer.ibc.relayerAddresses }} + {{- if $index }},{{- end }} + "{{ $value }}" + {{- end }} + ], + "ibc_params": { + "ibc_enabled": {{ .Values.config.sequencer.ibc.enabled }}, + "inbound_ics20_transfers_enabled": {{ .Values.config.sequencer.ibc.inboundEnabled }}, + "outbound_ics20_transfers_enabled": {{ .Values.config.sequencer.ibc.outboundEnabled }} + } + {{- end}} }, "chain_id": "{{ .Values.config.cometBFT.chainId }}", "consensus_params": { diff --git a/charts/sequencer/templates/_helpers.tpl b/charts/sequencer/templates/_helpers.tpl index d3305150..c0dcb1fd 100644 --- a/charts/sequencer/templates/_helpers.tpl +++ b/charts/sequencer/templates/_helpers.tpl @@ -1,3 +1,17 @@ +{{/* +Namepsace to deploy elements into. +*/}} +{{- define "sequencer.namespace" -}} +{{- default .Release.Namespace .Values.global.namespaceOverride | trunc 63 | trimSuffix "-" -}} +{{- end }} + +{{- define "sequencer.image" -}} +{{ .Values.images.sequencer.repo }}:{{ if .Values.global.dev }}{{ .Values.images.sequencer.devTag }}{{ else }}{{ .Values.images.sequencer.tag }}{{ end }} +{{- end }} +{{- define "cometBFT.image" -}} +{{ .Values.images.cometBFT.repo }}:{{ if .Values.global.dev }}{{ .Values.images.cometBFT.devTag }}{{ else }}{{ .Values.images.cometBFT.tag }}{{ end }} +{{- end }} + {{/* Return if ingress is stable. */}} diff --git a/charts/sequencer/templates/configmaps.yaml b/charts/sequencer/templates/configmaps.yaml index cdd4a29f..a899e27a 100644 --- a/charts/sequencer/templates/configmaps.yaml +++ b/charts/sequencer/templates/configmaps.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ .Values.config.moniker }}-cometbft-config - namespace: {{ .Values.global.namespace }} + namespace: {{ include "sequencer.namespace" . }} data: genesis.json: | {{- tpl (.Files.Get "files/cometbft/config/genesis.json") $ | nindent 4 }} @@ -17,7 +17,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ .Values.config.moniker }}-cometbft-data - namespace: {{ .Values.global.namespace }} + namespace: {{ include "sequencer.namespace" . }} data: priv_validator_state.json: | {{- .Files.Get "files/cometbft/data/priv_validator_state.json" | nindent 4 }} @@ -26,7 +26,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ .Values.config.moniker }}-cometbft-env - namespace: {{ .Values.global.namespace }} + namespace: {{ include "sequencer.namespace" . }} data: COMET_BFT_RPC_PORT: "{{ .Values.ports.cometBFTRPC }}" --- @@ -34,7 +34,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ .Values.config.moniker }}-sequencer-env - namespace: {{ .Values.global.namespace }} + namespace: {{ include "sequencer.namespace" . }} data: ASTRIA_SEQUENCER_LOG: "astria_sequencer=debug" ASTRIA_SEQUENCER_LISTEN_ADDR: "127.0.0.1:{{ .Values.ports.sequencerABCI }}" @@ -42,4 +42,18 @@ data: ASTRIA_SEQUENCER_ENABLE_MINT: "false" # Socket address for gRPC server ASTRIA_SEQUENCER_GRPC_ADDR: "127.0.0.1:{{ .Values.ports.sequencerGRPC }}" + {{- if not .Values.global.dev }} + {{- else }} + ASTRIA_SEQUENCER_NO_METRICS: "{{ not .Values.config.sequencer.metrics.enabled }}" + ASTRIA_SEQUENCER_METRICS_HTTP_LISTENER_ADDR: "127.0.0.1:{{ .Values.ports.sequencerMetrics }}" + ASTRIA_SEQUENCER_FORCE_STDOUT: "{{ .Values.global.useTTY }}" + ASTRIA_SEQUENCER_PRETTY_PRINT: "{{ .Values.global.useTTY }}" + ASTRIA_SEQUENCER_NO_OTEL: "{{ not .Values.config.sequencer.otel.enabled }}" + OTEL_EXPORTER_OTLP_ENDPOINT: "{{ .Values.config.sequencer.otel.endpoint }}" + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "{{ .Values.config.sequencer.otel.tracesEndpoint }}" + OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: "{{ .Values.config.sequencer.otel.tracesTimeout }}" + OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: "{{ .Values.config.sequencer.otel.tracesCompression }}" + OTEL_EXPORTER_OTLP_HEADERS: "{{ .Values.config.sequencer.otel.otlpHeaders }}" + OTEL_EXPORTER_OTLP_TRACE_HEADERS: "{{ .Values.config.sequencer.otel.traceHeaders }}" + {{- end }} --- diff --git a/charts/sequencer/templates/ingress.yaml b/charts/sequencer/templates/ingress.yaml index 023f10aa..f6135180 100644 --- a/charts/sequencer/templates/ingress.yaml +++ b/charts/sequencer/templates/ingress.yaml @@ -13,7 +13,7 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $.Values.config.moniker }}-sequencer-{{ $service }}-ingress - namespace: {{ $.Values.global.namespace }} + namespace: {{ include "sequencer.namespace" $ }} labels: {{- with $ingress.labels }} {{- toYaml . | nindent 4 }} diff --git a/charts/sequencer/templates/service.yaml b/charts/sequencer/templates/service.yaml index 212b63e3..c4e5e7f6 100644 --- a/charts/sequencer/templates/service.yaml +++ b/charts/sequencer/templates/service.yaml @@ -2,7 +2,7 @@ kind: Service apiVersion: v1 metadata: name: {{ .Values.config.moniker }}-sequencer-rpc-service - namespace: {{ .Values.global.namespace }} + namespace: {{ include "sequencer.namespace" . }} spec: selector: app: {{ .Values.config.moniker }}-sequencer @@ -15,7 +15,7 @@ kind: Service apiVersion: v1 metadata: name: {{ .Values.config.moniker }}-sequencer-p2p-service - namespace: {{ .Values.global.namespace }} + namespace: {{ include "sequencer.namespace" . }} spec: selector: app: {{ .Values.config.moniker }}-sequencer @@ -34,12 +34,25 @@ spec: type: NodePort {{- end }} --- +kind: Service +apiVersion: v1 +metadata: + name: {{ .Values.config.moniker }}-sequencer-grpc-service + namespace: {{ include "sequencer.namespace" . }} +spec: + selector: + app: {{ .Values.config.moniker }}-sequencer + ports: + - name: sequencer-grpc + port: {{ .Values.ports.sequencerGRPC }} + targetPort: sequencer-grpc +--- {{- if .Values.serviceMonitor.enabled }} kind: Service apiVersion: v1 metadata: name: {{ .Values.config.moniker }}-sequencer-metrics - namespace: {{ .Values.global.namespace }} + namespace: {{ include "sequencer.namespace" . }} spec: selector: app: {{ .Values.config.moniker }}-sequencer @@ -47,4 +60,9 @@ spec: - name: cometbft-metric port: {{ .Values.ports.cometBFTMETRICS }} targetPort: cometbft-metric + {{- if .Values.config.sequencer.metrics.enabled }} + - name: sequencer-metric + port: {{ .Values.ports.sequencerMetrics }} + targetPort: sequencer-metric + {{- end }} {{- end }} diff --git a/charts/sequencer/templates/servicemonitor.yaml b/charts/sequencer/templates/servicemonitor.yaml index f3cff9fc..797c9620 100644 --- a/charts/sequencer/templates/servicemonitor.yaml +++ b/charts/sequencer/templates/servicemonitor.yaml @@ -12,7 +12,7 @@ spec: jobLabel: cometbft-metric namespaceSelector: matchNames: - - {{ .Values.global.namespace }} + - {{ include "sequencer.namespace" . }} selector: matchLabels: {{- include "sequencer.selectorLabels" . | nindent 6 }} @@ -25,4 +25,33 @@ spec: {{- with .Values.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ . }} {{- end }} +--- +{{- if .Values.config.sequencer.metrics.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: sequencer-metrics + labels: + {{- include "sequencer.labels" . | nindent 4 }} + {{- with .Values.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + jobLabel: sequencer-metric + namespaceSelector: + matchNames: + - {{ include "sequencer.namespace" . }} + selector: + matchLabels: + {{- include "sequencer.selectorLabels" . | nindent 6 }} + endpoints: + - port: sequencer-metric + path: / + {{- with .Values.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} +{{- end }} {{- end }} diff --git a/charts/sequencer/templates/statefulsets.yaml b/charts/sequencer/templates/statefulsets.yaml index 2b2c35d7..36db158b 100644 --- a/charts/sequencer/templates/statefulsets.yaml +++ b/charts/sequencer/templates/statefulsets.yaml @@ -4,7 +4,7 @@ metadata: name: sequencer labels: app: {{ .Values.config.moniker }}-sequencer - namespace: {{ .Values.global.namespace }} + namespace: {{ include "sequencer.namespace" . }} spec: replicas: {{ .Values.global.replicaCount }} selector: @@ -33,7 +33,7 @@ spec: containers: - name: sequencer imagePullPolicy: IfNotPresent - image: "{{ .Values.images.sequencer }}" + image: {{ include "sequencer.image" . }} command: [ "/usr/local/bin/astria-sequencer" ] stdin: {{ .Values.global.useTTY }} tty: {{ .Values.global.useTTY }} @@ -47,13 +47,19 @@ spec: ports: - containerPort: {{ .Values.ports.sequencerABCI }} name: sequencer-abci + - containerPort: {{ .Values.ports.sequencerGRPC }} + name: sequencer-grpc + {{- if .Values.config.sequencer.metrics.enabled }} + - containerPort: {{ .Values.ports.sequencerMetrics }} + name: sequencer-metric + {{- end }} - name: cometbft imagePullPolicy: IfNotPresent command: [ "cometbft", "start" ] args: - "--home" - "/cometbft" - image: "{{ .Values.images.cometBFT }}" + image: "{{ include "cometBFT.image" . }}" envFrom: - configMapRef: name: {{ .Values.config.moniker }}-cometbft-env diff --git a/charts/sequencer/templates/volumes.yaml b/charts/sequencer/templates/volumes.yaml index caa8fb67..93e7773c 100644 --- a/charts/sequencer/templates/volumes.yaml +++ b/charts/sequencer/templates/volumes.yaml @@ -32,7 +32,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ $.Values.config.moniker }}-{{ $value.persistentVolumeName }}-pvc - namespace: {{ $.Values.global.namespace }} + namespace: {{ include "sequencer.namespace" $ }} labels: "app.kubernetes.io/name": "{{$.Values.config.moniker}}-{{ $.Chart.Name }}" "app.kubernetes.io/managed-by": {{ $.Release.Service | quote }} diff --git a/charts/sequencer/values.yaml b/charts/sequencer/values.yaml index 1d5f6673..d9df2e2e 100644 --- a/charts/sequencer/values.yaml +++ b/charts/sequencer/values.yaml @@ -2,16 +2,39 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. global: - namespace: "astria-dev-cluster" + namespaceOverride: "" replicaCount: 1 # Whether to use tty readable logging for astria services, when false use json. # Best to be false in production environments, true for clean logs on local dev. useTTY: true + dev: false + +# sequencer core images +images: + cometBFT: + repo: docker.io/cometbft/cometbft + tag: v0.37.x + devTag: v0.37.x + sequencer: + repo: ghcr.io/astriaorg/sequencer + tag: "0.8.0" + devTag: latest config: moniker: "node0" sequencer: - sudoAuthorityKey: 1c0c490f1b5528d8173c5de46d131160e4b2c0c3 + authoritySudoAddress: 1c0c490f1b5528d8173c5de46d131160e4b2c0c3 + nativeAssetBaseDenomination: nria + allowedFeeAssets: + - nria + ibc: + enabled: true + inboundEnabled: true + outboundEnabled: true + sudoAddress: 1c0c490f1b5528d8173c5de46d131160e4b2c0c3 + relayerAddresses: + - 1c0c490f1b5528d8173c5de46d131160e4b2c0c3 + - 34fec43c7fcab9aef3b3cf8aba855e41ee69ca3a # Note large balances must be strings support templating with the u128 size account balances genesisAccounts: - address: 1c0c490f1b5528d8173c5de46d131160e4b2c0c3 @@ -24,6 +47,18 @@ config: - address: 00d75b270542084a54fcf0d0f6eab0402982d156 balance: "340282366920938463463374607431768211455" + metrics: + enabled: false + + otel: + enabled: false + endpoint: + tracesEndpoint: + tracesCompression: gzip + tracesTimeout: 10 + otlpHeaders: + traceHeaders: + # Values for CometBFT node configuration cometBFT: chainId: 'sequencer-test-chain' @@ -72,11 +107,6 @@ config: sequencer-relayer: enabled: false -# sequencer core images -images: - cometBFT: docker.io/cometbft/cometbft:v0.37.x - sequencer: ghcr.io/astriaorg/sequencer:0.8.0 - ports: cometBFTP2P: 26656 cometBFTRPC: 26657 @@ -84,6 +114,7 @@ ports: sequencerABCI: 26658 sequencerGRPC: 8080 relayerRPC: 2450 + sequencerMetrics: 9000 # ServiceMonitor configuration serviceMonitor: diff --git a/justfile b/justfile index 7d585d53..4233e52c 100644 --- a/justfile +++ b/justfile @@ -24,20 +24,19 @@ wait-for-ingress-controller: load-image image: kind load docker-image {{image}} --name astria-dev-cluster -deploy-chart chart: - helm install --debug {{chart}}-chart ./charts/{{chart}} -delete-chart chart: - helm uninstall {{chart}}-chart +defaultNamespace := "astria-dev-cluster" +deploy-chart chart namespace=defaultNamespace: + helm install --debug {{chart}}-chart ./charts/{{chart}} --namespace namespace --create-namespace -redeploy-chart chart: - helm uninstall {{chart}}-chart - helm install --debug {{chart}}-chart ./charts/{{chart}} +delete-chart chart: + helm uninstall {{chart}}-chart --namespace namespace restart deployment: kubectl rollout restart -n astria-dev-cluster deployment {{deployment}} -deploy-astria-local: (deploy-chart "celestia-local") (deploy-sequencer-validators) +deploy-astria-local: (deploy-chart "celestia-local") (deploy-sequencer-validator) +delete-astria-local: (delete-chart "celestia-local") (delete-sequencer-validator) validatorName := "single" deploy-sequencer-validator name=validatorName: @@ -62,22 +61,22 @@ defaultPrivateKey := "" defaultSequencerStartBlock := "" deploy-rollup rollupName=defaultRollupName networkId=defaultNetworkId genesisAllocAddress=defaultGenesisAllocAddress privateKey=defaultPrivateKey sequencerStartBlock=defaultSequencerStartBlock: helm install --debug \ - {{ if rollupName != '' { replace('--set config.rollup.name=# --set config.rollup.chainId=#chain --set celestia-node.config.labelPrefix=#', '#', rollupName) } else { '' } }} \ + {{ if rollupName != '' { replace('--set config.rollup.name=# --set celestia-node.config.labelPrefix=#', '#', rollupName) } else { '' } }} \ {{ if networkId != '' { replace('--set config.rollup.networkId=#', '#', networkId) } else { '' } }} \ {{ if genesisAllocAddress != '' { replace('--set config.rollup.genesisAccounts[0].address=#', '#', genesisAllocAddress) } else { '' } }} \ {{ if privateKey != '' { replace('--set config.faucet.privateKey=#', '#', privateKey) } else { '' } }} \ {{ if sequencerStartBlock != '' { replace('--set config.sequencer.initialBlockHeight=#', '#', sequencerStartBlock) } else { '' } }} \ - {{rollupName}}chain-chart-deploy ./charts/rollup + {{rollupName}}chain-chart-deploy ./charts/rollup --namespace astria-dev-cluster deploy-dev-rollup rollupName=defaultRollupName networkId=defaultNetworkId genesisAllocAddress=defaultGenesisAllocAddress privateKey=defaultPrivateKey sequencerStartBlock=defaultSequencerStartBlock: helm install --debug \ - {{ if rollupName != '' { replace('--set config.rollup.name=# --set config.rollup.chainId=#chain --set celestia-node.config.labelPrefix=#', '#', rollupName) } else { '' } }} \ + {{ if rollupName != '' { replace('--set config.rollup.name=# --set celestia-node.config.labelPrefix=#', '#', rollupName) } else { '' } }} \ {{ if networkId != '' { replace('--set config.rollup.networkId=#', '#', networkId) } else { '' } }} \ {{ if genesisAllocAddress != '' { replace('--set config.rollup.genesisAccounts[0].address=#', '#', genesisAllocAddress) } else { '' } }} \ {{ if privateKey != '' { replace('--set config.faucet.privateKey=#', '#', privateKey) } else { '' } }} \ {{ if sequencerStartBlock != '' { replace('--set config.sequencer.initialBlockHeight=#', '#', sequencerStartBlock) } else { '' } }} \ -f values/rollup/dev.yaml \ - {{rollupName}}chain-chart-deploy ./charts/rollup + {{rollupName}}chain-chart-deploy ./charts/rollup --namespace astria-dev-cluster wait-for-rollup rollupName=defaultRollupName: kubectl wait -n astria-dev-cluster deployment {{rollupName}}-geth --for=condition=Available=True --timeout=600s @@ -85,7 +84,7 @@ wait-for-rollup rollupName=defaultRollupName: defaultRollupNameForDelete := "astria" delete-rollup rollupName=defaultRollupNameForDelete: - helm uninstall {{rollupName}}chain-chart-deploy + helm uninstall {{rollupName}}chain-chart-deploy --namespace astria-dev-cluster deploy-all-local: create-cluster deploy-ingress-controller wait-for-ingress-controller deploy-astria-local wait-for-sequencer (deploy-chart "sequencer-faucet") deploy-rollup wait-for-rollup @@ -98,13 +97,16 @@ deploy-hyperlane-agents rollupName=defaultRollupName agentConfig=defaultHypAgent {{ if agentConfig != '' { replace('--set config.agentConfig=#', '#', agentConfig) } else { '' } }} \ {{ if relayerPrivateKey != '' { replace('--set config.relayer.privateKey=#', '#', relayerPrivateKey) } else { '' } }} \ {{ if validatorPrivateKey != '' { replace('--set config.validator.privateKey=#', '#', validatorPrivateKey) } else { '' } }} \ - {{rollupName}}-hyperlane-agents-chart ./charts/hyperlane-agents + {{rollupName}}-hyperlane-agents-chart ./charts/hyperlane-agents --namespace astria-dev-cluster delete-hyperlane-agents rollupName=defaultRollupNameForDelete: - helm uninstall {{rollupName}}-hyperlane-agents-chart + helm uninstall {{rollupName}}-hyperlane-agents-chart --namespace astria-dev-cluster clean: kind delete cluster --name astria-dev-cluster clean-persisted-data: rm -r /tmp/astria + +deploy-local-metrics: + kubectl apply -f kubernetes/metrics-server-local.yml diff --git a/kubernetes/kind-cluster-config.yml b/kubernetes/kind-cluster-config.yml index a2595f84..33d394e2 100644 --- a/kubernetes/kind-cluster-config.yml +++ b/kubernetes/kind-cluster-config.yml @@ -15,6 +15,8 @@ nodes: containerPath: /data/rollup-data/ - hostPath: /tmp/astria/sequencer-data containerPath: /data/sequencer-data + - hostPath: /tmp/astria/sequencer-relayer-data + containerPath: /data/sequencer-relayer-data kubeadmConfigPatches: - | kind: InitConfiguration @@ -36,3 +38,5 @@ nodes: containerPath: /data/rollup-data/ - hostPath: /tmp/astria/sequencer-data containerPath: /data/sequencer-data + - hostPath: /tmp/astria/sequencer-relayer-data + containerPath: /data/sequencer-relayer-data diff --git a/kubernetes/metrics-server-local.yml b/kubernetes/metrics-server-local.yml new file mode 100644 index 00000000..53200d38 --- /dev/null +++ b/kubernetes/metrics-server-local.yml @@ -0,0 +1,202 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + k8s-app: metrics-server + name: metrics-server + namespace: kube-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + k8s-app: metrics-server + rbac.authorization.k8s.io/aggregate-to-admin: "true" + rbac.authorization.k8s.io/aggregate-to-edit: "true" + rbac.authorization.k8s.io/aggregate-to-view: "true" + name: system:aggregated-metrics-reader +rules: +- apiGroups: + - metrics.k8s.io + resources: + - pods + - nodes + verbs: + - get + - list + - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + k8s-app: metrics-server + name: system:metrics-server +rules: +- apiGroups: + - "" + resources: + - nodes/metrics + verbs: + - get +- apiGroups: + - "" + resources: + - pods + - nodes + verbs: + - get + - list + - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + k8s-app: metrics-server + name: metrics-server-auth-reader + namespace: kube-system +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: extension-apiserver-authentication-reader +subjects: +- kind: ServiceAccount + name: metrics-server + namespace: kube-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + k8s-app: metrics-server + name: metrics-server:system:auth-delegator +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: system:auth-delegator +subjects: +- kind: ServiceAccount + name: metrics-server + namespace: kube-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + k8s-app: metrics-server + name: system:metrics-server +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: system:metrics-server +subjects: +- kind: ServiceAccount + name: metrics-server + namespace: kube-system +--- +apiVersion: v1 +kind: Service +metadata: + labels: + k8s-app: metrics-server + name: metrics-server + namespace: kube-system +spec: + ports: + - name: https + port: 443 + protocol: TCP + targetPort: https + selector: + k8s-app: metrics-server +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + k8s-app: metrics-server + name: metrics-server + namespace: kube-system +spec: + selector: + matchLabels: + k8s-app: metrics-server + strategy: + rollingUpdate: + maxUnavailable: 0 + template: + metadata: + labels: + k8s-app: metrics-server + spec: + containers: + - args: + - --cert-dir=/tmp + - --secure-port=10250 + - --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname + - --kubelet-use-node-status-port + - --metric-resolution=15s + - --kubelet-insecure-tls + image: registry.k8s.io/metrics-server/metrics-server:v0.7.0 + imagePullPolicy: IfNotPresent + livenessProbe: + failureThreshold: 3 + httpGet: + path: /livez + port: https + scheme: HTTPS + periodSeconds: 10 + name: metrics-server + ports: + - containerPort: 10250 + name: https + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: /readyz + port: https + scheme: HTTPS + initialDelaySeconds: 20 + periodSeconds: 10 + resources: + requests: + cpu: 100m + memory: 200Mi + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 1000 + seccompProfile: + type: RuntimeDefault + volumeMounts: + - mountPath: /tmp + name: tmp-dir + nodeSelector: + kubernetes.io/os: linux + priorityClassName: system-cluster-critical + serviceAccountName: metrics-server + volumes: + - emptyDir: {} + name: tmp-dir +--- +apiVersion: apiregistration.k8s.io/v1 +kind: APIService +metadata: + labels: + k8s-app: metrics-server + name: v1beta1.metrics.k8s.io +spec: + group: metrics.k8s.io + groupPriorityMinimum: 100 + insecureSkipTLSVerify: true + service: + name: metrics-server + namespace: kube-system + version: v1beta1 + versionPriority: 100 diff --git a/values/rollup/dev.yaml b/values/rollup/dev.yaml index b7bb392f..e98c08c0 100644 --- a/values/rollup/dev.yaml +++ b/values/rollup/dev.yaml @@ -1,6 +1,11 @@ +global: + useTTY: true + dev: true + config: celestia: rpc: "http://celestia-service.astria-dev-cluster.svc.cluster.local:26658" + ws: "ws://celestia-service.astria-dev-cluster.svc.cluster.local:26658" token: "http://celestia-service.astria-dev-cluster.svc.cluster.local:5353" celestia-node: diff --git a/values/validators/node0.yml b/values/validators/node0.yml index bcc822af..4dd7a111 100644 --- a/values/validators/node0.yml +++ b/values/validators/node0.yml @@ -1,6 +1,10 @@ # Override value example for second validator from main chart +global: + namespaceOverride: astria-dev-cluster + dev: true + config: - moniker: 'node0' + moniker: node0 # Values for CometBFT node configuration cometBFT: diff --git a/values/validators/node1.yml b/values/validators/node1.yml index 07941ace..ce0d5530 100644 --- a/values/validators/node1.yml +++ b/values/validators/node1.yml @@ -1,6 +1,6 @@ # Override value example for second validator from main chart global: - namespace: astria-validator-node1 + dev: true config: moniker: 'node1' diff --git a/values/validators/node2.yml b/values/validators/node2.yml index e6cd562f..140727d1 100644 --- a/values/validators/node2.yml +++ b/values/validators/node2.yml @@ -1,6 +1,6 @@ # Override value example for second validator from main chart global: - namespace: astria-validator-node2 + dev: true config: moniker: 'node2' diff --git a/values/validators/single.yml b/values/validators/single.yml index e1c155b5..fb5d72c9 100644 --- a/values/validators/single.yml +++ b/values/validators/single.yml @@ -1,6 +1,13 @@ +global: + namespaceOverride: astria-dev-cluster + dev: true + sequencer-relayer: enabled: true config: relayer: celestiaRpc: http://celestia-service.astria-dev-cluster.svc.cluster.local:26658 sequencerRpc: http://node0-sequencer-rpc-service.astria-dev-cluster.svc.cluster.local:26657 + + storage: + enabled: false