-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
244 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
{{- if .Values.blobSink.enabled }} | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{ include "aztec-network.fullname" . }}-blob-sink | ||
labels: | ||
{{- include "aztec-network.labels" . | nindent 4 }} | ||
spec: | ||
serviceName: {{ include "aztec-network.fullname" . }}-blob-sink | ||
replicas: {{ .Values.blobSink.replicas }} | ||
selector: | ||
matchLabels: | ||
{{- include "aztec-network.selectorLabels" . | nindent 6 }} | ||
app: blob-sink | ||
{{- if not .Values.storage.localSsd }} | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: blob-sink-data | ||
spec: | ||
accessModes: [ "ReadWriteOnce" ] | ||
resources: | ||
requests: | ||
storage: {{ .Values.blobSink.storageSize }} | ||
{{- end }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "aztec-network.selectorLabels" . | nindent 8 }} | ||
app: blob-sink | ||
spec: | ||
{{- if .Values.storage.localSsd }} | ||
{{- include "aztec-network.gcpLocalSsd" . | nindent 6 }} | ||
{{- end }} | ||
dnsPolicy: ClusterFirstWithHostNet | ||
{{- if .Values.network.public }} | ||
hostNetwork: true | ||
{{- include "aztec-network.publicAntiAffinity" . | nindent 6 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "aztec-network.fullname" . }}-node | ||
initContainers: | ||
containers: | ||
- name: blob-sink | ||
{{- include "aztec-network.image" . | nindent 10 }} | ||
command: | ||
- /bin/bash | ||
- -c | ||
- | | ||
env && \ | ||
node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js start --blob-sink | ||
startupProbe: | ||
httpGet: | ||
path: /status | ||
port: {{ .Values.bootNode.service.nodePort }} | ||
periodSeconds: {{ .Values.bootNode.startupProbe.periodSeconds }} | ||
failureThreshold: {{ .Values.bootNode.startupProbe.failureThreshold }} | ||
livenessProbe: | ||
httpGet: | ||
path: /status | ||
port: {{ .Values.bootNode.service.nodePort }} | ||
initialDelaySeconds: 30 | ||
periodSeconds: 5 | ||
timeoutSeconds: 30 | ||
failureThreshold: 3 | ||
volumeMounts: | ||
- name: blob-sink-data | ||
mountPath: {{ .Values.blobSink.dataDir }} | ||
env: | ||
- name: POD_IP | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.podIP | ||
- name: K8S_POD_UID | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.uid | ||
- name: K8S_POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: OTEL_SERVICE_NAME | ||
value: boot-node | ||
- name: K8S_NAMESPACE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: NODE_OPTIONS | ||
value: "--max-old-space-size={{ .Values.bootNode.maxOldSpaceSize}}" | ||
- name: BLOB_SINK_PORT | ||
value: "{{ .Values.blobSink.service.nodePort }}" | ||
- name: LOG_LEVEL | ||
value: "{{ .Values.bootNode.logLevel }}" | ||
- name: LOG_JSON | ||
value: "1" | ||
- name: DATA_DIRECTORY | ||
value: "{{ .Values.blobSink.dataDir }}" | ||
- name: DATA_STORE_MAP_SIZE_KB | ||
value: "{{ .Values.blobSink.storage.dataStoreMapSize }}" | ||
- name: USE_GCLOUD_OBSERVABILITY | ||
value: "{{ .Values.telemetry.useGcloudObservability }}" | ||
ports: | ||
- containerPort: {{ .Values.blobSink.service.nodePort }} | ||
resources: | ||
{{- toYaml .Values.blobSink.resources | nindent 12 }} | ||
volumes: | ||
- name: blob-sink-data | ||
emptyDir: {} | ||
{{- if .Values.storage.localSsd }} | ||
- name: blob-sink-data | ||
emptyDir: {} | ||
{{ else }} | ||
- name: blob-sink-data | ||
persistentVolumeClaim: | ||
claimName: blob-sink-data | ||
{{- end }} | ||
--- | ||
# Headless service for StatefulSet DNS entries | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "aztec-network.fullname" . }}-boot-node | ||
labels: | ||
{{- include "aztec-network.labels" . | nindent 4 }} | ||
spec: | ||
# If this is a public network, we want to expose the boot node as a LoadBalancer | ||
{{- if .Values.network.public }} | ||
type: LoadBalancer | ||
{{- else }} | ||
type: ClusterIP | ||
clusterIP: None | ||
{{- end }} | ||
selector: | ||
{{- include "aztec-network.selectorLabels" . | nindent 4 }} | ||
app: boot-node | ||
ports: | ||
- port: {{ .Values.blobSink.service.nodePort }} | ||
name: node | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { | ||
BlobSinkConfig, | ||
blobSinkConfigMappings, | ||
createBlobSinkServer, | ||
getBlobSinkConfigFromEnv, | ||
} from '@aztec/blob-sink/server'; | ||
import { type NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server'; | ||
import { type LogFn } from '@aztec/foundation/log'; | ||
import { createAndStartTelemetryClient, telemetryClientConfigMappings } from '@aztec/telemetry-client/start'; | ||
|
||
import { extractRelevantOptions } from '../util.js'; | ||
|
||
export async function startBlobSink(options: any, signalHandlers: (() => Promise<void>)[], userLog: LogFn) { | ||
if (options.prover || options.node || options.sequencer || options.pxe || options.p2pBootstrap || options.txe) { | ||
userLog(`Starting a prover-node with --node, --sequencer, --pxe, --p2p-bootstrap, or --txe is not supported.`); | ||
process.exit(1); | ||
} | ||
|
||
const blobSinkConfig = { | ||
...getBlobSinkConfigFromEnv(), // get default config from env | ||
...extractRelevantOptions<BlobSinkConfig>(options, blobSinkConfigMappings, 'blobSink'), // override with command line options | ||
}; | ||
|
||
const telemetry = await createAndStartTelemetryClient( | ||
extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'), | ||
); | ||
|
||
const blobSink = await createBlobSinkServer(blobSinkConfig, telemetry); | ||
signalHandlers.push(blobSink.stop.bind(blobSink)); | ||
|
||
await blobSink.start(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters