diff --git a/charts/timeboost/.helmignore b/charts/timeboost/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/timeboost/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/timeboost/Chart.yaml b/charts/timeboost/Chart.yaml new file mode 100644 index 0000000..f2c6f41 --- /dev/null +++ b/charts/timeboost/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: timeboost +description: A Helm chart for Arbitrum Timeboost components + +maintainers: + - name: OffchainLabs + +type: application + +version: 0.2.0 + +appVersion: "express-lane-timeboost-cee611d" diff --git a/charts/timeboost/LICENSE b/charts/timeboost/LICENSE new file mode 100644 index 0000000..0aa6bf8 --- /dev/null +++ b/charts/timeboost/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2023 Offchain Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/charts/timeboost/README.md b/charts/timeboost/README.md new file mode 100644 index 0000000..5164bc2 --- /dev/null +++ b/charts/timeboost/README.md @@ -0,0 +1,248 @@ +# Arbitrum Timeboost + +A Helm chart for [Timeboost](https://forum.arbitrum.foundation/t/constitutional-aip-proposal-to-adopt-timeboost-a-new-transaction-ordering-policy/25167). + +## Parameters + +### Global Image Configuration + +| Name | Description | Value | +| ------------------ | --------------------------------------------------------- | ------------------------- | +| `image.repository` | Docker image repository | `offchainlabs/nitro-node` | +| `image.pullPolicy` | Docker image pull policy | `Always` | +| `image.tag` | Docker image tag. Defaults to Chart appVersion if not set | `""` | + +### Auctioneer Deployment Options + +| Name | Description | Value | +| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- | --------------------------- | +| `auctioneer.replicaCount` | Number of replicas to deploy | `1` | +| `auctioneer.image.repository` | Docker image repository override | `""` | +| `auctioneer.image.pullPolicy` | Docker image pull policy override | `""` | +| `auctioneer.image.tag` | Docker image tag. Overrides the chart appVersion. | `""` | +| `auctioneer.imagePullSecrets` | Docker registry pull secret names as an array | `[]` | +| `auctioneer.nameOverride` | String to partially override timeboost.fullname | `""` | +| `auctioneer.fullnameOverride` | String to fully override timeboost.fullname | `""` | +| `auctioneer.commandOverride` | Command override for the nitro container | `{}` | +| `auctioneer.livenessProbe` | Liveness probe configuration | `{}` | +| `auctioneer.readinessProbe` | Readiness probe configuration | `{}` | +| `auctioneer.startupProbe.enabled` | Enable built in startup probe | `false` | +| `auctioneer.startupProbe.failureThreshold` | Number of failures before pod is considered unhealthy | `2419200` | +| `auctioneer.startupProbe.periodSeconds` | Number of seconds between startup probes | `1` | +| `auctioneer.startupProbe.command` | Command to run for the startup probe. If empty, the built in probe will be used | `""` | +| `auctioneer.updateStrategy.type` | Update strategy type | `RollingUpdate` | +| `auctioneer.persistence.enabled` | Enable persistence | `true` | +| `auctioneer.persistence.size` | Size of the persistent volume claim | `1Gi` | +| `auctioneer.persistence.storageClassName` | Storage class of the persistent volume claim | `nil` | +| `auctioneer.persistence.accessModes` | Access modes of the persistent volume claim | `["ReadWriteOnce"]` | +| `auctioneer.serviceMonitor.enabled` | Enable service monitor CRD for prometheus operator | `false` | +| `auctioneer.serviceMonitor.portName` | Name of the port to monitor | `metrics` | +| `auctioneer.serviceMonitor.path` | Path to monitor | `/debug/metrics/prometheus` | +| `auctioneer.serviceMonitor.interval` | Interval to monitor | `5s` | +| `auctioneer.serviceMonitor.additionalLabels` | Additional labels for the service monitor | `{}` | +| `auctioneer.serviceMonitor.relabelings` | Add relabelings for the metrics being scraped | `[]` | +| `auctioneer.serviceAccount.create` | Create a service account | `true` | +| `auctioneer.serviceAccount.annotations` | Annotations for the service account | `{}` | +| `auctioneer.serviceAccount.name` | Name of the service account | `""` | +| `auctioneer.jwtSecret.enabled` | Enable a jwt secret | `false` | +| `auctioneer.jwtSecret.value` | Value of the jwt secret | `""` | +| `auctioneer.podAnnotations` | Annotations for the pod | `{}` | +| `auctioneer.podLabels` | Labels for the pod | `{}` | +| `auctioneer.podSecurityContext.fsGroup` | Group id for the pod | `1000` | +| `auctioneer.podSecurityContext.runAsGroup` | Group id for the user | `1000` | +| `auctioneer.podSecurityContext.runAsNonRoot` | Run as non root | `true` | +| `auctioneer.podSecurityContext.runAsUser` | User id for the user | `1000` | +| `auctioneer.podSecurityContext.fsGroupChangePolicy` | Policy for the fs group | `OnRootMismatch` | +| `auctioneer.securityContext` | Security context for the container | `{}` | +| `auctioneer.priorityClassName` | Priority class name | `""` | +| `auctioneer.service.type` | Service type | `ClusterIP` | +| `auctioneer.service.publishNotReadyAddresses` | Publish not ready addresses | `false` | +| `auctioneer.resources` | Resources for the container | `{}` | +| `auctioneer.nodeSelector` | Node selector for the pod | `{}` | +| `auctioneer.tolerations` | Tolerations for the pod | `[]` | +| `auctioneer.affinity` | Affinity for the pod | `{}` | +| `auctioneer.additionalVolumeClaims` | Additional volume claims for the pod | `[]` | +| `auctioneer.extraVolumes` | Additional volumes for the pod | `[]` | +| `auctioneer.extraVolumeMounts` | Additional volume mounts for the pod | `[]` | +| `auctioneer.extraPorts` | Additional ports for the pod | `[]` | +| `auctioneer.wallet.mountPath` | Path to mount the wallets | `/wallet/` | +| `auctioneer.wallet.files` | Key value pair of wallet name and contents (ethers json format) | `{}` | +| `auctioneer.configmap.enabled` | Enable a configmap for the nitro container | `true` | +| `configmap.data` | See Configuration Options for the full list of options | | +| `auctioneer.configmap.data.auctioneer-server.auction-contract-address` | Auction contract address | `""` | +| `auctioneer.configmap.data.auctioneer-server.db-directory` | Database storage directory | `/data` | +| `auctioneer.configmap.data.auctioneer-server.redis-url` | Redis URL | `redis://redis:6379` | +| `auctioneer.configmap.data.auctioneer-server.sequencer-endpoint` | Sequencer endpoint | `ws://sequencer:8549` | +| `auctioneer.configmap.data.auctioneer-server.sequencer-jwt-path` | Path to seqeuncer JWT | `/config/jwt.hex` | +| `auctioneer.configmap.data.auctioneer-server.wallet.account` | Wallet account | `""` | +| `auctioneer.configmap.data.auctioneer-server.wallet.password` | Wallet password | `""` | +| `auctioneer.configmap.data.auctioneer-server.wallet.pathname` | Path to wallet | `""` | +| `auctioneer.configmap.data.bid-validator.enable` | Enable bid validator | `false` | +| `auctioneer.configmap.data.log-type` | Type of log | `json` | +| `auctioneer.configmap.data.metrics` | Enable metrics | `false` | +| `auctioneer.configmap.data.metrics-server.addr` | Address to bind metrics server to | `0.0.0.0` | +| `auctioneer.configmap.data.metrics-server.port` | Port to bind metrics server to | `6070` | +| `auctioneer.configmap.data.persistent.auctioneer` | Path to persistent auction data | `/home/user/data/` | + +### Bid Validator Deployment Options + +| Name | Description | Value | +| -------------------------------------------------------------------- | ------------------------------------------------------------------------------- | --------------------------- | +| `bidValidator.replicaCount` | Number of replicas to deploy | `1` | +| `bidValidator.image.repository` | Docker image repository override | `""` | +| `bidValidator.image.pullPolicy` | Docker image pull policy override | `""` | +| `bidValidator.image.tag` | Docker image tag. Overrides the chart appVersion. | `""` | +| `bidValidator.imagePullSecrets` | Docker registry pull secret names as an array | `[]` | +| `bidValidator.nameOverride` | String to partially override timeboost.fullname | `""` | +| `bidValidator.fullnameOverride` | String to fully override timeboost.fullname | `""` | +| `bidValidator.commandOverride` | Command override for the nitro container | `{}` | +| `bidValidator.livenessProbe` | Liveness probe configuration | `{}` | +| `bidValidator.readinessProbe` | Readiness probe configuration | `{}` | +| `bidValidator.startupProbe.enabled` | Enable built in startup probe | `false` | +| `bidValidator.startupProbe.failureThreshold` | Number of failures before pod is considered unhealthy | `2419200` | +| `bidValidator.startupProbe.periodSeconds` | Number of seconds between startup probes | `1` | +| `bidValidator.startupProbe.command` | Command to run for the startup probe. If empty, the built in probe will be used | `""` | +| `bidValidator.serviceMonitor.enabled` | Enable service monitor CRD for prometheus operator | `false` | +| `bidValidator.serviceMonitor.portName` | Name of the port to monitor | `metrics` | +| `bidValidator.serviceMonitor.path` | Path to monitor | `/debug/metrics/prometheus` | +| `bidValidator.serviceMonitor.interval` | Interval to monitor | `5s` | +| `bidValidator.serviceMonitor.additionalLabels` | Additional labels for the service monitor | `{}` | +| `bidValidator.serviceMonitor.relabelings` | Add relabelings for the metrics being scraped | `[]` | +| `bidValidator.serviceAccount.create` | Create a service account | `true` | +| `bidValidator.serviceAccount.annotations` | Annotations for the service account | `{}` | +| `bidValidator.serviceAccount.name` | Name of the service account | `""` | +| `bidValidator.podAnnotations` | Annotations for the pod | `{}` | +| `bidValidator.podLabels` | Labels for the pod | `{}` | +| `bidValidator.podSecurityContext.fsGroup` | Group id for the pod | `1000` | +| `bidValidator.podSecurityContext.runAsGroup` | Group id for the user | `1000` | +| `bidValidator.podSecurityContext.runAsNonRoot` | Run as non root | `true` | +| `bidValidator.podSecurityContext.runAsUser` | User id for the user | `1000` | +| `bidValidator.podSecurityContext.fsGroupChangePolicy` | Policy for the fs group | `OnRootMismatch` | +| `bidValidator.securityContext` | Security context for the container | `{}` | +| `bidValidator.priorityClassName` | Priority class name | `""` | +| `bidValidator.service.type` | Service type | `ClusterIP` | +| `bidValidator.service.publishNotReadyAddresses` | Publish not ready addresses | `false` | +| `bidValidator.resources` | Resources for the container | `{}` | +| `bidValidator.nodeSelector` | Node selector for the pod | `{}` | +| `bidValidator.tolerations` | Tolerations for the pod | `[]` | +| `bidValidator.affinity` | Affinity for the pod | `{}` | +| `bidValidator.additionalVolumeClaims` | Additional volume claims for the pod | `[]` | +| `bidValidator.extraVolumes` | Additional volumes for the pod | `[]` | +| `bidValidator.extraVolumeMounts` | Additional volume mounts for the pod | `[]` | +| `bidValidator.extraPorts` | Additional ports for the pod | `[]` | +| `bidValidator.configmap.enabled` | Enable a configmap for the nitro container | `true` | +| `configmap.data` | See Configuration Options for the full list of options | | +| `bidValidator.configmap.data.http.addr` | Address to bind http service to | `0.0.0.0` | +| `bidValidator.configmap.data.http.api` | List of apis to enable | `["auctioneer"]` | +| `bidValidator.configmap.data.http.corsdomain` | CORS domain | `*` | +| `bidValidator.configmap.data.http.port` | Port to bind http service to | `8547` | +| `bidValidator.configmap.data.http.rpcprefix` | Prefix for rpc calls | `/rpc` | +| `bidValidator.configmap.data.http.vhosts` | Vhosts to allow | `*` | +| `bidValidator.configmap.data.auctioneer-server.enable` | Enable Auctioneer Server | `false` | +| `bidValidator.configmap.data.bid-validator.auction-contract-address` | Auction contract address | `""` | +| `bidValidator.configmap.data.bid-validator.redis-url` | Redis URL | `redis://redis:6379` | +| `bidValidator.configmap.data.bid-validator.sequencer-endpoint` | Sequencer endpoint | `http://sequencer:8547` | +| `bidValidator.configmap.data.log-type` | Type of log | `json` | +| `bidValidator.configmap.data.metrics` | Enable metrics | `false` | +| `bidValidator.configmap.data.metrics-server.addr` | Address to bind metrics server to | `0.0.0.0` | +| `bidValidator.configmap.data.metrics-server.port` | Port to bind metrics server to | `6070` | + +## Configuration Options +The following table lists the exhaustive configurable parameters that can be applied as part of the configmap (nested under `configmap.data`) or as standalone cli flags. + +Option | Description | Default +-----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------- +`auctioneer-server.auction-contract-address` | string express lane auction contract address | None +`auctioneer-server.auction-resolution-wait-time` | duration wait time after auction closing before resolving the auction | `2s` +`auctioneer-server.consumer-config.idletime-to-autoclaim` | duration After a message spends this amount of time in PEL (Pending Entries List i.e claimed by another consumer but not Acknowledged) it will be allowed to be autoclaimed by other consumers | `5m0s` +`auctioneer-server.consumer-config.response-entry-timeout` | duration timeout for response entry | `1h0m0s` +`auctioneer-server.db-directory` | string path to database directory for persisting validated bids in a sqlite file | None +`auctioneer-server.enable` | enable auctioneer server | `true` +`auctioneer-server.redis-url` | string url of redis server | None +`auctioneer-server.sequencer-endpoint` | string sequencer RPC endpoint | None +`auctioneer-server.sequencer-jwt-path` | string sequencer jwt file path | None +`auctioneer-server.stream-timeout` | duration Timeout on polling for existence of redis streams | `10m0s` +`auctioneer-server.wallet.account` | string account to use | `is first account in keystore` +`auctioneer-server.wallet.only-create-key` | if true, creates new key then exits | None +`auctioneer-server.wallet.password` | string wallet passphrase | `PASSWORD_NOT_SET` +`auctioneer-server.wallet.pathname` | string pathname for wallet | `wallet for auctioneer server` +`auctioneer-server.wallet.private-key` | string private key for wallet | None +`bid-validator.auction-contract-address` | string express lane auction contract address | None +`bid-validator.enable` | enable bid validator | `true` +`bid-validator.producer-config.check-result-interval` | duration interval in which producer checks pending messages whether consumer processing them is inactive | `5s` +`bid-validator.producer-config.request-timeout` | duration timeout after which the message in redis stream is considered as errored, this prevents workers from working on wrong requests indefinitely | `3h0m0s` +`bid-validator.redis-url` | string url of redis server | None +`bid-validator.sequencer-endpoint` | string sequencer RPC endpoint | None +`conf.dump` | print out currently active configuration file | None +`conf.env-prefix` | string environment variables with given prefix will be loaded as configuration values | None +`conf.file` | strings name of configuration file | None +`conf.reload-interval` | duration how often to reload configuration (0=disable periodic reloading) | None +`conf.s3.access-key` | string S3 access key | None +`conf.s3.bucket` | string S3 bucket | None +`conf.s3.object-key` | string S3 object key | None +`conf.s3.region` | string S3 region | None +`conf.s3.secret-key` | string S3 secret key | None +`conf.string` | string configuration as JSON string | None +`file-logging.buf-size` | int size of intermediate log records buffer | `512` +`file-logging.compress` | enable compression of old log files | `true` +`file-logging.enable` | enable logging to file | `true` +`file-logging.file` | string path to log file | `nitro.log` +`file-logging.local-time` | if true: local time will be used in old log filename timestamps | None +`file-logging.max-age` | int maximum number of days to retain old log files based on the timestamp encoded in their filename (0 = no limit) | None +`file-logging.max-backups` | int maximum number of old log files to retain (0 = no limit) | `20` +`file-logging.max-size` | int log file size in Mb that will trigger log file rotation (0 = trigger disabled) | `5` +`http.addr` | string HTTP-RPC server listening interface | None +`http.api` | strings APIs offered over the HTTP-RPC interface | `[net,web3,eth,arb]` +`http.corsdomain` | strings Comma separated list of domains from which to accept cross origin requests (browser enforced) | None +`http.port` | int HTTP-RPC server listening port | `8547` +`http.rpcprefix` | string HTTP path path prefix on which JSON-RPC is served. Use '/' to serve on all paths | None +`http.server-timeouts.idle-timeout` | duration the maximum amount of time to wait for the next request when keep-alives are enabled (http.Server.IdleTimeout) | `2m0s` +`http.server-timeouts.read-header-timeout` | duration the amount of time allowed to read the request headers (http.Server.ReadHeaderTimeout) | `30s` +`http.server-timeouts.read-timeout` | duration the maximum duration for reading the entire request (http.Server.ReadTimeout) | `30s` +`http.server-timeouts.write-timeout` | duration the maximum duration before timing out writes of the response (http.Server.WriteTimeout) | `30s` +`http.vhosts` | strings Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard | `[localhost]` +`ipc.path` | string Requested location to place the IPC endpoint. An empty path disables IPC. | None +`log-level` | string log level, valid values are CRIT, ERROR, WARN, INFO, DEBUG, TRACE | `INFO` +`log-type` | string log type (plaintext or json) | `plaintext` +`metrics` | enable metrics | None +`metrics-server.addr` | string metrics server address | `127.0.0.1` +`metrics-server.port` | int metrics server port | `6070` +`metrics-server.update-interval` | duration metrics server update interval | `3s` +`persistent.ancient` | string directory of ancient where the chain freezer can be opened | None +`persistent.chain` | string directory to store chain state | None +`persistent.db-engine` | string backing database implementation to use. If set to empty string the database type will be autodetected and if no pre-existing database is found it will default to creating new pebble database ('leveldb', 'pebble' or '' = auto-detect) | None +`persistent.global-config` | string directory to store global config | `.arbitrum` +`persistent.handles` | int number of file descriptor handles to use for the database | `512` +`persistent.log-dir` | string directory to store log file | None +`persistent.pebble.experimental.block-size` | int target uncompressed size in bytes of each table block | `4096` +`persistent.pebble.experimental.bytes-per-sync` | int number of bytes to write to a SSTable before calling Sync on it in the background | `524288` +`persistent.pebble.experimental.compaction-debt-concurrency` | uint controls the threshold of compaction debt at which additional compaction concurrency slots are added. For every multiple of this value in compaction debt bytes, an additional concurrent compaction is added. This works "on top" of l0-compaction-concurrency, so the higher of the count of compaction concurrency slots as determined by the two options is chosen. | `1073741824` +`persistent.pebble.experimental.disable-automatic-compactions` | disables automatic compactions | None +`persistent.pebble.experimental.force-writer-parallelism` | force parallelism in the sstable Writer for the metamorphic tests. Even with the MaxWriterConcurrency option set, pebble only enables parallelism in the sstable Writer if there is enough CPU available, and this option bypasses that. | None +`persistent.pebble.experimental.index-block-size` | int target uncompressed size in bytes of each index block. When the index block size is larger than this target, two-level indexes are automatically enabled. Setting this option to a large value (such as 2147483647) disables the automatic creation of two-level indexes. | `4096` +`persistent.pebble.experimental.l-base-max-bytes` | int The maximum number of bytes for LBase. The base level is the level which L0 is compacted into. The base level is determined dynamically based on the existing data in the LSM. The maximum number of bytes for other levels is computed dynamically based on the base level's maximum size. When the maximum number of bytes for a level is exceeded, compaction is requested. | `67108864` +`persistent.pebble.experimental.l0-compaction-concurrency` | int threshold of L0 read-amplification at which compaction concurrency is enabled (if compaction-debt-concurrency was not already exceeded). Every multiple of this value enables another concurrent compaction up to max-concurrent-compactions. | `10` +`persistent.pebble.experimental.l0-compaction-file-threshold` | int count of L0 files necessary to trigger an L0 compaction | `500` +`persistent.pebble.experimental.l0-compaction-threshold` | int amount of L0 read-amplification necessary to trigger an L0 compaction | `4` +`persistent.pebble.experimental.l0-stop-writes-threshold` | int hard limit on L0 read-amplification, computed as the number of L0 sublevels. Writes are stopped when this threshold is reached | `12` +`persistent.pebble.experimental.max-writer-concurrency` | int maximum number of compression workers the compression queue is allowed to use. If max-writer-concurrency > 0, then the Writer will use parallelism, to compress and write blocks to disk. Otherwise, the writer will compress and write blocks to disk synchronously. | None +`persistent.pebble.experimental.mem-table-stop-writes-threshold` | int hard limit on the number of queued of MemTables | `2` +`persistent.pebble.experimental.read-compaction-rate` | AllowedSeeks controls the frequency of read triggered compactions by adjusting AllowedSeeks in manifest.FileMetadata: AllowedSeeks = FileSize / ReadCompactionRate | `16000` +`persistent.pebble.experimental.read-sampling-multiplier` | int a multiplier for the readSamplingPeriod in iterator.maybeSampleRead() to control the frequency of read sampling to trigger a read triggered compaction. A value of -1 prevents sampling and disables read triggered compactions. Geth default is -1. The pebble default is 1 << 4. which gets multiplied with a constant of 1 << 16 to yield 1 << 20 (1MB). | `-1` +`persistent.pebble.experimental.target-byte-deletion-rate` | int rate (in bytes per second) at which sstable file deletions are limited to (under normal circumstances). | None +`persistent.pebble.experimental.target-file-size` | int target file size for the level 0 | `2097152` +`persistent.pebble.experimental.target-file-size-equal-levels` | if true same target-file-size will be uses for all levels, otherwise target size for layer n = 2 * target size for layer n - 1 | `true` +`persistent.pebble.experimental.wal-bytes-per-sync` | int number of bytes to write to a write-ahead log (WAL) before calling Sync on it in the background | None +`persistent.pebble.experimental.wal-dir` | string absolute path of directory to store write-ahead logs (WALs) in. If empty, WALs will be stored in the same directory as sstables | None +`persistent.pebble.experimental.wal-min-sync-interval` | int minimum duration in microseconds between syncs of the WAL. If WAL syncs are requested faster than this interval, they will be artificially delayed. | None +`persistent.pebble.max-concurrent-compactions` | int maximum number of concurrent compactions | `10` +`pprof` | enable pprof | None +`pprof-cfg.addr` | string pprof server address | `127.0.0.1` +`pprof-cfg.port` | int pprof server port | `6071` +`ws.addr` | string WS-RPC server listening interface | None +`ws.api` | strings APIs offered over the WS-RPC interface | `[net,web3,eth,arb]` +`ws.expose-all` | expose private api via websocket | None +`ws.origins` | strings Origins from which to accept websockets requests | None +`ws.port` | int WS-RPC server listening port | `8548` +`ws.rpcprefix` | string WS path path prefix on which JSON-RPC is served. Use '/' to serve on all paths | None + diff --git a/charts/timeboost/templates/_helpers.tpl b/charts/timeboost/templates/_helpers.tpl new file mode 100644 index 0000000..61fbaa8 --- /dev/null +++ b/charts/timeboost/templates/_helpers.tpl @@ -0,0 +1,41 @@ +{{/* Get the image repository */}} +{{- define "timeboost.image.repository" -}} +{{- $component := .component -}} +{{- if and $component.image (not (empty $component.image)) $component.image.repository -}} +{{- $component.image.repository -}} +{{- else -}} +{{- .root.Values.image.repository -}} +{{- end -}} +{{- end -}} + +{{/* Get the image pullPolicy */}} +{{- define "timeboost.image.pullPolicy" -}} +{{- $component := .component -}} +{{- if and $component.image (not (empty $component.image)) $component.image.pullPolicy -}} +{{- $component.image.pullPolicy -}} +{{- else -}} +{{- .root.Values.image.pullPolicy -}} +{{- end -}} +{{- end -}} + +{{/* Get the image tag */}} +{{- define "timeboost.image.tag" -}} +{{- $component := .component -}} +{{- if and $component.image (not (empty $component.image)) $component.image.tag -}} +{{- $component.image.tag -}} +{{- else if .root.Values.image.tag -}} +{{- .root.Values.image.tag -}} +{{- else -}} +{{- .root.Chart.AppVersion -}} +{{- end -}} +{{- end -}} + +{{/* Get the image pull secrets */}} +{{- define "timeboost.imagePullSecrets" -}} +{{- $component := .component -}} +{{- if and $component.imagePullSecrets (not (empty $component.imagePullSecrets)) -}} +{{- toYaml $component.imagePullSecrets -}} +{{- else -}} +{{- toYaml .root.Values.image.pullSecrets -}} +{{- end -}} +{{- end -}} diff --git a/charts/timeboost/templates/auctioneer/_helpers.tpl b/charts/timeboost/templates/auctioneer/_helpers.tpl new file mode 100644 index 0000000..9553fc4 --- /dev/null +++ b/charts/timeboost/templates/auctioneer/_helpers.tpl @@ -0,0 +1,97 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "timeboost.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "timeboost.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "timeboost.chart" -}} +{{- printf "%s" .Chart.Name | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels Auctioneer +*/}} +{{- define "timeboost.auctioneer.labels" -}} +helm.sh/chart: {{ include "timeboost.chart" . }} +{{ include "timeboost.auctioneer.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels Auctioneer +*/}} +{{- define "timeboost.auctioneer.selectorLabels" -}} +app.kubernetes.io/name: {{ include "timeboost.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{- define "startupProbe" -}} +{{- if .Values.startupProbe.command }} +{{ .Values.startupProbe.command }} +{{- else }} +curl "http://localhost:{{ .Values.configmap.data.http.port }}{{ .Values.configmap.data.http.rpcprefix }}" -H "Content-Type: application/json" \ + -sd "{\"jsonrpc\":\"2.0\",\"id\":0,\"method\":\"eth_syncing\",\"params\":[]}" \ + | jq -ne "input.result == false" +{{- end }} +{{- end -}} + +{{/* +auctioneer args +*/}} +{{- define "timeboost.auctioneer.customArgs" -}} + +{{- $auctioneerCustomArgs := list -}} +{{- range $k, $v := .Values.auctioneer.auctioneerCustomArgs -}} + {{- $auctioneerCustomArgs = concat $auctioneerCustomArgs (list (printf "--%s" $v)) -}} +{{- end -}} + +{{- $auctioneerCustomArgs | compact | toStrings | toYaml -}} + +{{- end -}} + +{{- define "timeboost.initContainers" -}} +{{- end }} + +{{- define "timeboost.sidecars" -}} +{{- end }} + +{{/* +Process config data +*/}} +{{- define "timeboost.auctioneer.configProcessor" -}} + +{{- /* Make a deep copy of the values from the Helm chart */ -}} +{{- $values := deepCopy .Values -}} + +{{- /* Process the final configmap data into pretty JSON format */ -}} +{{- $processed := $values.auctioneer.configmap.data | toPrettyJson | replace "\\u0026" "&" | replace "\\u003c" "<" | replace "\\u003e" ">" -}} + +{{- /* Return the processed JSON data */ -}} +{{- $processed -}} + +{{- end -}} diff --git a/charts/timeboost/templates/auctioneer/configmap.yaml b/charts/timeboost/templates/auctioneer/configmap.yaml new file mode 100644 index 0000000..9894d89 --- /dev/null +++ b/charts/timeboost/templates/auctioneer/configmap.yaml @@ -0,0 +1,11 @@ +{{- if .Values.auctioneer.configmap.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "timeboost.fullname" . }}-auctioneer + labels: + {{- include "timeboost.auctioneer.labels" . | nindent 4 }} +data: + config.json: | + {{- include "timeboost.auctioneer.configProcessor" . | nindent 4 }} +{{- end }} diff --git a/charts/timeboost/templates/auctioneer/jwtsecret.yaml b/charts/timeboost/templates/auctioneer/jwtsecret.yaml new file mode 100644 index 0000000..48e5448 --- /dev/null +++ b/charts/timeboost/templates/auctioneer/jwtsecret.yaml @@ -0,0 +1,10 @@ +{{- if .Values.auctioneer.jwtSecret.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "timeboost.fullname" . }}-jwt + labels: + {{- include "timeboost.auctioneer.labels" . | nindent 4 }} +data: + jwtSecret: {{ .Values.auctioneer.jwtSecret.value | b64enc | quote }} +{{- end }} \ No newline at end of file diff --git a/charts/timeboost/templates/auctioneer/service.yaml b/charts/timeboost/templates/auctioneer/service.yaml new file mode 100644 index 0000000..f1fb7db --- /dev/null +++ b/charts/timeboost/templates/auctioneer/service.yaml @@ -0,0 +1,40 @@ +{{- $hasPorts := false }} +{{- if .Values.auctioneer.configmap.data.metrics }} + {{- $hasPorts = true }} +{{- end }} +{{- range .Values.auctioneer.extraPorts }} + {{- if .serviceEnabled | default true }} + {{- $hasPorts = true }} + {{- end }} +{{- end }} + +{{- if $hasPorts }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "timeboost.fullname" . }}-auctioneer + labels: + {{- include "timeboost.auctioneer.labels" . | nindent 4 }} + function: nitro-svc +spec: + type: {{ .Values.auctioneer.service.type }} + ports: + {{- if .Values.auctioneer.configmap.data.metrics }} + - port: {{ index .Values.auctioneer "configmap" "data" "metrics-server" "port" }} + targetPort: metrics + protocol: TCP + name: metrics + {{- end }} + {{- range .Values.auctioneer.extraPorts }} + {{- if .serviceEnabled | default true }} + - name: {{ .name }} + port: {{ .servicePort | default .port }} + targetPort: {{ .port }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} + {{- end }} + selector: + {{- include "timeboost.auctioneer.selectorLabels" . | nindent 4 }} + function: nitro + publishNotReadyAddresses: {{ .Values.auctioneer.service.publishNotReadyAddresses }} +{{- end }} diff --git a/charts/timeboost/templates/auctioneer/serviceaccount.yaml b/charts/timeboost/templates/auctioneer/serviceaccount.yaml new file mode 100644 index 0000000..666170a --- /dev/null +++ b/charts/timeboost/templates/auctioneer/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.auctioneer.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "timeboost.fullname" . }}-auctioneer + labels: + {{- include "timeboost.auctioneer.labels" . | nindent 4 }} + {{- with .Values.auctioneer.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/timeboost/templates/auctioneer/servicemonitor.yaml b/charts/timeboost/templates/auctioneer/servicemonitor.yaml new file mode 100644 index 0000000..0e7fddc --- /dev/null +++ b/charts/timeboost/templates/auctioneer/servicemonitor.yaml @@ -0,0 +1,40 @@ +{{- if .Values.auctioneer.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "timeboost.fullname" . }}-auctioneer + labels: + {{- include "timeboost.auctioneer.labels" . | nindent 4 }} + {{- if .Values.auctioneer.serviceMonitor.additionalLabels }} + {{- toYaml .Values.auctioneer.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + - port: {{ .Values.auctioneer.serviceMonitor.portName | default "http" }} + {{- if .Values.auctioneer.serviceMonitor.interval }} + interval: {{ .Values.auctioneer.serviceMonitor.interval }} + {{- end }} + {{- if .Values.auctioneer.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.auctioneer.serviceMonitor.scrapeTimeout }} + {{- end }} + {{- if .Values.auctioneer.serviceMonitor.path }} + path: {{ .Values.auctioneer.serviceMonitor.path }} + {{- end }} + {{- if .Values.auctioneer.serviceMonitor.scheme }} + scheme: {{ .Values.auctioneer.serviceMonitor.scheme }} + {{- end }} + {{- if .Values.auctioneer.serviceMonitor.tlsConfig }} + tlsConfig: + {{- toYaml .Values.auctioneer.serviceMonitor.tlsConfig | nindent 8 }} + {{- end }} + {{- with .Values.auctioneer.serviceMonitor.relabelings }} + relabelings: {{- toYaml . | nindent 8 }} + {{- end }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + {{- include "timeboost.auctioneer.selectorLabels" . | nindent 6 }} + function: timeboost-svc +{{- end }} diff --git a/charts/timeboost/templates/auctioneer/statefulset.yaml b/charts/timeboost/templates/auctioneer/statefulset.yaml new file mode 100644 index 0000000..11fb717 --- /dev/null +++ b/charts/timeboost/templates/auctioneer/statefulset.yaml @@ -0,0 +1,231 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "timeboost.fullname" . }}-auctioneer + labels: + {{- include "timeboost.auctioneer.labels" . | nindent 4 }} + annotations: + timeboost.arbitrum.io/desiredReplicas: {{ $.Values.auctioneer.replicaCount | quote }} +spec: + serviceName: "{{ printf "%s-auctioneer" (include "timeboost.fullname" .) }}-auctioneer" + replicas: {{ .Values.auctioneer.replicaCount }} + selector: + matchLabels: + {{- include "timeboost.auctioneer.selectorLabels" . | nindent 6 }} + podManagementPolicy: Parallel + {{- if .Values.auctioneer.updateStrategy }} + {{- with .Values.auctioneer.updateStrategy }} + updateStrategy: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- end }} + template: + metadata: + annotations: + checksum/configmap: {{ include (print $.Template.BasePath "/auctioneer/configmap.yaml") . | sha256sum }} + {{- if .Values.auctioneer.wallet.files }} + checksum/wallets: {{ include (print $.Template.BasePath "/auctioneer/wallets.yaml") . | sha256sum }} + {{- end }} + {{- with .Values.auctioneer.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "timeboost.auctioneer.selectorLabels" . | nindent 8 }} + function: nitro + {{- with .Values.auctioneer.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.image.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "timeboost.fullname" . }}-auctioneer + securityContext: + {{- with .Values.auctioneer.podSecurityContext }} + {{ toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.auctioneer.priorityClassName }} + priorityClassName: {{ .Values.auctioneer.priorityClassName }} + {{- end }} + initContainers: + {{- if .Values.auctioneer.initContainers }} + {{- toYaml .Values.auctioneer.initContainers | nindent 8 }} + {{- end }} + {{- include "timeboost.initContainers" . | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.auctioneer.securityContext | nindent 12 }} + image: "{{ include "timeboost.image.repository" (dict "root" . "component" .Values.auctioneer) }}:{{ include "timeboost.image.tag" (dict "root" . "component" .Values.auctioneer) }}" + imagePullPolicy: {{ include "timeboost.image.pullPolicy" (dict "root" . "component" .Values.auctioneer) }} + {{- if .Values.auctioneer.diagnosticMode }} + command: ["sleep"] + args: ["infinity"] + {{- else if .Values.auctioneer.commandOverride.enabled }} + {{- with .Values.auctioneer.commandOverride.command }} + command: {{- toYaml . | nindent 8}} + {{- end }} + {{- with .Values.auctioneer.commandOverride.args }} + args: {{- toYaml . | nindent 8 }} + {{- end }} + {{- else }} + command: [/usr/local/bin/autonomous-auctioneer] + args: + {{- if .Values.auctioneer.configmap.data.metrics}} + - --metrics + {{- end }} + {{- if .Values.auctioneer.configmap.enabled }} + - --conf.file=/config/config.json + {{- end }} + {{- if .Values.auctioneer.customArgs }} + {{- include "timeboost.customArgs" . | nindent 12 }} + {{- end }} + ports: + {{- if .Values.auctioneer.configmap.data.metrics }} + - name: metrics + containerPort: {{ index .Values.auctioneer "configmap" "data" "metrics-server" "port" }} + protocol: TCP + {{- end }} + {{- range .Values.auctioneer.extraPorts }} + - name: {{ .name }} + containerPort: {{ .port }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} + {{- if .Values.auctioneer.livenessProbe.enabled }} + livenessProbe: + {{- if and .Values.auctioneer.livenessProbe.exec (kindIs "string" .Values.auctioneer.livenessProbe.exec.command) }} + {{- omit .Values.auctioneer.livenessProbe "enabled" "exec" | toYaml | nindent 12 }} + exec: + command: + {{- tpl .Values.auctioneer.livenessProbe.exec.command . | nindent 14 }} + {{- else }} + {{- omit .Values.auctioneer.livenessProbe "enabled" | toYaml | nindent 12 }} + {{- end }} + {{- end }} + {{- if .Values.auctioneer.readinessProbe.enabled }} + readinessProbe: + {{- omit .Values.auctioneer.readinessProbe "enabled" | toYaml | nindent 12 }} + {{- end }} + {{- if and .Values.auctioneer.startupProbe.enabled .Values.auctioneer.configmap.data.http .Values.auctioneer.configmap.data.http.port }} + startupProbe: + exec: + command: + - "bash" + - "-c" + - | + {{- include "startupProbe" . | nindent 18 }} + failureThreshold: {{ .Values.auctioneer.startupProbe.failureThreshold }} + periodSeconds: {{ .Values.auctioneer.startupProbe.periodSeconds }} + {{- end }} + {{- end }} + {{- if .Values.auctioneer.persistence.enabled }} + volumeMounts: + {{- if .Values.auctioneer.jwtSecret.enabled }} + - name: jwt-secret + mountPath: /secrets/jwtsecret + subPath: jwtSecret + readOnly: true + {{- end }} + - name: timeboostdata + mountPath: {{ .Values.auctioneer.configmap.data.persistent.chain }} + {{- end }} + {{- if .Values.auctioneer.configmap.enabled }} + - name: config + mountPath: /config/ + {{- end }} + {{- if .Values.auctioneer.wallet.files }} + {{ range $filename, $json := .Values.auctioneer.wallet.files }} + - name: wallet-files + mountPath: {{ $.Values.auctioneer.wallet.mountPath }}{{ $filename }} + subPath: {{ $filename }} + {{- end }} + {{- end }} + {{- if .Values.auctioneer.extraVolumeMounts }} + {{- toYaml .Values.auctioneer.extraVolumeMounts | nindent 10}} + {{- end }} + {{- range .Values.auctioneer.additionalVolumeClaims }} + {{- if .enabled }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- end }} + {{- end }} + resources: + {{- toYaml .Values.auctioneer.resources | nindent 12 }} + {{- include "timeboost.sidecars" . | nindent 8 }} + volumes: + {{- if .Values.auctioneer.jwtSecret.enabled }} + - name: jwt-secret + secret: + secretName: {{ include "timeboost.fullname" . }}-jwt + {{- end }} + {{- if .Values.auctioneer.configmap.enabled }} + - name: config + configMap: + name: {{ include "timeboost.fullname" . }}-auctioneer + {{- end }} + {{- if .Values.auctioneer.wallet.files }} + - name: wallet-files + secret: + secretName: {{ include "timeboost.fullname" . }}-wallets + {{- end }} + {{- if .Values.auctioneer.extraVolumes }} + {{- toYaml .Values.auctioneer.extraVolumes | nindent 6 }} + {{- end }} + {{- range .Values.auctioneer.additionalVolumeClaims }} + {{- if .enabled }} + - name: {{ .name }} + persistentVolumeClaim: + claimName: {{ .name }} + {{- end }} + {{- end }} + {{- if .Values.auctioneer.nodeSelector }} + nodeSelector: + {{- toYaml .Values.auctioneer.nodeSelector | nindent 8 }} + {{- end }} + terminationGracePeriodSeconds: {{ .Values.auctioneer.terminationGracePeriodSeconds | default 600 }} + {{- with .Values.auctioneer.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.auctioneer.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.auctioneer.topologySpreadConstraints }} + topologySpreadConstraints: + {{- range $constraint := . }} + - {{ toYaml $constraint | nindent 8 | trim }} + {{- if not $constraint.labelSelector }} + labelSelector: + matchLabels: + {{- include "timeboost.auctioneer.selectorLabels" $ | nindent 12 }} + function: nitro + {{- end }} + {{- end }} + {{- end }} + volumeClaimTemplates: + {{- if .Values.auctioneer.persistence.enabled }} + - metadata: + name: timeboostdata + {{- with .Values.auctioneer.storageAnnotations }} + annotations: + {{- toYaml . | nindent 10 }} + {{- end }} + labels: + app: {{ template "timeboost.name" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + {{- if .Values.auctioneer.persistence.snapshotValue }} + snapshot: {{ .Values.auctioneer.persistence.snapshotValue }} + {{- end }} + spec: + accessModes: + {{- toYaml .Values.auctioneer.persistence.accessModes | nindent 8 }} + {{- if .Values.auctioneer.persistence.storageClassName }} + storageClassName: {{ .Values.auctioneer.persistence.storageClassName | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.auctioneer.persistence.size | quote }} + {{- end }} diff --git a/charts/timeboost/templates/auctioneer/wallets.yaml b/charts/timeboost/templates/auctioneer/wallets.yaml new file mode 100644 index 0000000..48ae6de --- /dev/null +++ b/charts/timeboost/templates/auctioneer/wallets.yaml @@ -0,0 +1,13 @@ +{{- if .Values.auctioneer.wallet.files }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "timeboost.fullname" . }}-wallets + labels: + {{- include "timeboost.auctioneer.labels" . | nindent 4 }} +type: Opaque +data: +{{- range $filename, $json := .Values.auctioneer.wallet.files }} + {{ $filename }}: {{ $json | b64enc }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/timeboost/templates/bid-validator/_helpers.tpl b/charts/timeboost/templates/bid-validator/_helpers.tpl new file mode 100644 index 0000000..f58c44c --- /dev/null +++ b/charts/timeboost/templates/bid-validator/_helpers.tpl @@ -0,0 +1,97 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "timeboost.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "timeboost.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "timeboost.chart" -}} +{{- printf "%s" .Chart.Name | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels Bid Validator +*/}} +{{- define "timeboost.bidValidator.labels" -}} +helm.sh/chart: {{ include "timeboost.chart" . }} +{{ include "timeboost.bidValidator.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels Bid Validator +*/}} +{{- define "timeboost.bidValidator.selectorLabels" -}} +app.kubernetes.io/name: {{ include "timeboost.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{- define "startupProbe" -}} +{{- if .Values.startupProbe.command }} +{{ .Values.startupProbe.command }} +{{- else }} +curl "http://localhost:{{ .Values.configmap.data.http.port }}{{ .Values.configmap.data.http.rpcprefix }}" -H "Content-Type: application/json" \ + -sd "{\"jsonrpc\":\"2.0\",\"id\":0,\"method\":\"eth_syncing\",\"params\":[]}" \ + | jq -ne "input.result == false" +{{- end }} +{{- end -}} + +{{/* +bid validator args +*/}} +{{- define "timeboost.bidValidator.bidValidatorCustomArgs" -}} + +{{- $bidValidatorCustomArgs := list -}} +{{- range $k, $v := .Values.bidValidator.bidValidatorCustomArgs -}} + {{- $bidValidatorCustomArgs = concat $bidValidatorCustomArgs (list (printf "--%s" $v)) -}} +{{- end -}} + +{{- $bidValidatorCustomArgs | compact | toStrings | toYaml -}} + +{{- end -}} + +{{- define "timeboost.initContainers" -}} +{{- end }} + +{{- define "timeboost.sidecars" -}} +{{- end }} + +{{/* +Process config data +*/}} +{{- define "timeboost.bidValidator.configProcessor" -}} + +{{- /* Make a deep copy of the values from the Helm chart */ -}} +{{- $values := deepCopy .Values -}} + +{{- /* Process the final configmap data into pretty JSON format */ -}} +{{- $processed := $values.bidValidator.configmap.data | toPrettyJson | replace "\\u0026" "&" | replace "\\u003c" "<" | replace "\\u003e" ">" -}} + +{{- /* Return the processed JSON data */ -}} +{{- $processed -}} + +{{- end -}} diff --git a/charts/timeboost/templates/bid-validator/configmap.yaml b/charts/timeboost/templates/bid-validator/configmap.yaml new file mode 100644 index 0000000..10df9b2 --- /dev/null +++ b/charts/timeboost/templates/bid-validator/configmap.yaml @@ -0,0 +1,11 @@ +{{- if .Values.bidValidator.configmap.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "timeboost.fullname" . }}-bid-validator + labels: + {{- include "timeboost.bidValidator.labels" . | nindent 4 }} +data: + config.json: | + {{- include "timeboost.bidValidator.configProcessor" . | nindent 4 }} +{{- end }} diff --git a/charts/timeboost/templates/bid-validator/deployment.yaml b/charts/timeboost/templates/bid-validator/deployment.yaml new file mode 100644 index 0000000..842a030 --- /dev/null +++ b/charts/timeboost/templates/bid-validator/deployment.yaml @@ -0,0 +1,171 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "timeboost.fullname" . }}-bid-validator + labels: + {{- include "timeboost.bidValidator.labels" . | nindent 4 }} + annotations: + timeboost.arbitrum.io/desiredReplicas: {{ $.Values.bidValidator.replicaCount | quote }} +spec: + replicas: {{ .Values.bidValidator.replicaCount }} + selector: + matchLabels: + {{- include "timeboost.bidValidator.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + checksum/configmap: {{ include (print $.Template.BasePath "/bid-validator/configmap.yaml") . | sha256sum }} + {{- with .Values.bidValidator.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "timeboost.bidValidator.selectorLabels" . | nindent 8 }} + function: nitro + {{- with .Values.bidValidator.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.image.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "timeboost.fullname" . }}-bid-validator + securityContext: + {{- with .Values.bidValidator.podSecurityContext }}{{ toYaml . | nindent 8 }}{{- end }} + {{- if .Values.bidValidator.priorityClassName }} + priorityClassName: {{ .Values.bidValidator.priorityClassName }} + {{- end }} + initContainers: + {{- if .Values.bidValidator.initContainers }} + {{- toYaml .Values.bidValidator.initContainers | nindent 8 }} + {{- end }} + {{- include "timeboost.initContainers" . | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.bidValidator.securityContext | nindent 12 }} + image: "{{ include "timeboost.image.repository" (dict "root" . "component" .Values.bidValidator) }}:{{ include "timeboost.image.tag" (dict "root" . "component" .Values.bidValidator) }}" + imagePullPolicy: {{ include "timeboost.image.pullPolicy" (dict "root" . "component" .Values.bidValidator) }} + {{- if .Values.bidValidator.diagnosticMode }} + command: ["sleep"] + args: ["infinity"] + {{- else if .Values.bidValidator.commandOverride.enabled }} + {{- with .Values.bidValidator.commandOverride.command }} + command: {{- toYaml . | nindent 8}} + {{- end }} + {{- with .Values.bidValidator.commandOverride.args }} + args: {{- toYaml . | nindent 8 }} + {{- end }} + {{- else }} + command: [/usr/local/bin/autonomous-auctioneer] + args: + {{- if .Values.bidValidator.configmap.data.metrics}} + - --metrics + {{- end }} + {{- if .Values.bidValidator.configmap.enabled }} + - --conf.file=/config/config.json + {{- end }} + {{- if .Values.bidValidator.customArgs }} + {{- include "timeboost.customArgs" . | nindent 12 }} + {{- end }} + ports: + {{- if and .Values.bidValidator.configmap.data.http .Values.bidValidator.configmap.data.http.port}} + - name: http + containerPort: {{ .Values.bidValidator.configmap.data.http.port }} + protocol: TCP + {{- end }} + {{- if .Values.bidValidator.configmap.data.metrics }} + - name: metrics + containerPort: {{ index .Values.bidValidator "configmap" "data" "metrics-server" "port" }} + protocol: TCP + {{- end }} + {{- range .Values.bidValidator.extraPorts }} + - name: {{ .name }} + containerPort: {{ .port }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} + {{- if .Values.bidValidator.livenessProbe.enabled }} + livenessProbe: + {{- if and .Values.bidValidator.livenessProbe.exec (kindIs "string" .Values.bidValidator.livenessProbe.exec.command) }} + {{- omit .Values.bidValidator.livenessProbe "enabled" "exec" | toYaml | nindent 12 }} + exec: + command: + {{- tpl .Values.bidValidator.livenessProbe.exec.command . | nindent 14 }} + {{- else }} + {{- omit .Values.bidValidator.livenessProbe "enabled" | toYaml | nindent 12 }} + {{- end }} + {{- end }} + {{- if .Values.bidValidator.readinessProbe.enabled }} + readinessProbe: + {{- omit .Values.bidValidator.readinessProbe "enabled" | toYaml | nindent 12 }} + {{- end }} + {{- if and .Values.bidValidator.startupProbe.enabled .Values.bidValidator.configmap.data.http .Values.bidValidator.configmap.data.http.port }} + startupProbe: + exec: + command: + - "bash" + - "-c" + - | + {{- include "startupProbe" . | nindent 18 }} + failureThreshold: {{ .Values.bidValidator.startupProbe.failureThreshold }} + periodSeconds: {{ .Values.bidValidator.startupProbe.periodSeconds }} + {{- end }} + {{- end }} + volumeMounts: + {{- if .Values.bidValidator.configmap.enabled }} + - name: config + mountPath: /config/ + {{- end }} + {{- if .Values.bidValidator.extraVolumeMounts }} + {{- toYaml .Values.bidValidator.extraVolumeMounts | nindent 12 }} + {{- end }} + {{- range .Values.bidValidator.additionalVolumeClaims }} + {{- if .enabled }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- end }} + {{- end }} + resources: + {{- toYaml .Values.bidValidator.resources | nindent 12 }} + {{- include "timeboost.sidecars" . | nindent 8 }} + volumes: + {{- if .Values.bidValidator.configmap.enabled }} + - name: config + configMap: + name: {{ include "timeboost.fullname" . }}-bid-validator + {{- end }} + {{- if .Values.bidValidator.extraVolumes }} + {{- toYaml .Values.bidValidator.extraVolumes | nindent 8 }} + {{- end }} + {{- range .Values.bidValidator.additionalVolumeClaims }} + {{- if .enabled }} + - name: {{ .name }} + persistentVolumeClaim: + claimName: {{ .name }} + {{- end }} + {{- end }} + {{- if .Values.bidValidator.nodeSelector }} + nodeSelector: + {{- toYaml .Values.bidValidator.nodeSelector | nindent 8 }} + {{- end }} + terminationGracePeriodSeconds: {{ .Values.bidValidator.terminationGracePeriodSeconds | default 600 }} + {{- with .Values.bidValidator.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.bidValidator.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.bidValidator.topologySpreadConstraints }} + topologySpreadConstraints: + {{- range $constraint := . }} + - {{ toYaml $constraint | nindent 8 | trim }} + {{- if not $constraint.labelSelector }} + labelSelector: + matchLabels: + {{- include "timeboost.bidValidator.selectorLabels" $ | nindent 12 }} + function: nitro + {{- end }} + {{- end }} + {{- end }} diff --git a/charts/timeboost/templates/bid-validator/service.yaml b/charts/timeboost/templates/bid-validator/service.yaml new file mode 100644 index 0000000..669bebc --- /dev/null +++ b/charts/timeboost/templates/bid-validator/service.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "timeboost.fullname" . }}-bid-validator + labels: + {{- include "timeboost.bidValidator.labels" . | nindent 4 }} + function: nitro-svc +spec: + type: {{ .Values.bidValidator.service.type }} + ports: + {{- if and .Values.bidValidator.configmap.data.http .Values.bidValidator.configmap.data.http.port }} + - port: {{ index .Values.bidValidator.configmap.data.http.port }} + targetPort: http + protocol: TCP + name: http + {{- end }} + {{- if .Values.bidValidator.configmap.data.metrics }} + - port: {{ index .Values.bidValidator "configmap" "data" "metrics-server" "port" }} + targetPort: metrics + protocol: TCP + name: metrics + {{- end }} + {{- range .Values.bidValidator.extraPorts }} + {{- if .serviceEnabled | default true }} + - name: {{ .name }} + port: {{ .servicePort | default .port }} + targetPort: {{ .port }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} + {{- end }} + selector: + {{- include "timeboost.bidValidator.selectorLabels" . | nindent 4 }} + function: nitro + publishNotReadyAddresses: {{ .Values.bidValidator.service.publishNotReadyAddresses }} diff --git a/charts/timeboost/templates/bid-validator/serviceaccount.yaml b/charts/timeboost/templates/bid-validator/serviceaccount.yaml new file mode 100644 index 0000000..ec51923 --- /dev/null +++ b/charts/timeboost/templates/bid-validator/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.bidValidator.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "timeboost.fullname" . }}-bid-validator + labels: + {{- include "timeboost.bidValidator.labels" . | nindent 4 }} + {{- with .Values.bidValidator.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/timeboost/templates/bid-validator/servicemonitor.yaml b/charts/timeboost/templates/bid-validator/servicemonitor.yaml new file mode 100644 index 0000000..6022308 --- /dev/null +++ b/charts/timeboost/templates/bid-validator/servicemonitor.yaml @@ -0,0 +1,40 @@ +{{- if .Values.bidValidator.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "timeboost.fullname" . }}-bid-validator + labels: + {{- include "timeboost.bidValidator.labels" . | nindent 4 }} + {{- if .Values.bidValidator.serviceMonitor.additionalLabels }} + {{- toYaml .Values.bidValidator.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + - port: {{ .Values.bidValidator.serviceMonitor.portName | default "http" }} + {{- if .Values.bidValidator.serviceMonitor.interval }} + interval: {{ .Values.bidValidator.serviceMonitor.interval }} + {{- end }} + {{- if .Values.bidValidator.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.bidValidator.serviceMonitor.scrapeTimeout }} + {{- end }} + {{- if .Values.bidValidator.serviceMonitor.path }} + path: {{ .Values.bidValidator.serviceMonitor.path }} + {{- end }} + {{- if .Values.bidValidator.serviceMonitor.scheme }} + scheme: {{ .Values.bidValidator.serviceMonitor.scheme }} + {{- end }} + {{- if .Values.bidValidator.serviceMonitor.tlsConfig }} + tlsConfig: + {{- toYaml .Values.bidValidator.serviceMonitor.tlsConfig | nindent 8 }} + {{- end }} + {{- with .Values.bidValidator.serviceMonitor.relabelings }} + relabelings: {{- toYaml . | nindent 8 }} + {{- end }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + {{- include "timeboost.bidValidator.selectorLabels" . | nindent 6 }} + function: timeboost-svc +{{- end }} diff --git a/charts/timeboost/values.yaml b/charts/timeboost/values.yaml new file mode 100644 index 0000000..af4a640 --- /dev/null +++ b/charts/timeboost/values.yaml @@ -0,0 +1,357 @@ +# Default values for timeboost. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +## @section Global Image Configuration +image: + ## @param image.repository Docker image repository + ## @param image.pullPolicy Docker image pull policy + repository: offchainlabs/nitro-node + pullPolicy: Always + ## @param image.tag Docker image tag. Defaults to Chart appVersion if not set + tag: "" + +## @section Auctioneer Deployment Options +auctioneer: + ## @param auctioneer.replicaCount Number of replicas to deploy + replicaCount: 1 + + ## @param auctioneer.image.repository Docker image repository override + ## @param auctioneer.image.pullPolicy Docker image pull policy override + ## @param auctioneer.image.tag Docker image tag. Overrides the chart appVersion. + image: + repository: "" + pullPolicy: "" + tag: "" + + ## @param auctioneer.imagePullSecrets Docker registry pull secret names as an array + imagePullSecrets: [] + ## @param auctioneer.nameOverride String to partially override timeboost.fullname + nameOverride: "" + + ## @param auctioneer.fullnameOverride String to fully override timeboost.fullname + fullnameOverride: "" + + ## @param auctioneer.commandOverride Command override for the nitro container + commandOverride: {} + + ## @param auctioneer.livenessProbe Liveness probe configuration + livenessProbe: {} + + ## @param auctioneer.readinessProbe Readiness probe configuration + readinessProbe: {} + + ## @param auctioneer.startupProbe.enabled Enable built in startup probe + ## @param auctioneer.startupProbe.failureThreshold Number of failures before pod is considered unhealthy + ## @param auctioneer.startupProbe.periodSeconds Number of seconds between startup probes + ## @param auctioneer.startupProbe.command Command to run for the startup probe. If empty, the built in probe will be used + startupProbe: + enabled: false + failureThreshold: 2419200 + periodSeconds: 1 + command: "" + + ## @param auctioneer.updateStrategy.type Update strategy type + updateStrategy: + type: RollingUpdate + + ## @param auctioneer.persistence.enabled Enable persistence + ## @param auctioneer.persistence.size Size of the persistent volume claim + ## @param auctioneer.persistence.storageClassName [string, nullable] Storage class of the persistent volume claim + ## @param auctioneer.persistence.accessModes Access modes of the persistent volume claim + persistence: + enabled: true + size: 1Gi + storageClassName: null + accessModes: + - ReadWriteOnce + + ## @param auctioneer.serviceMonitor.enabled Enable service monitor CRD for prometheus operator + ## @param auctioneer.serviceMonitor.portName Name of the port to monitor + ## @param auctioneer.serviceMonitor.path Path to monitor + ## @param auctioneer.serviceMonitor.interval Interval to monitor + ## @param auctioneer.serviceMonitor.additionalLabels Additional labels for the service monitor + ## @param auctioneer.serviceMonitor.relabelings Add relabelings for the metrics being scraped + serviceMonitor: + enabled: false + portName: metrics + path: /debug/metrics/prometheus + interval: 5s + additionalLabels: {} + relabelings: [] + + ## @param auctioneer.serviceAccount.create Create a service account + ## @param auctioneer.serviceAccount.annotations Annotations for the service account + ## @param auctioneer.serviceAccount.name Name of the service account + serviceAccount: + create: true + annotations: {} + name: "" + + ## @param auctioneer.jwtSecret.enabled Enable a jwt secret + ## @param auctioneer.jwtSecret.value Value of the jwt secret + jwtSecret: + enabled: false + value: "" + + ## @param auctioneer.podAnnotations Annotations for the pod + podAnnotations: {} + + ## @param auctioneer.podLabels Labels for the pod + podLabels: {} + + ## @param auctioneer.podSecurityContext.fsGroup Group id for the pod + ## @param auctioneer.podSecurityContext.runAsGroup Group id for the user + ## @param auctioneer.podSecurityContext.runAsNonRoot Run as non root + ## @param auctioneer.podSecurityContext.runAsUser User id for the user + ## @param auctioneer.podSecurityContext.fsGroupChangePolicy Policy for the fs group + podSecurityContext: + fsGroup: 1000 + runAsGroup: 1000 + runAsNonRoot: true + runAsUser: 1000 + fsGroupChangePolicy: "OnRootMismatch" + + ## @param auctioneer.securityContext Security context for the container + securityContext: {} + + ## @param auctioneer.priorityClassName Priority class name + priorityClassName: "" + + ## @param auctioneer.service.type Service type + ## @param auctioneer.service.publishNotReadyAddresses Publish not ready addresses + service: + type: ClusterIP + publishNotReadyAddresses: false + + ## @param auctioneer.resources Resources for the container + resources: {} + + ## @param auctioneer.nodeSelector Node selector for the pod + nodeSelector: {} + + ## @param auctioneer.tolerations Tolerations for the pod + tolerations: [] + + ## @param auctioneer.affinity Affinity for the pod + affinity: {} + + ## @param auctioneer.additionalVolumeClaims Additional volume claims for the pod + additionalVolumeClaims: [] + + ## @param auctioneer.extraVolumes Additional volumes for the pod + extraVolumes: [] + + ## @param auctioneer.extraVolumeMounts Additional volume mounts for the pod + extraVolumeMounts: [] + + ## @param auctioneer.extraPorts Additional ports for the pod + extraPorts: [] + + ## @param auctioneer.wallet.mountPath Path to mount the wallets + ## @param auctioneer.wallet.files Key value pair of wallet name and contents (ethers json format) + wallet: + mountPath: "/wallet/" + files: {} # sequencer-wallet1.json: '{"address": "0x...", "encryptedData": "..." }' + + configmap: + ## @param auctioneer.configmap.enabled Enable a configmap for the nitro container + enabled: true + ## @extra configmap.data See Configuration Options for the full list of options + data: + ## @param auctioneer.configmap.data.auctioneer-server.auction-contract-address Auction contract address + ## @param auctioneer.configmap.data.auctioneer-server.db-directory Database storage directory + ## @param auctioneer.configmap.data.auctioneer-server.redis-url Redis URL + ## @param auctioneer.configmap.data.auctioneer-server.sequencer-endpoint Sequencer endpoint + ## @param auctioneer.configmap.data.auctioneer-server.sequencer-jwt-path Path to seqeuncer JWT + ## @param auctioneer.configmap.data.auctioneer-server.wallet.account Wallet account + ## @param auctioneer.configmap.data.auctioneer-server.wallet.password Wallet password + ## @param auctioneer.configmap.data.auctioneer-server.wallet.pathname Path to wallet + auctioneer-server: + auction-contract-address: "" + db-directory: "/data" + redis-url: redis://redis:6379 + sequencer-endpoint: ws://sequencer:8549 + sequencer-jwt-path: "/config/jwt.hex" + wallet: + account: "" + password: "" + pathname: "" + + ## @param auctioneer.configmap.data.bid-validator.enable Enable bid validator + bid-validator: + enable: false + + ## @param auctioneer.configmap.data.log-type Type of log + log-type: "json" + + ## @param auctioneer.configmap.data.metrics Enable metrics + ## @param auctioneer.configmap.data.metrics-server.addr Address to bind metrics server to + ## @param auctioneer.configmap.data.metrics-server.port Port to bind metrics server to + metrics: false + metrics-server: + addr: "0.0.0.0" + port: 6070 + + ## @param auctioneer.configmap.data.persistent.auctioneer Path to persistent auction data + persistent: + chain: "/home/user/data/" + +## @section Bid Validator Deployment Options +bidValidator: + ## @param bidValidator.replicaCount Number of replicas to deploy + ## + replicaCount: 1 + + ## @param bidValidator.image.repository Docker image repository override + ## @param bidValidator.image.pullPolicy Docker image pull policy override + ## @param bidValidator.image.tag Docker image tag. Overrides the chart appVersion. + image: + repository: "" + pullPolicy: "" + tag: "" + + ## @param bidValidator.imagePullSecrets Docker registry pull secret names as an array + imagePullSecrets: [] + ## @param bidValidator.nameOverride String to partially override timeboost.fullname + nameOverride: "" + + ## @param bidValidator.fullnameOverride String to fully override timeboost.fullname + fullnameOverride: "" + + ## @param bidValidator.commandOverride Command override for the nitro container + commandOverride: {} + + ## @param bidValidator.livenessProbe Liveness probe configuration + livenessProbe: {} + + ## @param bidValidator.readinessProbe Readiness probe configuration + readinessProbe: {} + + ## @param bidValidator.startupProbe.enabled Enable built in startup probe + ## @param bidValidator.startupProbe.failureThreshold Number of failures before pod is considered unhealthy + ## @param bidValidator.startupProbe.periodSeconds Number of seconds between startup probes + ## @param bidValidator.startupProbe.command Command to run for the startup probe. If empty, the built in probe will be used + startupProbe: + enabled: false + failureThreshold: 2419200 + periodSeconds: 1 + command: "" + + ## @param bidValidator.serviceMonitor.enabled Enable service monitor CRD for prometheus operator + ## @param bidValidator.serviceMonitor.portName Name of the port to monitor + ## @param bidValidator.serviceMonitor.path Path to monitor + ## @param bidValidator.serviceMonitor.interval Interval to monitor + ## @param bidValidator.serviceMonitor.additionalLabels Additional labels for the service monitor + ## @param bidValidator.serviceMonitor.relabelings Add relabelings for the metrics being scraped + serviceMonitor: + enabled: false + portName: metrics + path: /debug/metrics/prometheus + interval: 5s + additionalLabels: {} + relabelings: [] + + ## @param bidValidator.serviceAccount.create Create a service account + ## @param bidValidator.serviceAccount.annotations Annotations for the service account + ## @param bidValidator.serviceAccount.name Name of the service account + serviceAccount: + create: true + annotations: {} + name: "" + + ## @param bidValidator.podAnnotations Annotations for the pod + podAnnotations: {} + + ## @param bidValidator.podLabels Labels for the pod + podLabels: {} + + ## @param bidValidator.podSecurityContext.fsGroup Group id for the pod + ## @param bidValidator.podSecurityContext.runAsGroup Group id for the user + ## @param bidValidator.podSecurityContext.runAsNonRoot Run as non root + ## @param bidValidator.podSecurityContext.runAsUser User id for the user + ## @param bidValidator.podSecurityContext.fsGroupChangePolicy Policy for the fs group + podSecurityContext: + fsGroup: 1000 + runAsGroup: 1000 + runAsNonRoot: true + runAsUser: 1000 + fsGroupChangePolicy: "OnRootMismatch" + + ## @param bidValidator.securityContext Security context for the container + securityContext: {} + + ## @param bidValidator.priorityClassName Priority class name + priorityClassName: "" + + ## @param bidValidator.service.type Service type + ## @param bidValidator.service.publishNotReadyAddresses Publish not ready addresses + service: + type: ClusterIP + publishNotReadyAddresses: false + + ## @param bidValidator.resources Resources for the container + resources: {} + + ## @param bidValidator.nodeSelector Node selector for the pod + nodeSelector: {} + + ## @param bidValidator.tolerations Tolerations for the pod + tolerations: [] + + ## @param bidValidator.affinity Affinity for the pod + affinity: {} + + ## @param bidValidator.additionalVolumeClaims Additional volume claims for the pod + additionalVolumeClaims: [] + + ## @param bidValidator.extraVolumes Additional volumes for the pod + extraVolumes: [] + + ## @param bidValidator.extraVolumeMounts Additional volume mounts for the pod + extraVolumeMounts: [] + + ## @param bidValidator.extraPorts Additional ports for the pod + extraPorts: [] + + configmap: + ## @param bidValidator.configmap.enabled Enable a configmap for the nitro container + enabled: true + ## @extra configmap.data See Configuration Options for the full list of options + data: + ## @param bidValidator.configmap.data.http.addr Address to bind http service to + ## @param bidValidator.configmap.data.http.api List of apis to enable + ## @param bidValidator.configmap.data.http.corsdomain CORS domain + ## @param bidValidator.configmap.data.http.port Port to bind http service to + ## @param bidValidator.configmap.data.http.rpcprefix Prefix for rpc calls + ## @param bidValidator.configmap.data.http.vhosts Vhosts to allow + http: + addr: "0.0.0.0" + api: ["auctioneer"] + corsdomain: "*" + port: 8547 + rpcprefix: "/rpc" + vhosts: "*" + + ## @param bidValidator.configmap.data.auctioneer-server.enable Enable Auctioneer Server + auctioneer-server: + enable: false + + ## @param bidValidator.configmap.data.bid-validator.auction-contract-address Auction contract address + ## @param bidValidator.configmap.data.bid-validator.redis-url Redis URL + ## @param bidValidator.configmap.data.bid-validator.sequencer-endpoint Sequencer endpoint + bid-validator: + auction-contract-address: "" + redis-url: redis://redis:6379 + sequencer-endpoint: http://sequencer:8547 + + ## @param bidValidator.configmap.data.log-type Type of log + log-type: "json" + + ## @param bidValidator.configmap.data.metrics Enable metrics + ## @param bidValidator.configmap.data.metrics-server.addr Address to bind metrics server to + ## @param bidValidator.configmap.data.metrics-server.port Port to bind metrics server to + metrics: false + metrics-server: + addr: "0.0.0.0" + port: 6070 diff --git a/scripts/readmecli.py b/scripts/readmecli.py old mode 100644 new mode 100755 index c96245f..fa05507 --- a/scripts/readmecli.py +++ b/scripts/readmecli.py @@ -7,13 +7,15 @@ def list_directories(base_path): """List all directories in the given base path""" - return [d for d in os.listdir(base_path) if os.path.isdir(os.path.join(base_path, d))] + return [ + d for d in os.listdir(base_path) if os.path.isdir(os.path.join(base_path, d)) + ] def read_yaml_file(file_path): """Read a YAML file and return the content""" try: - with open(file_path, 'r') as file: + with open(file_path, "r") as file: return yaml.safe_load(file) except Exception as e: logging.error(f"Failed to read {file_path}: {e}") @@ -24,9 +26,10 @@ def render_helm_chart(chart_path, values_path): """Render Helm chart templates using provided values file""" try: # Make sure Helm is installed and chart_path/values_path are correct + logging.info(f"Rendering Helm chart: {chart_path}") command = f"helm template my-release {chart_path} --values {values_path}" rendered_templates = subprocess.check_output(command, shell=True) - return rendered_templates.decode('utf-8') + return rendered_templates.decode("utf-8") except subprocess.CalledProcessError as e: logging.error(f"Helm template rendering failed: {e}") return None @@ -34,17 +37,17 @@ def render_helm_chart(chart_path, values_path): def find_entry_command(rendered_yaml_content): """Find the entry command in the rendered deployment or statefulset""" - command_pattern = re.compile(r'command:\s*\[(.*?)\]', re.DOTALL) + command_pattern = re.compile(r"command:\s*\[(.*?)\]", re.DOTALL) # Using regex to find the command list or string matches = command_pattern.findall(rendered_yaml_content) if matches: logging.info(f"Found command: {matches[0]}") # Clean and split the command string into a list - commands = matches[0].strip().split(',') + commands = matches[0].strip().split(",") # Remove quotes and extra whitespace commands = [cmd.strip().strip("'\"") for cmd in commands] - return ' '.join(commands) + return " ".join(commands) return None @@ -53,18 +56,17 @@ def run_docker_help(image_repository, image_tag, entry_command): try: # Include the entry command if available command = f"docker run --entrypoint {entry_command} --rm {image_repository}:{image_tag} --help" - output = subprocess.check_output( - command, stderr=subprocess.STDOUT, shell=True) - return output.decode('utf-8') + output = subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True) + return output.decode("utf-8") except subprocess.CalledProcessError as e: logging.error(f"Failed to run docker image: {e}") # Return the stderr output if command fails - return e.output.decode('utf-8') + return e.output.decode("utf-8") def format_cli_help_to_markdown(cli_output): # Split the output into lines - lines = cli_output.split('\n') + lines = cli_output.split("\n") # Prepare to collect command configurations configs = [] @@ -76,16 +78,18 @@ def format_cli_help_to_markdown(cli_output): for line in lines: # Check for a line with a command - command_match = re.match(r'\s*--([\w.-]+)\s+(.*)', line) + command_match = re.match(r"\s*--([\w.-]+)\s+(.*)", line) if command_match: # If there's a current command, save it before starting a new one if current_command: - configs.append({ - 'name': f'`{current_command}`', - 'description': ' '.join(current_description).strip(), - 'default': f'`{current_default}`' if current_default else None - }) + configs.append( + { + "name": f"`{current_command}`", + "description": " ".join(current_description).strip(), + "default": f"`{current_default}`" if current_default else None, + } + ) # Reset the current command info current_command, rest_of_line = command_match.groups() @@ -93,35 +97,37 @@ def format_cli_help_to_markdown(cli_output): current_default = None # Check for a default value in the rest of the line - default_match = re.search( - r'\(default\s+["\']?(.+?)["\']?\)$', rest_of_line) + default_match = re.search(r'\(default\s+["\']?(.+?)["\']?\)$', rest_of_line) if default_match: current_default = default_match.group(1) - current_description[-1] = current_description[-1].replace( - default_match.group(0), '').strip() + current_description[-1] = ( + current_description[-1].replace(default_match.group(0), "").strip() + ) - elif current_command and (line.startswith(' ') or not line.strip()): + elif current_command and (line.startswith(" ") or not line.strip()): # This is a continuation of the description of the current command current_description.append(line.strip()) # Add the last command if there was one being processed if current_command: - configs.append({ - 'name': f'`{current_command}`', - 'description': ' '.join(current_description).strip(), - 'default': f'`{current_default}`' if current_default else None - }) + configs.append( + { + "name": f"`{current_command}`", + "description": " ".join(current_description).strip(), + "default": f"`{current_default}`" if current_default else None, + } + ) return configs def update_readme(readme_path, configs): try: - with open(readme_path, 'r+') as readme: + with open(readme_path, "r+") as readme: content = readme.read() - start_marker = '## Configuration Options' - intro = 'The following table lists the exhaustive configurable parameters that can be applied as part of the configmap (nested under `configmap.data`) or as standalone cli flags.' - end_marker = '##' + start_marker = "## Configuration Options" + intro = "The following table lists the exhaustive configurable parameters that can be applied as part of the configmap (nested under `configmap.data`) or as standalone cli flags." + end_marker = "##" start = content.find(start_marker) end = content.find(end_marker, start + len(start_marker)) @@ -131,7 +137,7 @@ def update_readme(readme_path, configs): row = f"{config['name']} | {config['description']} | {config['default'] or 'None'}\n" table += row - config_data = f'{start_marker}\n{intro}\n\n{table}\n' + config_data = f"{start_marker}\n{intro}\n\n{table}\n" if start == -1: content += config_data @@ -158,9 +164,11 @@ def main(): values_yaml = read_yaml_file(os.path.join(chart_path, "Values.yaml")) if chart_yaml and values_yaml: + logging.info(f"Processing chart: {chart_path}") image_repository = values_yaml.get("image", {}).get("repository") image_tag = values_yaml.get("image", {}).get("tag") app_version = chart_yaml.get("appVersion") + logging.info(f"Image: {image_repository}:{image_tag}") if image_tag: app_version = image_tag @@ -168,23 +176,26 @@ def main(): if image_repository and app_version: logging.info(f"Processing {image_repository}:{app_version}") rendered_templates = render_helm_chart( - chart_path, os.path.join(chart_path, "values.yaml")) + chart_path, os.path.join(chart_path, "values.yaml") + ) if rendered_templates: entry_command = find_entry_command(rendered_templates) help_output = run_docker_help( - image_repository, app_version, entry_command) + image_repository, app_version, entry_command + ) if help_output: config_data = format_cli_help_to_markdown(help_output) - update_readme(os.path.join( - chart_path, "README.md"), config_data) + update_readme( + os.path.join(chart_path, "README.md"), config_data + ) else: logging.warning( - f"Failed to run docker image: {image_repository}:{app_version}") + f"Failed to run docker image: {image_repository}:{app_version}" + ) else: - logging.warning( - f"Failed to render Helm chart: {chart_path}") + logging.warning(f"Failed to render Helm chart: {chart_path}") if __name__ == "__main__":