From 6fffa75f3a8b0a90a6276dd68f668c558ff9515b Mon Sep 17 00:00:00 2001 From: Chao Zhang Date: Mon, 19 Dec 2022 22:03:29 +0100 Subject: [PATCH] remove traces of tezedge (#512) * remove traces of tezedge Tezedge has been deprecated, removing this option from tezos-k8s. * switch else statement per review --- charts/tezos/templates/_containers.tpl | 25 +++++---------- charts/tezos/templates/nodes.yaml | 1 - charts/tezos/values.yaml | 19 +++++------- docs/Private-Chain.md | 22 ++------------ test/charts/mainnet.expect.yaml | 2 +- test/charts/mainnet2.expect.yaml | 40 +++++++++++++++++++----- test/charts/private-chain.expect.yaml | 42 ++++++++++++++++++++------ utils/config-generator.sh | 30 ------------------ 8 files changed, 83 insertions(+), 98 deletions(-) diff --git a/charts/tezos/templates/_containers.tpl b/charts/tezos/templates/_containers.tpl index 597add77b..913319ad9 100644 --- a/charts/tezos/templates/_containers.tpl +++ b/charts/tezos/templates/_containers.tpl @@ -28,7 +28,7 @@ * name the name of the container, defaults to type, this * is used for containers like baker which can have * multiple instances of the same type - * image one of: octez, tezedge, utils + * image one of: octez, utils * command the command * args the list of arguments to the command, will default * to the type if using a "utils" image @@ -88,8 +88,6 @@ {{- $node_vals_images := $.node_vals.images | default dict }} {{- if eq .image "octez" }} image: "{{ or $node_vals_images.octez $.Values.images.octez }}" -{{- else if eq .image "tezedge" }} - image: "{{ or $node_vals_images.tezedge $.Values.images.tezedge }}" {{- else }} image: "{{ $.Values.tezos_k8s_images.utils }}" {{- end }} @@ -156,8 +154,7 @@ - mountPath: /etc/tezos/per-block-votes name: per-block-votes {{- end }} - {{- if (or (eq .type "octez-node") - (eq .type "tezedge-node")) }} + {{- if (eq .type "octez-node") }} ports: - containerPort: 8732 name: tezos-rpc @@ -259,19 +256,11 @@ {{- end }} {{- define "tezos.container.node" }} -{{- if eq (include "tezos.getNodeImplementation" $) "octez" }} - {{- $octezNodeParams := dict "root" $ - "type" "octez-node" - "image" "octez" - "with_config" 0 - -}} - - {{- if hasKey $.node_vals "resources" }} - {{- $_ := set $octezNodeParams "resources" $.node_vals.resources -}} - {{- end }} - - {{- include "tezos.generic_container" $octezNodeParams | nindent 0 }} -{{- end }} + {{- include "tezos.generic_container" (dict "root" $ + "type" "octez-node" + "image" "octez" + "with_config" 0 + ) | nindent 0 }} {{- end }} {{- define "tezos.container.bakers" }} diff --git a/charts/tezos/templates/nodes.yaml b/charts/tezos/templates/nodes.yaml index 3ac17e082..4edb0267d 100644 --- a/charts/tezos/templates/nodes.yaml +++ b/charts/tezos/templates/nodes.yaml @@ -32,7 +32,6 @@ spec: spec: containers: {{- include "tezos.container.node" $ | indent 8 }} - {{- include "tezos.container.tezedge" $ | indent 8 }} {{- include "tezos.container.accusers" $ | indent 8 }} {{- include "tezos.container.bakers" $ | indent 8 }} {{- include "tezos.container.logger" $ | indent 8 }} diff --git a/charts/tezos/values.yaml b/charts/tezos/values.yaml index 1682ee8dc..4a41cbb27 100644 --- a/charts/tezos/values.yaml +++ b/charts/tezos/values.yaml @@ -9,7 +9,6 @@ is_invitation: false # Images not part of the tezos-k8s repo go here images: octez: tezos/tezos:v14-release - tezedge: tezedge/tezedge:v1.6.8 # Images that are part of the tezos-k8s repo go here with 'dev' tag tezos_k8s_images: utils: ghcr.io/oxheadalpha/tezos-k8s-utils:master @@ -116,13 +115,11 @@ should_generate_unsafe_deterministic_data: false # - "storage_size": the size of the PV # - "resources": resources specifications for the node. # - "images": Optional specification of images to use for the tezos node and -# baker. Options are "octez" with a tezos/tezos image or -# "tezedge" with a tezedge/tezedge image. If no images are provided, -# the containers will default to the images defined in the "images" -# field up above. -# - "runs": A list of containers to run. A tezos node implementation is required. -# Options being "octez_node" or "tezedge_node". Other optional -# containers are "accuser", "baker", "logger" and "vdf". +# baker. Options are "octez" with a tezos/tezos image. +# If no images are provided, the containers will default to the images +# defined in the "images" field up above. +# - "runs": A list of containers to run. +# Options being "octez_node", "accuser", "baker", "logger" and "vdf". # - "local_storage": use local storage instead of a volume. The storage will be # wiped when the node restarts for any reason. Useful when # faster IO is desired. Defaults to false. @@ -187,11 +184,9 @@ should_generate_unsafe_deterministic_data: false # storage_size: 15Gi # images: # (optional field) # octez: tezos/tezos:v... -# # tezedge: tezedge/tezedg:v... # local_storage: false # runs: # - octez_node -# # - tezedge_node # - baker # # You can optionally set resources and limits for your octez node/baker # # See: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ @@ -219,8 +214,8 @@ should_generate_unsafe_deterministic_data: false # peer_node: "true" # rpc_node: "true" # images: # (optional field) -# tezedge: tezedge/tezedge:v... -# runs: ["tezedge_node"] +# octez: tezos/tezos:v... +# runs: ["octez_node"] # instances: # - {} # - {} diff --git a/docs/Private-Chain.md b/docs/Private-Chain.md index 34a23d2d2..17f768bb5 100644 --- a/docs/Private-Chain.md +++ b/docs/Private-Chain.md @@ -109,7 +109,7 @@ Said names are traditionally kebab case. At the statefulset level, the following parameters are allowed: - storage_size: the size of the PV - - runs: a list of containers to run, e.g. "baker", "tezedge" + - runs: a list of containers to run, e.g. "baker", "accuser" - instances: a list of nodes to fire up, each is a dictionary defining: - `bake_using_account`: The name of the account that should be used @@ -121,11 +121,6 @@ At the statefulset level, the following parameters are allowed: defaults are filled in for most values. -Each statefulset can run either Nomadic Lab's `tezos-node` or TezEdge's -`tezedge` node. Either can support all of the other containers. If you -specify `tezedge` as one of the containers to run, then it will be run -in preference to `tezos-node`. - E.g.: ``` @@ -145,29 +140,16 @@ nodes: instances: - {} - {} - tezedge-full-node: - runs: - - baker - - logger - - tezedge - instances: - - {} - - {} - - {} ``` This will run the following nodes: - `baking-node-0` - `full-node-0` - `full-node-1` - - `tezedge-full-node-0` - - `tezedge-full-node-1` - - `tezedge-full-node-2` `baking-node-0` will run baker and logger containers and will be the only bootstrap node. `full-node-*` are just nodes -with no extras. `tezedge-full-node-*` will be tezedge nodes running baker -and logger containers. +with no extras. To upgrade your Helm release run: diff --git a/test/charts/mainnet.expect.yaml b/test/charts/mainnet.expect.yaml index 6c5737f54..41ee85467 100644 --- a/test/charts/mainnet.expect.yaml +++ b/test/charts/mainnet.expect.yaml @@ -168,7 +168,7 @@ spec: readinessProbe: httpGet: path: /is_synced - port: 31732 + port: 31732 - name: sidecar image: "ghcr.io/oxheadalpha/tezos-k8s-utils:master" imagePullPolicy: IfNotPresent diff --git a/test/charts/mainnet2.expect.yaml b/test/charts/mainnet2.expect.yaml index 93e0028da..ef230ab86 100644 --- a/test/charts/mainnet2.expect.yaml +++ b/test/charts/mainnet2.expect.yaml @@ -174,18 +174,44 @@ spec: appType: tezos-node node_class: city-block spec: - containers: - - name: tezedge-node - image: "tezedge/tezedge:v1.6.8" + containers: + - name: octez-node + image: "tezos/tezos:v14-release" imagePullPolicy: IfNotPresent command: - - /light-node + - /bin/sh args: - - --config-file=/etc/tezos/tezedge.conf + - "-c" + - | + set -x + + set + + # ensure we can run tezos-client commands without specifying client dir + ln -s /var/tezos/client /home/tezos/.tezos-client + # + # Not every error is fatal on start. In particular, with zerotier, + # the listen-addr may not yet be bound causing tezos-node to fail. + # So, we try a few times with increasing delays: + + for d in 1 1 5 10 20 60 120; do + /usr/local/bin/tezos-node run \ + --bootstrap-threshold 0 \ + --config-file /etc/tezos/config.json + sleep $d + done + + # + # Keep the container alive for troubleshooting on failures: + + sleep 3600 + envFrom: env: - name: DAEMON - value: tezedge-node + value: octez-node + - name: TEZOS_LOG + value: "* -> DEBUG" - name: key value: "outer-value" volumeMounts: @@ -561,7 +587,7 @@ spec: readinessProbe: httpGet: path: /is_synced - port: 31732 + port: 31732 - name: logger image: "ghcr.io/oxheadalpha/tezos-k8s-utils:master" imagePullPolicy: IfNotPresent diff --git a/test/charts/private-chain.expect.yaml b/test/charts/private-chain.expect.yaml index b591816af..00139063d 100644 --- a/test/charts/private-chain.expect.yaml +++ b/test/charts/private-chain.expect.yaml @@ -323,18 +323,42 @@ spec: node_class: af baking_node: "true" spec: - containers: - - name: tezedge-node - image: "tezedge/tezedge:v1.6.8" + containers: + - name: octez-node + image: "tezos/tezos:v14-release" imagePullPolicy: IfNotPresent command: - - /light-node + - /bin/sh args: - - --config-file=/etc/tezos/tezedge.conf + - "-c" + - | + set -x + + set + + # ensure we can run tezos-client commands without specifying client dir + ln -s /var/tezos/client /home/tezos/.tezos-client + # + # Not every error is fatal on start. In particular, with zerotier, + # the listen-addr may not yet be bound causing tezos-node to fail. + # So, we try a few times with increasing delays: + + for d in 1 1 5 10 20 60 120; do + /usr/local/bin/tezos-node run \ + --bootstrap-threshold 0 \ + --config-file /etc/tezos/config.json + sleep $d + done + + # + # Keep the container alive for troubleshooting on failures: + + sleep 3600 + envFrom: env: - name: DAEMON - value: tezedge-node + value: octez-node volumeMounts: - mountPath: /etc/tezos name: config-volume @@ -643,7 +667,7 @@ spec: readinessProbe: httpGet: path: /is_synced - port: 31732 + port: 31732 - name: sidecar image: "ghcr.io/oxheadalpha/tezos-k8s-utils:master" imagePullPolicy: IfNotPresent @@ -847,7 +871,7 @@ spec: readinessProbe: httpGet: path: /is_synced - port: 31732 + port: 31732 - name: baker-013-ptjakart image: "tezos/tezos:v14-release" imagePullPolicy: IfNotPresent @@ -1141,7 +1165,7 @@ spec: readinessProbe: httpGet: path: /is_synced - port: 31732 + port: 31732 - name: baker-013-ptjakart image: "tezos/tezos:v14-release" imagePullPolicy: IfNotPresent diff --git a/utils/config-generator.sh b/utils/config-generator.sh index d9887590d..505f09e49 100755 --- a/utils/config-generator.sh +++ b/utils/config-generator.sh @@ -10,36 +10,6 @@ chmod -R 777 /var/tezos set -e python3 /config-generator.py "$@" set +e - -# -# Generate the tezedge configuration file: - -cat > /etc/tezos/tezedge.conf <> /etc/tezos/tezedge.conf - # # Next we write the current baker account into /etc/tezos/baking-account. # We do it here because we shall use jq to process some of the environment