Skip to content

Commit

Permalink
Merge 890bcb7 into eab3897
Browse files Browse the repository at this point in the history
  • Loading branch information
nzenchik authored Dec 10, 2024
2 parents eab3897 + 890bcb7 commit 5a0f07f
Show file tree
Hide file tree
Showing 8 changed files with 328 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Pre Release Charts

on:
pull_request:

jobs:
release:
permissions:
contents: write # to push chart release and create a release (helm/chart-releaser-action)

runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Fetch history
run: git fetch --prune --unshallow

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.11.2

- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_SKIP_EXISTING: false
CR_MAKE_RELEASE_LATEST: false
7 changes: 7 additions & 0 deletions charts/blockscout-stack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# ChangeLog

## 1.9.0

### Feature

- Adding support for NFT storage
- Adding security context for migration jobs

## 1.8.0

### Feature
Expand Down
2 changes: 1 addition & 1 deletion charts/blockscout-stack/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: 1.8.0
version: 1.9.0-alpha

# 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
173 changes: 173 additions & 0 deletions charts/blockscout-stack/templates/blockscout-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ spec:
{{- if and .Values.blockscout.init.enabled (not .Values.blockscout.separateApi.enabled) }}
initContainers:
- name: init-migrations
securityContext:
{{- toYaml .Values.blockscout.securityContext | nindent 12 }}
image: "{{ .Values.blockscout.image.repository }}:{{ .Values.blockscout.image.tag }}"
resources:
{{- toYaml .Values.blockscout.resources | nindent 12 }}
Expand Down Expand Up @@ -116,6 +118,17 @@ spec:
- name: http
containerPort: 4000
protocol: TCP
{{- if and .Values.blockscout.nftStorage.enabled (not .Values.blockscout.separateApi.enabled) }}
- name: epmd
containerPort: 4369
protocol: TCP
- name: epmd-dyn-1
containerPort: 9138
protocol: TCP
- name: epmd-dyn-2
containerPort: 9139
protocol: TCP
{{- end }}
env:
{{- if .Values.blockscout.separateApi.enabled }}
- name: APPLICATION_MODE
Expand All @@ -126,6 +139,20 @@ spec:
{{- end }}
- name: PORT
value: "4000"
{{- if and .Values.blockscout.nftStorage.enabled (not .Values.blockscout.separateApi.enabled) }}
- name: NFT_MEDIA_HANDLER_ENABLED
value: 'true'
- name: NFT_MEDIA_HANDLER_REMOTE_DISPATCHER_NODE_MODE_ENABLED
value: 'true'
- name: RELEASE_NODE
value: 'indexer@{{ .Release.Name }}-blockscout-svc.{{ .Release.Namespace }}.svc.cluster.local'
- name: RELEASE_DISTRIBUTION
value: 'name'
- name: NFT_MEDIA_HANDLER_BACKFILL_ENABLED
value: 'true'
- name: ERL_AFLAGS
value: "-kernel inet_dist_listen_min 9138 inet_dist_listen_max 9139"
{{- end }}
- name: CHAIN_ID
value: {{ .Values.config.network.id | quote }}
{{- if and .Values.config.network.currency.symbol (not .Values.config.network.currency.dualToken) }}
Expand Down Expand Up @@ -278,6 +305,17 @@ spec:
- name: http
containerPort: 4000
protocol: TCP
{{- if .Values.blockscout.nftStorage.enabled }}
- name: epmd
containerPort: 4369
protocol: TCP
- name: epmd-dyn-1
containerPort: 9138
protocol: TCP
- name: epmd-dyn-2
containerPort: 9139
protocol: TCP
{{- end }}
env:
- name: APPLICATION_MODE
value: "indexer"
Expand All @@ -291,6 +329,20 @@ spec:
value: "true"
- name: API_V1_WRITE_METHODS_DISABLED
value: "true"
{{- if .Values.blockscout.nftStorage.enabled }}
- name: NFT_MEDIA_HANDLER_ENABLED
value: 'true'
- name: NFT_MEDIA_HANDLER_REMOTE_DISPATCHER_NODE_MODE_ENABLED
value: 'true'
- name: RELEASE_NODE
value: 'indexer@{{ .Release.Name }}-blockscout-indexer-svc.{{ .Release.Namespace }}.svc.cluster.local'
- name: RELEASE_DISTRIBUTION
value: 'name'
- name: NFT_MEDIA_HANDLER_BACKFILL_ENABLED
value: 'true'
- name: ERL_AFLAGS
value: "-kernel inet_dist_listen_min 9138 inet_dist_listen_max 9139"
{{- end }}
{{- if and .Values.config.network.currency.symbol (not .Values.config.network.currency.dualToken) }}
- name: COIN
value: {{ .Values.config.network.currency.symbol | quote }}
Expand Down Expand Up @@ -356,4 +408,125 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
---
{{- if .Values.blockscout.nftStorage.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "blockscout-stack.fullname" . }}-blockscout-resizer
labels:
app: {{ .Release.Name }}-blockscout-resizer
{{- include "blockscout-stack.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.blockscout.replicaCount }}
selector:
matchLabels:
app: {{ .Release.Name }}-blockscout-resizer
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/blockscout-secret.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app: {{ .Release.Name }}-blockscout-resizer
{{- include "blockscout-stack.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "blockscout-stack.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.blockscout.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-blockscout
securityContext:
{{- toYaml .Values.blockscout.securityContext | nindent 12 }}
image: "{{ .Values.blockscout.image.repository }}:{{ .Values.blockscout.image.tag }}"
resources:
{{- toYaml .Values.blockscout.nftStorage.resources | nindent 12 }}
imagePullPolicy: {{ .Values.blockscout.image.pullPolicy }}
{{- with .Values.blockscout.command }}
command: {{ . | toYaml | nindent 12 }}
{{- end }}
{{- with .Values.blockscout.args }}
args: {{ . | toYaml | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 4000
protocol: TCP
- name: epmd
containerPort: 4369
protocol: TCP
- name: epmd-dyn-1
containerPort: 9140
protocol: TCP
- name: epmd-dyn-2
containerPort: 9141
protocol: TCP
env:
- name: PORT
value: "4000"
- name: NFT_MEDIA_TMP_DIR
value: './images'
- name: NFT_MEDIA_HANDLER_ENABLED
value: 'true'
- name: NFT_MEDIA_HANDLER_REMOTE_DISPATCHER_NODE_MODE_ENABLED
value: 'true'
- name: NFT_MEDIA_HANDLER_IS_WORKER
value: 'true'
- name: NFT_MEDIA_HANDLER_NODES_MAP
{{- if .Values.blockscout.separateApi.enabled }}
value: '{"indexer@{{ .Release.Name }}-blockscout-indexer-svc.{{ .Release.Namespace }}.svc.cluster.local": "/{{ .Release.Name }}"}'
{{- else }}
value: '{"indexer@{{ .Release.Name }}-blockscout-svc.{{ .Release.Namespace }}.svc.cluster.local": "/{{ .Release.Name }}"}'
{{- end }}
- name: RELEASE_NODE
value: 'worker@{{ .Release.Name }}-blockscout-resizer-svc.{{ .Release.Namespace }}.svc.cluster.local'
- name: RELEASE_DISTRIBUTION
value: 'name'
- name: ERL_AFLAGS
value: "-kernel inet_dist_listen_min 9140 inet_dist_listen_max 9141"
envFrom:
- secretRef:
name: {{ include "blockscout-stack.fullname" . }}-blockscout-resizer
{{- if .Values.blockscout.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: {{ .Values.blockscout.readinessProbe.path }}
port: http
scheme: HTTP
{{- with .Values.blockscout.readinessProbe.params }}
{{- . | toYaml | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.blockscout.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: {{ .Values.blockscout.livenessProbe.path }}
port: http
scheme: HTTP
{{- with .Values.blockscout.livenessProbe.params }}
{{- . | toYaml | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.blockscout.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . | toYaml | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ metadata:
spec:
template:
spec:
securityContext:
{{- toYaml .Values.blockscout.podSecurityContext | nindent 8 }}
containers:
- name: blockscout-migrations
image: "{{ .Values.blockscout.image.repository }}:{{ .Values.blockscout.image.tag }}"
imagePullPolicy: {{ .Values.blockscout.image.pullPolicy }}
securityContext:
{{- toYaml .Values.blockscout.securityContext | nindent 12 }}
{{- with .Values.blockscout.init.command }}
command: {{ . | toYaml | nindent 12 }}
{{- end }}
Expand Down
21 changes: 21 additions & 0 deletions charts/blockscout-stack/templates/blockscout-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,28 @@ metadata:
{{- include "blockscout-stack.labels" . | nindent 4 }}
type: Opaque
data:
{{- if .Values.blockscout.nftStorage.enabled }}
RELEASE_COOKIE: {{ .Values.blockscout.nftStorage.cookie | b64enc }}
NFT_MEDIA_HANDLER_AWS_PUBLIC_BUCKET_URL: {{ .Values.blockscout.nftStorage.bucketUrl | b64enc }}
{{- end }}
{{- range $key, $value := .Values.blockscout.envFromSecret }}
{{ $key }}: {{ $value | b64enc }}
{{- end }}
---
{{- if .Values.blockscout.nftStorage.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "blockscout-stack.fullname" . }}-blockscout-resizer
labels:
{{- include "blockscout-stack.labels" . | nindent 4 }}
type: Opaque
data:
RELEASE_COOKIE: {{ .Values.blockscout.nftStorage.cookie | b64enc }}
NFT_MEDIA_HANDLER_AWS_BUCKET_HOST: {{ .Values.blockscout.nftStorage.bucketHost | b64enc }}
NFT_MEDIA_HANDLER_AWS_ACCESS_KEY_ID: {{ .Values.blockscout.nftStorage.accessKey | b64enc }}
NFT_MEDIA_HANDLER_AWS_SECRET_ACCESS_KEY: {{ .Values.blockscout.nftStorage.secretKey | b64enc }}
NFT_MEDIA_HANDLER_AWS_BUCKET_NAME: {{ .Values.blockscout.nftStorage.bucketName | b64enc }}
NFT_MEDIA_HANDLER_AWS_PUBLIC_BUCKET_URL: {{ .Values.blockscout.nftStorage.bucketUrl | b64enc }}
{{- end }}
{{- end }}
74 changes: 74 additions & 0 deletions charts/blockscout-stack/templates/blockscout-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,80 @@ spec:
targetPort: http
protocol: TCP
name: http
{{- if and .Values.blockscout.nftStorage.enabled (not .Values.blockscout.separateApi.enabled) }}
- port: 4369
targetPort: epmd
protocol: TCP
name: epmd
- port: 9138
targetPort: 9138
protocol: TCP
name: epmd-dyn-1
- port: 9139
targetPort: 9139
protocol: TCP
name: epmd-dyn-2
{{- end }}
selector:
app: {{ include "blockscout-stack.fullname" . }}-blockscout
---
{{- if .Values.blockscout.separateApi.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "blockscout-stack.fullname" . }}-blockscout-indexer-svc
labels:
app: {{ .Release.Name }}-blockscout-indexer-svc
{{- include "blockscout-stack.labels" . | nindent 4 }}
spec:
type: {{ .Values.blockscout.service.type }}
ports:
- port: {{ .Values.blockscout.service.port }}
targetPort: http
protocol: TCP
name: http
{{- if .Values.blockscout.nftStorage.enabled }}
- port: 4369
targetPort: epmd
protocol: TCP
name: epmd
- port: 9138
targetPort: 9138
protocol: TCP
name: epmd-dyn-1
- port: 9139
targetPort: 9139
protocol: TCP
name: epmd-dyn-2
{{- end }}
selector:
app: {{ .Release.Name }}-blockscout-indexer
{{- end }}
---
{{- if .Values.blockscout.nftStorage.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "blockscout-stack.fullname" . }}-blockscout-resizer-svc
labels:
app: {{ .Release.Name }}-blockscout-resizer-svc
{{- include "blockscout-stack.labels" . | nindent 4 }}
spec:
type: {{ .Values.blockscout.service.type }}
ports:
- port: 4369
targetPort: epmd
protocol: TCP
name: epmd
- port: 9140
targetPort: 9140
protocol: TCP
name: epmd-dyn-1
- port: 9141
targetPort: 9141
protocol: TCP
name: epmd-dyn-2
selector:
app: {{ .Release.Name }}-blockscout-resizer
{{- end }}
{{- end }}
Loading

0 comments on commit 5a0f07f

Please sign in to comment.