Skip to content

Commit

Permalink
Sinner Helm Chart (#1525)
Browse files Browse the repository at this point in the history
* init

* stashing at prev checkpoint to resolve build issues

* updating graphql

* live filling updates

* stash prev changes before tests

* update queries w/tests

* update api and cli

* stash before deploy

* api tests

* lint

* lint

* lint + gen

* code cov

* gen

* adding code cov

* lint + test + coderabbit suggestions

* symlink

* edits

* hold

* Update go.mod

* sinner docker + main.go

* sinner test flake, bytes -> hex string update, update assert use, lint

* update logging

* deprecate port flag

* updating fetch ceil

* adding concurrency during parse store

* add comments

* gen (stringer)

* add build to .goreleaser.yml

* build

* Revert "build" [goreleaser]

This reverts commit 8c61076.

* fix goreleaser [goreleaser]

* fix replacement issue

* [sinner] add start readme (#1499)

* add start readme

* fix https://github.com/synapsecns/sanguine/pull/1380/files#r1371810612

---------

Co-authored-by: Trajan0x <[email protected]>

* sinner strings for contract_type (#1498)

Co-authored-by: Trajan0x <[email protected]>

* trajan edits

* nits

* explorer update

* Sinner: resolvers and updating db read functions (#1514)

* init staging

* add more db read functions

* update model to where

* update filters

* hash

* Revert "hash"

This reverts commit 9b159df.

* remove unused db mocks

* handle invalid port

---------

Co-authored-by: Trajan0x <[email protected]>

* type fix

* simplify w generics

* add go error group to unified command + updated read.go

* code rabbit nit

* logger fix

* Parser, API, and config updates

* tests, sinner/indexer updates, db updates

* lint + refactor graphql + db

* Add log range asc to API

* [goreleaser]

* Update README.md

* refactor indexer

* exit 1 on fail

* update scribe fetcher and pagination behavior

* mysql context

* mysql + refresh rate

* update config and readme + [goreleaser]

* init

* mod lint

* omnirpc version bump

* chart bump

* Update values.yaml

* lint

* rm omnirpc dependacy

* update op rpc (ratelimited)

* rev

---------

Co-authored-by: Trajan0x <[email protected]>
Co-authored-by: trajan0x <[email protected]>
  • Loading branch information
3 people authored Nov 4, 2023
1 parent e7c1632 commit f0ef697
Show file tree
Hide file tree
Showing 24 changed files with 815 additions and 46 deletions.
8 changes: 4 additions & 4 deletions charts/agents/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ dependencies:
version: 9.3.2
- name: omnirpc
repository: file://../omnirpc/
version: 0.2.9
version: 0.2.91
- name: scribe
repository: file://../scribe/
version: 0.2.14
version: 0.2.15
- name: jaeger
repository: https://jaegertracing.github.io/helm-charts
version: 0.69.1
digest: sha256:f1c664b6e52c04911d6915e92341991ea2ad0e11235b4ccd72ea0ddb63284f55
generated: "2023-10-06T17:12:41.202122-07:00"
digest: sha256:7b9ac6625ebd1bbb31b539dda69c5399b3285ad05287fba122e355e57a434bed
generated: "2023-11-01T00:44:48.396983-05:00"
6 changes: 3 additions & 3 deletions charts/agents/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.28
version: 0.1.29

# 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
Expand All @@ -29,11 +29,11 @@ dependencies:
repository: "https://charts.bitnami.com/bitnami"
condition: mysql.enabled
- name: omnirpc
version: "0.2.9"
version: "0.2.91"
repository: "file://../omnirpc/"
condition: omnirpc.enabled
- name: scribe
version: "0.2.14"
version: "0.2.15"
repository: "file://../scribe/"
condition: scribe.enabled
- name: jaeger
Expand Down
10 changes: 5 additions & 5 deletions charts/agents/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ notary_files:
origin_address: 0xF3773BE7cb59235Ced272cF324aaeb0A4115280f
summit_address: 0x128fF47f1a614c61beC9935898C33B91486aA04e
destination_address: 0xde5BB62aBCF588EC200674757EDB2f6889aCd065
rpc_url: "https://optimism-rpc.gateway.pokt.network"
rpc_url: "https://mainnet.optimism.io"
start_height: 73536295
domain_client3:
domain_id: 43114
Expand Down Expand Up @@ -491,7 +491,7 @@ notary_files:
origin_address: 0xF3773BE7cb59235Ced272cF324aaeb0A4115280f
summit_address: 0x128fF47f1a614c61beC9935898C33B91486aA04e
destination_address: 0xde5BB62aBCF588EC200674757EDB2f6889aCd065
rpc_url: "https://optimism-rpc.gateway.pokt.network"
rpc_url: "https://mainnet.optimism.io"
start_height: 73536295
domain_client3:
domain_id: 43114
Expand Down Expand Up @@ -570,7 +570,7 @@ notary_files:
origin_address: 0xF3773BE7cb59235Ced272cF324aaeb0A4115280f
summit_address: 0x128fF47f1a614c61beC9935898C33B91486aA04e
destination_address: 0xde5BB62aBCF588EC200674757EDB2f6889aCd065
rpc_url: "https://optimism-rpc.gateway.pokt.network"
rpc_url: "https://mainnet.optimism.io"
start_height: 73536295
domain_client3:
domain_id: 43114
Expand Down Expand Up @@ -653,7 +653,7 @@ guard_files:
origin_address: 0xF3773BE7cb59235Ced272cF324aaeb0A4115280f
summit_address: 0x128fF47f1a614c61beC9935898C33B91486aA04e
destination_address: 0xde5BB62aBCF588EC200674757EDB2f6889aCd065
rpc_url: "https://optimism-rpc.gateway.pokt.network"
rpc_url: "https://mainnet.optimism.io"
start_height: 73536295
domain_client3:
domain_id: 43114
Expand Down Expand Up @@ -747,7 +747,7 @@ executor_remote_fresh_files:
origin_address: 0xF3773BE7cb59235Ced272cF324aaeb0A4115280f
destination_address: 0xde5BB62aBCF588EC200674757EDB2f6889aCd065
- chain_id: 10
temp_rpc: "https://optimism-rpc.gateway.pokt.network"
temp_rpc: "https://mainnet.optimism.io"
origin_address: 0xF3773BE7cb59235Ced272cF324aaeb0A4115280f
destination_address: 0xde5BB62aBCF588EC200674757EDB2f6889aCd065
- chain_id: 43114
Expand Down
6 changes: 3 additions & 3 deletions charts/explorer/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: omnirpc
repository: file://../omnirpc/
version: 0.2.9
version: 0.2.91
- name: clickhouse
repository: https://sentry-kubernetes.github.io/charts
version: 3.1.3
digest: sha256:c0948876356a232aae14d7835389505acacf60a6c78796b04a156502600684df
generated: "2023-10-06T17:11:59.552604-07:00"
digest: sha256:c3f0ef19b6724eb840c4d77f3a343901da44f3d2ca336187a52cc1ee0f5470a5
generated: "2023-11-01T00:44:53.090052-05:00"
4 changes: 2 additions & 2 deletions charts/explorer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.2.14
version: 0.2.15

# 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
Expand All @@ -25,7 +25,7 @@ appVersion: "1.16.0"

dependencies:
- name: omnirpc
version: "0.2.9"
version: "0.2.91"
repository: "file://../omnirpc/"
condition: omnirpc.enabled
- name: clickhouse
Expand Down
2 changes: 1 addition & 1 deletion charts/omnirpc/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.2.9
version: 0.2.91

# 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
Expand Down
51 changes: 28 additions & 23 deletions charts/omnirpc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,38 @@ files:
# this is an example, this is not required for the test above
# files listed here will be copied into /config/ and mounted into the application container
config.yml: |-
client_type: resty
chains:
10:
11155111:
rpcs:
- https://optimism-rpc.gateway.pokt.network/
#- https://mainnet.optimism.io
#- https://orbital-wispy-grass.optimism.quiknode.pro/85a1800475f8375485fce52acd883a341ec3ad30/
#- https://rpc.ankr.com/optimism
#- https://1rpc.io/op
# - https://opt-mainnet.g.alchemy.com/v2/e4WhjooOOY851Ue4paghoFEiK_sfG-3Q
# - https://optimism-mainnet.infura.io/v3/2e85e14c9de94f33ac80991fb423d891
confirmations: 3
137:
- rpc: https://ethereum-sepolia.publicnode.com
rpc_type: atable
- rpc: https://rpc.sepolia.org
rpc_type: auxiliary
- rpc: https://endpoints.omniatech.io/v1/eth/sepolia/public
rpc_type: auxiliary
confirmations: 1
421614:
rpcs:
- https://polygon-mainnet.g.alchemy.com/v2/Kmd9QLE1B3CFtVH879DJKsAvv92LV0E2
#- https://polygon-mainnet.g.alchemy.com/v2/ry1vz4vg8RwWC-dqDXdaFRvKnoSOJk6m
#- https://polygon-rpc.com
# - https://rpc-mainnet.matic.quiknode.pro
#- https://matic-mainnet.chainstacklabs.com
# - https://poly-rpc.gateway.pokt.network/
# - https://polygonapi.terminet.io/rpc
confirmations: 4
43114:
- rpc: https://arbitrum-sepolia.blockpi.network/v1/rpc/public
rpc_type: stable
- rpc: https://sepolia-rollup.arbitrum.io/rpc
rpc_type: auxiliary
confirmations: 1
444:
rpcs:
- https://avalancheapi.terminet.io/ext/bc/C/rpc
- https://api.avax.network/ext/bc/C/rpc
- https://rpc.ankr.com/avalanche
confirmations: 2
- rpc: https://l2-synapse-sepolia-testnet-1mdqkm651f.t.conduit.xyz
rpc_type: stable
confirmations: 1
43113:
rpcs:
- rpc: https://api.avax-test.network/ext/bc/C/rpc
rpc_type: stable
- rpc: https://avalanche-fuji.blockpi.network/v1/rpc/public
rpc_type: auxiliary
- rpc: https://endpoints.omniatech.io/v1/avax/fuji/public
rpc_type: auxiliary
confirmations: 1
env:
- name: GOLOG_LOG_FMT
Expand Down
6 changes: 3 additions & 3 deletions charts/scribe/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ dependencies:
version: 9.3.2
- name: omnirpc
repository: file://../omnirpc/
version: 0.2.9
digest: sha256:1b33f97f09cf2f3c56f95a6a466dfa00b09f41bcf57939864b75b29a053c49dc
generated: "2023-10-06T17:12:14.904732-07:00"
version: 0.2.91
digest: sha256:7996a0999644426256ef1218066ed3dc408004204324cd94f4d8e044fa57374b
generated: "2023-11-01T00:44:55.324185-05:00"
4 changes: 2 additions & 2 deletions charts/scribe/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.2.14
version: 0.2.15

# 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
Expand All @@ -29,6 +29,6 @@ dependencies:
repository: "https://charts.bitnami.com/bitnami"
condition: mysql.enabled
- name: omnirpc
version: "0.2.9"
version: "0.2.91"
repository: "file://../omnirpc/"
condition: omnirpc.enabled
23 changes: 23 additions & 0 deletions charts/sinner/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
6 changes: 6 additions & 0 deletions charts/sinner/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: mysql
repository: https://charts.bitnami.com/bitnami
version: 9.3.2
digest: sha256:39358a3bdc42ef8061db98ea22d72b614e9d340f9fb280ad600cd79a94e1848c
generated: "2023-11-01T12:19:11.204465-05:00"
30 changes: 30 additions & 0 deletions charts/sinner/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v2
name: sinner
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
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.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: "1.16.0"

dependencies:
- name: mysql
version: "9.3.2"
repository: "https://charts.bitnami.com/bitnami"
condition: mysql.enabled
22 changes: 22 additions & 0 deletions charts/sinner/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "sinner.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "sinner.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "sinner.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "sinner.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
70 changes: 70 additions & 0 deletions charts/sinner/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "sinner.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 "sinner.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 "sinner.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "sinner.labels" -}}
helm.sh/chart: {{ include "sinner.chart" . }}
{{ include "sinner.selectorLabels" . }}
{{ include "sinner.commonLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}


{{- define "sinner.commonLabels" -}}
{{- range $key, $value := .Values.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "sinner.selectorLabels" -}}
app.kubernetes.io/name: {{ include "sinner.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "sinner.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "sinner.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
13 changes: 13 additions & 0 deletions charts/sinner/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.files }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "sinner.fullname" . }}-{{ .Release.Name }}
labels:
app: {{ include "sinner.fullname" . }}
chart: "{{ .Chart.Name }}"
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{ toYaml .Values.files | indent 2 }}
{{- end }}
Loading

0 comments on commit f0ef697

Please sign in to comment.