Skip to content

Commit

Permalink
chore: consolidate aztec node configurations (helm refactor) (#8731)
Browse files Browse the repository at this point in the history
This PR performs a refactor of the `aztec-network` helm chart. 
The primary focus of the refactor is to condense configurations relating
to each node, into a single file.

A portion of the yaml files were condensed in this way previously, but
the format had not been consistent across the helm chart.
  • Loading branch information
stevenplatt authored Sep 24, 2024
1 parent 18e2697 commit 9d248a2
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 122 deletions.
18 changes: 0 additions & 18 deletions spartan/aztec-network/templates/anvil.service.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,23 @@ spec:
successThreshold: {{ .Values.ethereum.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.ethereum.readinessProbe.failureThreshold }}
resources:
{{- toYaml .Values.ethereum.resources | nindent 12 }}
{{- toYaml .Values.ethereum.resources | nindent 12 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "aztec-network.fullname" . }}-ethereum
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
type: {{ .Values.ethereum.service.type }}
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: ethereum
ports:
- protocol: TCP
port: {{ .Values.ethereum.service.port }}
targetPort: {{ .Values.ethereum.service.targetPort }}
{{- if and (eq .Values.ethereum.service.type "NodePort") .Values.ethereum.service.nodePort }}
nodePort: {{ .Values.ethereum.service.nodePort }}
{{- end }}
16 changes: 0 additions & 16 deletions spartan/aztec-network/templates/boot-node.service.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,20 @@ spec:
- name: scripts
configMap:
name: {{ include "aztec-network.fullname" . }}-deploy-contracts-script
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "aztec-network.fullname" . }}-boot-node
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
clusterIP: None
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: boot-node
ports:
- port: {{ .Values.bootNode.service.p2pPort }}
name: p2p
- port: {{ .Values.bootNode.service.nodePort }}
name: node
38 changes: 0 additions & 38 deletions spartan/aztec-network/templates/deploy-l2-contracts.job.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "aztec-network.fullname" . }}-deploy-l2-contracts
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
template:
metadata:
labels:
{{- include "aztec-network.selectorLabels" . | nindent 8 }}
app: deploy-l2-contracts
spec:
restartPolicy: OnFailure
containers:
- name: deploy-l2-contracts
image: {{ .Values.images.aztec.image }}
command:
- /bin/bash
- -c
- |
until curl -s -X POST -H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","method":"pxe_getNodeInfo","params":[],"id":67}' \
{{ include "aztec-network.pxeUrl" . }} | grep -q '"enr:-'; do
echo "Waiting for PXE service..."
sleep 5
done
echo "PXE service is ready!"
set -e
node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js deploy-protocol-contracts
echo "Deployed L2 contracts"
env:
- name: PXE_URL
value: {{ include "aztec-network.pxeUrl" . | quote }}
- name: DEBUG
value: "aztec:*"
- name: LOG_LEVEL
value: "debug"
---
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
14 changes: 0 additions & 14 deletions spartan/aztec-network/templates/prover-node.service.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,18 @@ metadata:
data:
configure-prover-env.sh: |
{{ .Files.Get "files/config/config-prover-env.sh" | nindent 4 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "aztec-network.fullname" . }}-prover-node
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
clusterIP: None
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: prover-node
ports:
- port: {{ .Values.proverNode.service.nodePort }}
name: node
18 changes: 0 additions & 18 deletions spartan/aztec-network/templates/pxe.service.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,23 @@ spec:
successThreshold: {{ .Values.pxe.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.pxe.readinessProbe.failureThreshold }}
resources:
{{- toYaml .Values.pxe.resources | nindent 12 }}
{{- toYaml .Values.pxe.resources | nindent 12 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "aztec-network.fullname" . }}-pxe
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
type: {{ .Values.pxe.service.type }}
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: pxe
ports:
- protocol: TCP
port: {{ .Values.pxe.service.port }}
targetPort: {{ .Values.pxe.service.targetPort }}
{{- if and (eq .Values.pxe.service.type "NodePort") .Values.pxe.service.nodePort }}
nodePort: {{ .Values.pxe.service.nodePort }}
{{- end }}
16 changes: 0 additions & 16 deletions spartan/aztec-network/templates/validator.service.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,20 @@ metadata:
data:
configure-validator-env.sh: |
{{ .Files.Get "files/config/config-validator-env.sh" | nindent 4 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "aztec-network.fullname" . }}-validator
labels:
{{- include "aztec-network.labels" . | nindent 4 }}
spec:
clusterIP: None
selector:
{{- include "aztec-network.selectorLabels" . | nindent 4 }}
app: validator
ports:
- port: {{ .Values.validator.service.p2pPort }}
name: p2p
- port: {{ .Values.validator.service.nodePort }}
name: node

0 comments on commit 9d248a2

Please sign in to comment.