Save progress
This commit is contained in:
parent
26caaa04e1
commit
a8c1728e35
@ -18,4 +18,4 @@ COPY . /app
|
|||||||
# easter eggs 😝
|
# easter eggs 😝
|
||||||
RUN echo "PS1='🕵️:\[\033[1;36m\]\h \[\033[1;34m\]\W\[\033[0;35m\]\[\033[1;36m\]$ \[\033[0m\]'" >> ~/.bashrc
|
RUN echo "PS1='🕵️:\[\033[1;36m\]\h \[\033[1;34m\]\W\[\033[0;35m\]\[\033[1;36m\]$ \[\033[0m\]'" >> ~/.bashrc
|
||||||
|
|
||||||
ENTRYPOINT [ "/app/entrypoint.sh"]
|
ENTRYPOINT [ "poetry"]
|
||||||
|
6
Tiltfile
6
Tiltfile
@ -31,16 +31,20 @@ k8s_yaml(secret_from_dict("mev-inspect-db-credentials", inputs = {
|
|||||||
# }))
|
# }))
|
||||||
|
|
||||||
docker_build_with_restart("mev-inspect-py", ".",
|
docker_build_with_restart("mev-inspect-py", ".",
|
||||||
entrypoint="/app/entrypoint.sh",
|
entrypoint="poetry",
|
||||||
live_update=[
|
live_update=[
|
||||||
sync(".", "/app"),
|
sync(".", "/app"),
|
||||||
run("cd /app && poetry install",
|
run("cd /app && poetry install",
|
||||||
trigger="./pyproject.toml"),
|
trigger="./pyproject.toml"),
|
||||||
],
|
],
|
||||||
|
platform='linux/arm64',
|
||||||
)
|
)
|
||||||
k8s_yaml(helm('./k8s/mev-inspect', name='mev-inspect'))
|
k8s_yaml(helm('./k8s/mev-inspect', name='mev-inspect'))
|
||||||
k8s_resource(workload="mev-inspect", resource_deps=["postgresql-postgresql"])
|
k8s_resource(workload="mev-inspect", resource_deps=["postgresql-postgresql"])
|
||||||
|
|
||||||
|
k8s_yaml(helm('./k8s/mev-inspect-prices', name='mev-inspect-prices'))
|
||||||
|
k8s_resource(workload="mev-inspect-prices", resource_deps=["postgresql-postgresql"])
|
||||||
|
|
||||||
local_resource(
|
local_resource(
|
||||||
'pg-port-forward',
|
'pg-port-forward',
|
||||||
serve_cmd='kubectl port-forward --namespace default svc/postgresql 5432:5432',
|
serve_cmd='kubectl port-forward --namespace default svc/postgresql 5432:5432',
|
||||||
|
@ -21,8 +21,7 @@ spec:
|
|||||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||||
image: "{{ .Values.image.repository }}"
|
image: "{{ .Values.image.repository }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
command:
|
args:
|
||||||
- poetry
|
|
||||||
- run
|
- run
|
||||||
- inspect-many-blocks
|
- inspect-many-blocks
|
||||||
- {{ .Values.command.startBlockNumber | quote }}
|
- {{ .Values.command.startBlockNumber | quote }}
|
||||||
|
23
k8s/mev-inspect-prices/.helmignore
Normal file
23
k8s/mev-inspect-prices/.helmignore
Normal file
@ -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/
|
24
k8s/mev-inspect-prices/Chart.yaml
Normal file
24
k8s/mev-inspect-prices/Chart.yaml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: mev-inspect-prices
|
||||||
|
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"
|
62
k8s/mev-inspect-prices/templates/_helpers.tpl
Normal file
62
k8s/mev-inspect-prices/templates/_helpers.tpl
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "mev-inspect-prices.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 "mev-inspect-prices.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 "mev-inspect-prices.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Common labels
|
||||||
|
*/}}
|
||||||
|
{{- define "mev-inspect-prices.labels" -}}
|
||||||
|
helm.sh/chart: {{ include "mev-inspect-prices.chart" . }}
|
||||||
|
{{ include "mev-inspect-prices.selectorLabels" . }}
|
||||||
|
{{- if .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
|
{{- end }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Selector labels
|
||||||
|
*/}}
|
||||||
|
{{- define "mev-inspect-prices.selectorLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "mev-inspect-prices.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create the name of the service account to use
|
||||||
|
*/}}
|
||||||
|
{{- define "mev-inspect-prices.serviceAccountName" -}}
|
||||||
|
{{- if .Values.serviceAccount.create }}
|
||||||
|
{{- default (include "mev-inspect-prices.fullname" .) .Values.serviceAccount.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- default "default" .Values.serviceAccount.name }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
36
k8s/mev-inspect-prices/templates/cronjob.yaml
Normal file
36
k8s/mev-inspect-prices/templates/cronjob.yaml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: {{ include "mev-inspect-prices.fullname" . }}
|
||||||
|
spec:
|
||||||
|
completions: 1
|
||||||
|
ttlSecondsAfterFinished: 5
|
||||||
|
schedule: "*/1 * * * *"
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: {{ .Chart.Name }}
|
||||||
|
image: "{{ .Values.image.repository }}"
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
args:
|
||||||
|
- run
|
||||||
|
- fetch-all-prices
|
||||||
|
env:
|
||||||
|
- name: POSTGRES_HOST
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mev-inspect-db-credentials
|
||||||
|
key: host
|
||||||
|
- name: POSTGRES_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mev-inspect-db-credentials
|
||||||
|
key: username
|
||||||
|
- name: POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mev-inspect-db-credentials
|
||||||
|
key: password
|
||||||
|
restartPolicy: OnFailure
|
7
k8s/mev-inspect-prices/values.yaml
Normal file
7
k8s/mev-inspect-prices/values.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
image:
|
||||||
|
repository: mev-inspect-py
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
imagePullSecrets: []
|
||||||
|
nameOverride: ""
|
||||||
|
fullnameOverride: ""
|
@ -30,6 +30,7 @@ spec:
|
|||||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||||
image: "{{ .Values.image.repository }}"
|
image: "{{ .Values.image.repository }}"
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
args: ["run", "python", "loop.py"]
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
exec:
|
exec:
|
||||||
command:
|
command:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user