diff --git a/helm-charts/aztec-network/Chart.yaml b/helm-charts/aztec-network/Chart.yaml index 30dc41c37ae6..02c2b26fc804 100644 --- a/helm-charts/aztec-network/Chart.yaml +++ b/helm-charts/aztec-network/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 -name: spartan-network -description: A Helm chart for deploying the spartan-network +name: aztec-network +description: A Helm chart for deploying the aztec network type: application version: 0.1.0 -appVersion: '1.0.0' +appVersion: "1.0.0" diff --git a/helm-charts/aztec-network/templates/_helpers.tpl b/helm-charts/aztec-network/templates/_helpers.tpl index 807513c15a03..44febac82a7b 100644 --- a/helm-charts/aztec-network/templates/_helpers.tpl +++ b/helm-charts/aztec-network/templates/_helpers.tpl @@ -1,14 +1,14 @@ {{/* Expand the name of the chart. */}} -{{- define "spartan-network.name" -}} +{{- define "aztec-network.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Create chart name and version as used by the chart label. */}} -{{- define "spartan-network.chart" -}} +{{- define "aztec-network.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} @@ -17,7 +17,7 @@ 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 "spartan-network.fullname" -}} +{{- define "aztec-network.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -33,9 +33,9 @@ If release name contains chart name it will be used as a full name. {{/* Common labels */}} -{{- define "spartan-network.labels" -}} -helm.sh/chart: {{ include "spartan-network.chart" . }} -{{ include "spartan-network.selectorLabels" . }} +{{- define "aztec-network.labels" -}} +helm.sh/chart: {{ include "aztec-network.chart" . }} +{{ include "aztec-network.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -45,15 +45,15 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "spartan-network.selectorLabels" -}} -app.kubernetes.io/name: {{ include "spartan-network.name" . }} +{{- define "aztec-network.selectorLabels" -}} +app.kubernetes.io/name: {{ include "aztec-network.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} -{{- define "spartan-network.ethereumHost" -}} -http://{{ include "spartan-network.fullname" . }}-ethereum.{{ .Release.Namespace }}:{{ .Values.ethereum.service.port }} +{{- define "aztec-network.ethereumHost" -}} +http://{{ include "aztec-network.fullname" . }}-ethereum.{{ .Release.Namespace }}:{{ .Values.ethereum.service.port }} {{- end -}} -{{- define "spartan-network.pxeUrl" -}} -http://{{ include "spartan-network.fullname" . }}-pxe.{{ .Release.Namespace }}:{{ .Values.pxe.service.port }} +{{- define "aztec-network.pxeUrl" -}} +http://{{ include "aztec-network.fullname" . }}-pxe.{{ .Release.Namespace }}:{{ .Values.pxe.service.port }} {{- end -}} diff --git a/helm-charts/aztec-network/templates/anvil.deployment.yaml b/helm-charts/aztec-network/templates/anvil.deployment.yaml index 337944ab3da0..9aa0ee859bec 100644 --- a/helm-charts/aztec-network/templates/anvil.deployment.yaml +++ b/helm-charts/aztec-network/templates/anvil.deployment.yaml @@ -1,19 +1,19 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "spartan-network.fullname" . }}-ethereum + name: {{ include "aztec-network.fullname" . }}-ethereum labels: - {{- include "spartan-network.labels" . | nindent 4 }} + {{- include "aztec-network.labels" . | nindent 4 }} spec: replicas: {{ .Values.ethereum.replicas }} selector: matchLabels: - {{- include "spartan-network.selectorLabels" . | nindent 6 }} + {{- include "aztec-network.selectorLabels" . | nindent 6 }} app: ethereum template: metadata: labels: - {{- include "spartan-network.selectorLabels" . | nindent 8 }} + {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: ethereum spec: containers: diff --git a/helm-charts/aztec-network/templates/anvil.service.yaml b/helm-charts/aztec-network/templates/anvil.service.yaml index b1276be8b87f..c0eca3456c7e 100644 --- a/helm-charts/aztec-network/templates/anvil.service.yaml +++ b/helm-charts/aztec-network/templates/anvil.service.yaml @@ -1,13 +1,13 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "spartan-network.fullname" . }}-ethereum + name: {{ include "aztec-network.fullname" . }}-ethereum labels: - {{- include "spartan-network.labels" . | nindent 4 }} + {{- include "aztec-network.labels" . | nindent 4 }} spec: type: {{ .Values.ethereum.service.type }} selector: - {{- include "spartan-network.selectorLabels" . | nindent 4 }} + {{- include "aztec-network.selectorLabels" . | nindent 4 }} app: ethereum ports: - protocol: TCP diff --git a/helm-charts/aztec-network/templates/boot-node.service.yaml b/helm-charts/aztec-network/templates/boot-node.service.yaml index c470b852df63..ccaf38c0c065 100644 --- a/helm-charts/aztec-network/templates/boot-node.service.yaml +++ b/helm-charts/aztec-network/templates/boot-node.service.yaml @@ -1,13 +1,13 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "spartan-network.fullname" . }}-boot-node + name: {{ include "aztec-network.fullname" . }}-boot-node labels: - {{- include "spartan-network.labels" . | nindent 4 }} + {{- include "aztec-network.labels" . | nindent 4 }} spec: clusterIP: None selector: - {{- include "spartan-network.selectorLabels" . | nindent 4 }} + {{- include "aztec-network.selectorLabels" . | nindent 4 }} app: boot-node ports: - port: {{ .Values.bootNode.service.p2pPort }} diff --git a/helm-charts/aztec-network/templates/boot-node.stateful-set.yaml b/helm-charts/aztec-network/templates/boot-node.stateful-set.yaml index 4ccd63e0f733..875e23541546 100644 --- a/helm-charts/aztec-network/templates/boot-node.stateful-set.yaml +++ b/helm-charts/aztec-network/templates/boot-node.stateful-set.yaml @@ -1,20 +1,20 @@ apiVersion: apps/v1 kind: StatefulSet metadata: - name: {{ include "spartan-network.fullname" . }}-boot-node + name: {{ include "aztec-network.fullname" . }}-boot-node labels: - {{- include "spartan-network.labels" . | nindent 4 }} + {{- include "aztec-network.labels" . | nindent 4 }} spec: - serviceName: {{ include "spartan-network.fullname" . }}-boot-node + serviceName: {{ include "aztec-network.fullname" . }}-boot-node replicas: {{ .Values.bootNode.replicas }} selector: matchLabels: - {{- include "spartan-network.selectorLabels" . | nindent 6 }} + {{- include "aztec-network.selectorLabels" . | nindent 6 }} app: boot-node template: metadata: labels: - {{- include "spartan-network.selectorLabels" . | nindent 8 }} + {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: boot-node spec: initContainers: @@ -26,7 +26,7 @@ spec: - | until curl -s -X POST -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' \ - {{ include "spartan-network.ethereumHost" . }} | grep -q anvil; do + {{ include "aztec-network.ethereumHost" . }} | grep -q anvil; do echo "Waiting for Ethereum node..." sleep 5 done @@ -46,7 +46,7 @@ spec: mountPath: /scripts env: - name: ETHEREUM_HOST - value: {{ include "spartan-network.ethereumHost" . | quote }} + value: {{ include "aztec-network.ethereumHost" . | quote }} containers: - name: aztec image: {{ .Values.images.aztec.image }} @@ -69,7 +69,7 @@ spec: fieldRef: fieldPath: metadata.namespace - name: POD_DNS_NAME - value: "$(POD_NAME).{{ include "spartan-network.fullname" . }}-boot-node.$(POD_NAMESPACE).svc.cluster.local" + value: "$(POD_NAME).{{ include "aztec-network.fullname" . }}-boot-node.$(POD_NAMESPACE).svc.cluster.local" - name: PORT value: "{{ .Values.bootNode.service.nodePort }}" - name: LOG_LEVEL @@ -77,7 +77,7 @@ spec: - name: DEBUG value: "{{ .Values.bootNode.debug }}" - name: ETHEREUM_HOST - value: {{ include "spartan-network.ethereumHost" . | quote }} + value: {{ include "aztec-network.ethereumHost" . | quote }} - name: P2P_ENABLED value: "{{ .Values.bootNode.p2p.enabled }}" - name: P2P_TCP_ANNOUNCE_ADDR @@ -100,4 +100,4 @@ spec: emptyDir: {} - name: scripts configMap: - name: {{ include "spartan-network.fullname" . }}-deploy-contracts-script + name: {{ include "aztec-network.fullname" . }}-deploy-contracts-script diff --git a/helm-charts/aztec-network/templates/configure-validator-env.config-map.yaml b/helm-charts/aztec-network/templates/configure-validator-env.config-map.yaml index c2e78001109f..28904f5f5b49 100644 --- a/helm-charts/aztec-network/templates/configure-validator-env.config-map.yaml +++ b/helm-charts/aztec-network/templates/configure-validator-env.config-map.yaml @@ -1,16 +1,16 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "spartan-network.fullname" . }}-configure-validator-env + name: {{ include "aztec-network.fullname" . }}-configure-validator-env labels: - {{- include "spartan-network.labels" . | nindent 4 }} + {{- include "aztec-network.labels" . | nindent 4 }} data: configure-validator-env.sh: | #!/bin/sh set -e # Ask the bootnode for l1 contract addresses - output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js get-node-info -u http://{{ include "spartan-network.fullname" . }}-boot-node-0.{{ include "spartan-network.fullname" . }}-boot-node.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.bootNode.service.nodePort }}) + output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js get-node-info -u http://{{ include "aztec-network.fullname" . }}-boot-node-0.{{ include "aztec-network.fullname" . }}-boot-node.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.bootNode.service.nodePort }}) echo "$output" diff --git a/helm-charts/aztec-network/templates/deploy-contracts.config-map.yaml b/helm-charts/aztec-network/templates/deploy-contracts.config-map.yaml index 328c525ac7ee..157cb822dbdd 100644 --- a/helm-charts/aztec-network/templates/deploy-contracts.config-map.yaml +++ b/helm-charts/aztec-network/templates/deploy-contracts.config-map.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "spartan-network.fullname" . }}-deploy-contracts-script + name: {{ include "aztec-network.fullname" . }}-deploy-contracts-script labels: - {{- include "spartan-network.labels" . | nindent 4 }} + {{- include "aztec-network.labels" . | nindent 4 }} data: deploy-contracts.sh: | #!/bin/sh diff --git a/helm-charts/aztec-network/templates/pxe.deployment.yaml b/helm-charts/aztec-network/templates/pxe.deployment.yaml index 17ef7304a3dc..1dc77d49df20 100644 --- a/helm-charts/aztec-network/templates/pxe.deployment.yaml +++ b/helm-charts/aztec-network/templates/pxe.deployment.yaml @@ -1,19 +1,19 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "spartan-network.fullname" . }}-pxe + name: {{ include "aztec-network.fullname" . }}-pxe labels: - {{- include "spartan-network.labels" . | nindent 4 }} + {{- include "aztec-network.labels" . | nindent 4 }} spec: replicas: {{ .Values.pxe.replicas }} selector: matchLabels: - {{- include "spartan-network.selectorLabels" . | nindent 6 }} + {{- include "aztec-network.selectorLabels" . | nindent 6 }} app: pxe template: metadata: labels: - {{- include "spartan-network.selectorLabels" . | nindent 8 }} + {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: pxe spec: containers: @@ -26,12 +26,28 @@ spec: node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js start --pxe env: - name: ETHEREUM_HOST - value: "http://{{ include "spartan-network.fullname" . }}-ethereum.{{ .Release.Namespace }}:{{ .Values.ethereum.service.port }}" + value: "http://{{ include "aztec-network.fullname" . }}-ethereum.{{ .Release.Namespace }}:{{ .Values.ethereum.service.port }}" - name: AZTEC_NODE_URL - value: "http://{{ include "spartan-network.fullname" . }}-boot-node-0.{{ include "spartan-network.fullname" . }}-boot-node.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.bootNode.service.nodePort }}" + value: "http://{{ include "aztec-network.fullname" . }}-boot-node-0.{{ include "aztec-network.fullname" . }}-boot-node.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.bootNode.service.nodePort }}" ports: - name: http containerPort: {{ .Values.pxe.service.port }} protocol: TCP + readinessProbe: + exec: + command: + - /bin/bash + - -c + - | + curl -s -X POST -H 'content-type: application/json' \ + -d '{"jsonrpc":"2.0","method":"pxe_getNodeInfo","params":[],"id":67}' \ + 127.0.0.1:{{ .Values.pxe.service.port }} > /tmp/probe_output.txt && \ + cat /tmp/probe_output.txt && \ + grep -q '"enr:-' /tmp/probe_output.txt + initialDelaySeconds: {{ .Values.pxe.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.pxe.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.pxe.readinessProbe.timeoutSeconds }} + successThreshold: {{ .Values.pxe.readinessProbe.successThreshold }} + failureThreshold: {{ .Values.pxe.readinessProbe.failureThreshold }} resources: {{- toYaml .Values.pxe.resources | nindent 12 }} \ No newline at end of file diff --git a/helm-charts/aztec-network/templates/pxe.service.yaml b/helm-charts/aztec-network/templates/pxe.service.yaml index ef0d555c70bf..09e5d2c6db3e 100644 --- a/helm-charts/aztec-network/templates/pxe.service.yaml +++ b/helm-charts/aztec-network/templates/pxe.service.yaml @@ -1,13 +1,13 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "spartan-network.fullname" . }}-pxe + name: {{ include "aztec-network.fullname" . }}-pxe labels: - {{- include "spartan-network.labels" . | nindent 4 }} + {{- include "aztec-network.labels" . | nindent 4 }} spec: type: {{ .Values.pxe.service.type }} selector: - {{- include "spartan-network.selectorLabels" . | nindent 4 }} + {{- include "aztec-network.selectorLabels" . | nindent 4 }} app: pxe ports: - protocol: TCP diff --git a/helm-charts/aztec-network/templates/tests/run-tests.yaml b/helm-charts/aztec-network/templates/tests/run-tests.yaml index 065d81d11fbc..2608b24ffbe3 100644 --- a/helm-charts/aztec-network/templates/tests/run-tests.yaml +++ b/helm-charts/aztec-network/templates/tests/run-tests.yaml @@ -2,8 +2,7 @@ apiVersion: v1 kind: Pod metadata: name: "{{ .Release.Name }}-test" - labels: - {{- include "spartan-network.labels" . | nindent 4 }} + labels: {{- include "aztec-network.labels" . | nindent 4 }} annotations: "helm.sh/hook": test spec: @@ -17,4 +16,4 @@ spec: - name: SCENARIO value: {{ .Values.scenario }} - name: PXE_URL - value: {{ include "spartan-network.pxeUrl" . | quote }} + value: {{ include "aztec-network.pxeUrl" . | quote }} diff --git a/helm-charts/aztec-network/templates/validator.service.yaml b/helm-charts/aztec-network/templates/validator.service.yaml index 4e2a69ebf7a9..0a49e7d4e6b4 100644 --- a/helm-charts/aztec-network/templates/validator.service.yaml +++ b/helm-charts/aztec-network/templates/validator.service.yaml @@ -1,13 +1,13 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "spartan-network.fullname" . }}-validator + name: {{ include "aztec-network.fullname" . }}-validator labels: - {{- include "spartan-network.labels" . | nindent 4 }} + {{- include "aztec-network.labels" . | nindent 4 }} spec: clusterIP: None selector: - {{- include "spartan-network.selectorLabels" . | nindent 4 }} + {{- include "aztec-network.selectorLabels" . | nindent 4 }} app: validator ports: - port: {{ .Values.validator.service.p2pPort }} diff --git a/helm-charts/aztec-network/templates/validator.stateful-set.yaml b/helm-charts/aztec-network/templates/validator.stateful-set.yaml index 9b8a4f0f6eed..4a3281d55d5d 100644 --- a/helm-charts/aztec-network/templates/validator.stateful-set.yaml +++ b/helm-charts/aztec-network/templates/validator.stateful-set.yaml @@ -1,20 +1,20 @@ apiVersion: apps/v1 kind: StatefulSet metadata: - name: {{ include "spartan-network.fullname" . }}-validator + name: {{ include "aztec-network.fullname" . }}-validator labels: - {{- include "spartan-network.labels" . | nindent 4 }} + {{- include "aztec-network.labels" . | nindent 4 }} spec: - serviceName: {{ include "spartan-network.fullname" . }}-validator + serviceName: {{ include "aztec-network.fullname" . }}-validator replicas: {{ .Values.validator.replicas }} selector: matchLabels: - {{- include "spartan-network.selectorLabels" . | nindent 6 }} + {{- include "aztec-network.selectorLabels" . | nindent 6 }} app: validator template: metadata: labels: - {{- include "spartan-network.selectorLabels" . | nindent 8 }} + {{- include "aztec-network.selectorLabels" . | nindent 8 }} app: validator spec: initContainers: @@ -32,7 +32,7 @@ spec: mountPath: /scripts env: - name: ETHEREUM_HOST - value: {{ include "spartan-network.ethereumHost" . | quote }} + value: {{ include "aztec-network.ethereumHost" . | quote }} containers: - name: aztec image: "{{ .Values.images.aztec.image }}" @@ -54,7 +54,7 @@ spec: fieldRef: fieldPath: metadata.namespace - name: POD_DNS_NAME - value: "$(POD_NAME).{{ include "spartan-network.fullname" . }}-validator.$(POD_NAMESPACE).svc.cluster.local" + value: "$(POD_NAME).{{ include "aztec-network.fullname" . }}-validator.$(POD_NAMESPACE).svc.cluster.local" - name: PORT value: "{{ .Values.validator.service.nodePort }}" - name: LOG_LEVEL @@ -62,7 +62,7 @@ spec: - name: DEBUG value: "{{ .Values.validator.debug }}" - name: ETHEREUM_HOST - value: {{ include "spartan-network.ethereumHost" . | quote }} + value: {{ include "aztec-network.ethereumHost" . | quote }} - name: P2P_ENABLED value: "{{ .Values.validator.p2p.enabled }}" - name: P2P_TCP_ANNOUNCE_ADDR @@ -83,4 +83,4 @@ spec: emptyDir: {} - name: scripts configMap: - name: {{ include "spartan-network.fullname" . }}-configure-validator-env \ No newline at end of file + name: {{ include "aztec-network.fullname" . }}-configure-validator-env \ No newline at end of file diff --git a/helm-charts/aztec-network/values.yaml b/helm-charts/aztec-network/values.yaml index cc82820c8c9c..8bc6f9ef73ee 100644 --- a/helm-charts/aztec-network/values.yaml +++ b/helm-charts/aztec-network/values.yaml @@ -40,6 +40,12 @@ pxe: type: ClusterIP port: 8080 targetPort: 8080 + readinessProbe: + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 3 resources: {} ethereum: diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index 0a23ce4f5ed1..210c7120c6db 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -57,7 +57,7 @@ NETWORK_TEST: LOCALLY # Let docker compose know about the pushed tags above ENV AZTEC_DOCKER_TAG=$(git rev-parse HEAD) - IF $force_build || \ + IF [ "$force_build" = "true" ] || \ ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/aztec:$AZTEC_DOCKER_TAG" || \ ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep "aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG" WAIT @@ -69,17 +69,20 @@ NETWORK_TEST: RUN kind load docker-image aztecprotocol/aztec:$AZTEC_DOCKER_TAG # if fresh_install is true, delete the namespace - IF $fresh_install - RUN kubectl delete namespace $namespace --ignore-not-found=true --timeout=1m --wait=true --now + IF [ "$fresh_install" = "true" ] + RUN kubectl delete namespace $namespace --ignore-not-found=true --wait=true --now --timeout=10m END - RUN helm install aztec-network ../../helm-charts/aztec-network \ + RUN helm install spartan ../../helm-charts/aztec-network \ --namespace $namespace --create-namespace \ --set images.test.image="aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG" \ --set images.aztec.image="aztecprotocol/aztec:$AZTEC_DOCKER_TAG" \ --set test="$test" - RUN helm test aztec-network --namespace $namespace --timeout 30m + + RUN kubectl wait pod -l app==pxe --for=condition=Ready -n $namespace --timeout=10m + + RUN helm test spartan --namespace $namespace --timeout 30m e2e-p2p: DO +E2E_TEST --test=./src/e2e_p2p_network.test.ts @@ -290,6 +293,5 @@ e2e-devnet-smoke: DO +E2E_COMPOSE_TEST --test=devnet/e2e_smoke.test.ts --compose_file=scripts/docker-compose-devnet.yml - -network-hello-world: - DO +NETWORK_TEST --fresh_install=true --namespace=aztec-smoke --test=./src/spartan/hello_world.test.ts +network-smoke: + DO +NETWORK_TEST --fresh_install=true --namespace=smoke --test=./src/spartan/smoke.test.ts diff --git a/yarn-project/end-to-end/scripts/forward_k8s_dashboard.sh b/yarn-project/end-to-end/scripts/forward_k8s_dashboard.sh new file mode 100755 index 000000000000..3cfef4b82418 --- /dev/null +++ b/yarn-project/end-to-end/scripts/forward_k8s_dashboard.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +# spit out the token for the dashboard +kubectl -n kubernetes-dashboard create token admin-user --duration 300000m +# forward the dashboard +kubectl -n kubernetes-dashboard port-forward svc/kubernetes-dashboard-kong-proxy 8443:443 diff --git a/yarn-project/end-to-end/scripts/setup_local_k8s.sh b/yarn-project/end-to-end/scripts/setup_local_k8s.sh new file mode 100755 index 000000000000..0aa132c8808f --- /dev/null +++ b/yarn-project/end-to-end/scripts/setup_local_k8s.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +set -e + +# exit if we are not on linux amd64 +if [ "$(uname)" != "Linux" ] || [ "$(uname -m)" != "x86_64" ]; then + echo "This script is only supported on Linux amd64" + exit 1 +fi + +curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" +chmod +x kubectl +sudo mv kubectl /usr/local/bin/kubectl + +# Install kind +[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-$(uname)-amd64 +chmod +x ./kind +sudo mv ./kind /usr/local/bin/kind + +# Install helm +curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash + +kind create cluster + +# Install the Kubernetes Dashboard +helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/ +helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard + + +# Create the ServiceAccount for the Kubernetes Dashboard +kubectl apply -f - < { - it('should pass', () => { - expect(true).toBe(true); - }); -}); diff --git a/yarn-project/end-to-end/src/spartan/smoke.test.ts b/yarn-project/end-to-end/src/spartan/smoke.test.ts new file mode 100644 index 000000000000..c43032e3af5a --- /dev/null +++ b/yarn-project/end-to-end/src/spartan/smoke.test.ts @@ -0,0 +1,22 @@ +import { PXE, createCompatibleClient } from '@aztec/aztec.js'; +import { createDebugLogger } from '@aztec/foundation/log'; + +const { PXE_URL } = process.env; +if (!PXE_URL) { + throw new Error('PXE_URL env variable must be set'); +} +const debugLogger = createDebugLogger('aztec:spartan-test'); +// const userLog = createConsoleLogger(); + +describe('sample test', () => { + let pxe: PXE; + beforeAll(async () => { + pxe = await createCompatibleClient(PXE_URL, debugLogger); + }); + it('should be able to get node enr', async () => { + const info = await pxe.getNodeInfo(); + expect(info).toBeDefined(); + // expect enr to be a string starting with 'enr:-' + expect(info.enr).toMatch(/^enr:-/); + }); +});