-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(spartan): blob sink in spartan #11307
Changes from 48 commits
f597ea8
abeb13c
76cc51d
ee07f27
fe5c7b9
0f60492
cbeb8db
4f13f27
4b916e9
1b9a6f2
a0b46d8
0732751
e79c0de
1878bf6
57801b3
02ef985
e060066
d5331b0
d03b3e0
1ecd034
47cb894
0c16770
f203d8e
b1f8add
46594e3
e1b9d9d
d384577
4f18b31
b830598
c2899dc
1aabedf
7979ab0
6161aec
2019164
437c18e
12f5c0e
8665065
66410f6
b2a2442
7781259
9187177
9a4a974
53e391d
f8f0d39
1d29a40
310e3af
2aa2918
cab3d5f
9ab8ad3
7124377
799e80d
24509d0
cee428f
8476296
e7b5402
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
{{- 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.dataStoreConfig.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.blobSink.service.nodePort }} | ||
periodSeconds: {{ .Values.blobSink.startupProbe.periodSeconds }} | ||
failureThreshold: {{ .Values.blobSink.startupProbe.failureThreshold }} | ||
livenessProbe: | ||
httpGet: | ||
path: /status | ||
port: {{ .Values.blobSink.service.nodePort }} | ||
initialDelaySeconds: 30 | ||
periodSeconds: 5 | ||
timeoutSeconds: 30 | ||
failureThreshold: 3 | ||
volumeMounts: | ||
- name: blob-sink-data | ||
mountPath: {{ .Values.blobSink.dataStoreConfig.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: blob-sink | ||
- name: K8S_NAMESPACE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: BLOB_SINK_PORT | ||
value: "{{ .Values.blobSink.service.nodePort }}" | ||
- name: LOG_LEVEL | ||
value: "{{ .Values.blobSink.logLevel }}" | ||
- name: LOG_JSON | ||
value: "1" | ||
- name: DATA_DIRECTORY | ||
value: "{{ .Values.blobSink.dataStoreConfig.dataDir }}" | ||
- name: DATA_STORE_MAP_SIZE_KB | ||
value: "{{ .Values.blobSink.dataStoreConfig.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 }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think a mistake here |
||
- 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" . }}-blob-sink | ||
labels: | ||
{{- include "aztec-network.labels" . | nindent 4 }} | ||
spec: | ||
{{- if .Values.network.public }} | ||
type: LoadBalancer | ||
{{- else }} | ||
type: ClusterIP | ||
clusterIP: None | ||
{{- end }} | ||
selector: | ||
{{- include "aztec-network.selectorLabels" . | nindent 4 }} | ||
app: blob-sink | ||
ports: | ||
- port: {{ .Values.blobSink.service.nodePort }} | ||
name: node | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,6 +198,8 @@ describe('Archiver', () => { | |
|
||
blocks.forEach(b => blobSinkClient.getBlobSidecar.mockResolvedValueOnce([makeBlobFromBlock(b)])); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. intentional duplicate? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch |
||
|
||
blocks.forEach(b => blobSinkClient.getBlobSidecar.mockResolvedValueOnce([makeBlobFromBlock(b)])); | ||
|
||
makeMessageSentEvent(98n, 1n, 0n); | ||
makeMessageSentEvent(99n, 1n, 1n); | ||
makeL2BlockProposedEvent(101n, 1n, blocks[0].archive.root.toString()); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { | ||
type BlobSinkConfig, | ||
blobSinkConfigMappings, | ||
createBlobSinkServer, | ||
getBlobSinkConfigFromEnv, | ||
} from '@aztec/blob-sink/server'; | ||
import { type LogFn } from '@aztec/foundation/log'; | ||
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client'; | ||
|
||
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 blob sink with --node, --sequencer, --pxe, --p2p-bootstrap, --prover 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 = initTelemetryClient(getTelemetryClientConfig()); | ||
|
||
const blobSink = await createBlobSinkServer(blobSinkConfig, telemetry); | ||
signalHandlers.push(blobSink.stop.bind(blobSink)); | ||
|
||
await blobSink.start(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could delete this