Skip to content

Commit

Permalink
Merge branch 'main' into lilyjjo/order_blocks_by_tx_category
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilyjjo authored Oct 3, 2024
2 parents 39b7044 + b54ccb9 commit 2f4ae04
Show file tree
Hide file tree
Showing 52 changed files with 4,316 additions and 686 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/code-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,35 @@ jobs:
list-files: shell
filters: .github/code-freeze-filter.yaml
- name: Output Failure
if: steps.filters.outputs.changes != '' && !contains(github.event.pull_request.labels.*.name, 'override-freeze')
if: steps.filters.outputs.changes != '[]' && !contains(github.event.pull_request.labels.*.name, 'override-freeze')
run: |
TITLE="Code Freeze in Effect"
LEGIBLE_CHANGES=$(echo "${{ steps.filters.outputs.changes }}" | sed 's/,changed//g' | sed 's/,/, /g' | sed 's/[][]//g')
echo "### ${TITLE}" >> $GITHUB_STEP_SUMMARY
echo "This PR updates the following components which are code frozen: ${LEGIBLE_CHANGES}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The following files are modified and frozen:" >> $GITHUB_STEP_SUMMARY
IFS="," read -ra FILE_LIST <<< "${{ steps.filters.outputs.changed_files }}"
FILES="${{ steps.filters.outputs.changed_files }}"
FILE_MESSAGE="This file is under code freeze."
for FILE in "${FILE_LIST[@]}"; do
for FILE in $FILES; do
echo " - ${FILE}" >> $GITHUB_STEP_SUMMARY
echo "::error file=$FILE,title=$TITLE::$FILE_MESSAGE"
done
echo "" >> $GITHUB_STEP_SUMMARY
echo "Freeze can be overriden by adding the 'override-freeze' label to the PR." >> $GITHUB_STEP_SUMMARY
exit 1
- name: Output Bypass
if: steps.filters.outputs.changes != '' && !contains(github.event.pull_request.labels.*.name, 'override-freeze')
if: steps.filters.outputs.changes != '[]' && contains(github.event.pull_request.labels.*.name, 'override-freeze')
run: |
TITLE="Code Freeze in Effect - Bypassed"
LEGIBLE_CHANGES=$(echo "${{ steps.filters.outputs.changes }}" | sed 's/,changed//g' | sed 's/,/, /g' | sed 's/[][]//g')
echo "### ${TITLE}" >> $GITHUB_STEP_SUMMARY
echo "This PR updates the following components which are code frozen: ${LEGIBLE_CHANGES}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The following files are modified and frozen:" >> $GITHUB_STEP_SUMMARY
IFS="," read -ra FILE_LIST <<< "${{ steps.filters.outputs.changed_files }}"
FILES="${{ steps.filters.outputs.changed_files }}"
FILE_MESSAGE="This file is under code freeze."
for FILE in "${FILE_LIST[@]}"; do
for FILE in $FILES; do
echo " - ${FILE}" >> $GITHUB_STEP_SUMMARY
echo "::warning file=$FILE,title=$TITLE::$FILE_MESSAGE"
done
Expand Down
27 changes: 27 additions & 0 deletions charts/astrotrek/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: v2
name: astrotrek
description: A Helm chart for deploying a k8s sequencer explorer for the Astria Sequencer Network.

# 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.0.1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.0.1"

maintainers:
- name: quasystaty1
url: astria.org
18 changes: 18 additions & 0 deletions charts/astrotrek/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{/*
Namepsace to deploy elements into.
*/}}
{{- define "astrotrek.namespace" -}}
{{- default .Release.Namespace .Values.global.namespaceOverride | trunc 63 | trimSuffix "-" -}}
{{- end }}

{{- define "indexer.image" -}}
{{ .Values.images.indexer.repo }}:{{ if .Values.global.dev }}{{ .Values.images.indexer.devTag }}{{ else }}{{ .Values.images.indexer.tag }}{{ end }}
{{- end }}

{{- define "api.image" -}}
{{ .Values.images.api.repo }}:{{ if .Values.global.dev }}{{ .Values.images.api.devTag }}{{ else }}{{ .Values.images.api.tag }}{{ end }}
{{- end }}

{{- define "frontend.image" -}}
{{ .Values.images.frontend.repo }}:{{ if .Values.global.dev }}{{ .Values.images.frontend.devTag }}{{ else }}{{ .Values.images.frontend.tag }}{{ end }}
{{- end }}
29 changes: 29 additions & 0 deletions charts/astrotrek/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: api-env
name: env
data:
API_HOST: "{{ .Values.config.api.host }}"
API_PORT: "{{ .Values.ports.api }}"
API_PROMETHEUS_ENABLED: "{{ .Values.metrics.enabled }}"
API_RATE_LIMIT: "{{ .Values.config.api.rateLimit }}"
API_REQUEST_TIMEOUT: "{{ .Values.config.api.requestTimeout }}"
ASTRIA_ENV: "{{ .Values.config.astriaEnv }}"
INDEXER_BLOCK_PERIOD: "{{ .Values.config.indexer.indexerBlockPeriod }}"
INDEXER_SCRIPTS_DIR: "{{ .Values.config.indexer.indexerScriptDir }}"
INDEXER_THREADS_COUNT: "{{ .Values.config.indexer.indexerThreadsCount }}"
INDEXER_VIEWS_DIR: "{{ .Values.config.indexer.indexerViewsDir }}"
LOG_LEVEL: "{{ .Values.config.logLevel }}"
POSTGRES_DB: "{{ .Values.config.database.postgresDb }}"
POSTGRES_HOST: "{{ .Values.config.database.postgresHost }}"
POSTGRES_PASSWORD: "{{ .Values.config.database.postgresPassword }}"
POSTGRES_PORT: "{{ .Values.ports.db}}"
POSTGRES_USER: "{{ .Values.config.database.postgresUser }}"
PROFILER_SERVER: "{{ .Values.config.profilerServer }}"
SEQUENCER_RPC_RPS: "{{ .Values.config.sequencerRpcRps }}"
SEQUENCER_RPC_TIMEOUT: "{{ .Values.config.sequencerRpcTimeout }}"
SEQUENCER_RPC_URL: "{{ .Values.config.sequencerRpcUrl }}"
NUXT_PUBLIC_API_DEV: "{{ .Values.config.frontend.rpcApiUrl }}"
NUXT_PUBLIC_WSS_DEV: "{{ .Values.config.frontend.wsApiUrl }}"
63 changes: 63 additions & 0 deletions charts/astrotrek/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.config.name }}-indexer
labels:
app: {{ .Values.config.name }}-indexer
namespace: {{ .Values.global.namespace }}
spec:
replicas: {{ .Values.global.replicaCount }}
selector:
matchLabels:
app: {{ .Values.config.name }}-indexer
template:
metadata:
labels:
app: {{ .Values.config.name }}-indexer
spec:
containers:
- name: {{ .Values.config.name }}-indexer
image: {{ include "indexer.image" . }}
envFrom:
- configMapRef:
name: env
restartPolicy: Always
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: {{ .Values.global.namespace }}
labels:
app: {{ .Values.config.name }}-frontend
name: {{ .Values.config.name }}-frontend
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Values.config.name }}-frontend
template:
metadata:
labels:
app: {{ .Values.config.name }}-frontend
spec:
containers:
- args:
- npm
- run
- start
envFrom:
- configMapRef:
name: env
image: {{ include "frontend.image" . }}
name: {{ .Values.config.name }}-frontend
ports:
- containerPort: {{ .Values.ports.frontend }}
protocol: TCP
resources:
requests:
cpu: {{ .Values.resources.requests.cpu }}
memory: {{ .Values.resources.requests.memory }}
limits:
cpu: {{ .Values.resources.limits.cpu }}
memory: {{ .Values.resources.limits.memory }}
restartPolicy: Always
71 changes: 71 additions & 0 deletions charts/astrotrek/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Values.config.name }}-api-ingress
namespace: {{ .Values.global.namespace }}
annotations:
{{- with .Values.ingress.api.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.api.className }}
ingressClassName: {{ .Values.ingress.api.className }}
{{- end }}
rules:
- host: {{ .Values.ingress.api.host | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Values.config.name }}-indexer-api-service
port:
name: indexer-api
{{- if .Values.ingress.api.tls }}
tls:
{{- range .Values.ingress.api.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Values.config.name }}-frontend-ingress
namespace: {{ .Values.global.namespace }}
annotations:
{{- with .Values.ingress.frontend.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.frontend.className }}
ingressClassName: {{ .Values.ingress.frontend.className }}
{{- end }}
rules:
- host: {{ .Values.ingress.frontend.host | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Values.config.name }}-frontend-service
port:
number: {{ .Values.ports.frontend }}
{{- if .Values.ingress.frontend.tls }}
tls:
{{- range .Values.ingress.frontend.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
{{- end }}
44 changes: 44 additions & 0 deletions charts/astrotrek/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: {{ .Values.config.name }}
name: {{ .Values.config.name }}-db-service
namespace: {{ .Values.global.namespace }}
spec:
ports:
- name: "{{ .Values.ports.db }}"
port: {{ .Values.ports.db }}
targetPort: {{ .Values.ports.db }}
selector:
app: {{ .Values.config.name }}-db
---
apiVersion: v1
kind: Service
metadata:
labels:
app: {{ .Values.config.name }}-indexer-api
name: {{ .Values.config.name }}-indexer-api-service
namespace: {{ .Values.global.namespace }}
spec:
ports:
- name: indexer-api
port: {{ .Values.ports.api}}
targetPort: {{ .Values.ports.api}}
selector:
app: {{ .Values.config.name }}-indexer-api
---
apiVersion: v1
kind: Service
metadata:
labels:
app: {{ .Values.config.name }}-frontend
name: {{ .Values.config.name }}-frontend-service
namespace: {{ .Values.global.namespace }}
spec:
ports:
- name: "{{ .Values.ports.frontend }}"
port: {{ .Values.ports.frontend }}
targetPort: {{ .Values.ports.frontend }}
selector:
app: {{ .Values.config.name }}-frontend
36 changes: 36 additions & 0 deletions charts/astrotrek/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: astria-indexer-metrics
labels:
app: inderxer
{{- with .Values.serviceMonitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
jobLabel: astria-indexer-metrics
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
app: astria-indexer
endpoints:
- port: metrics
path: /metrics
{{- with .Values.serviceMonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
- port: astria-indexer-metrics
path: /metrics
{{- with .Values.serviceMonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
{{- end }}
Loading

0 comments on commit 2f4ae04

Please sign in to comment.