From 40269d2f475cd07e1c8619915d4b7a4afa7d0b0d Mon Sep 17 00:00:00 2001 From: Jeromy Cannon Date: Fri, 6 Sep 2024 19:32:22 +0100 Subject: [PATCH] feat: update Helm charts to handle Hedera Docker container deterministic image (#968) Signed-off-by: Jeromy Cannon --- .github/workflows/support/ci_test.sh | 5 +++- charts/fullstack-deployment/Chart.lock | 6 ++--- .../templates/network-node-statefulset.yaml | 24 +++++++++++++++++-- .../tests/test_basic_deployment.bats | 3 +++ 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/support/ci_test.sh b/.github/workflows/support/ci_test.sh index 5b0b5d09c..6acda66ae 100755 --- a/.github/workflows/support/ci_test.sh +++ b/.github/workflows/support/ci_test.sh @@ -75,9 +75,12 @@ echo "Get service and pod information" kubectl get svc -o wide && \ kubectl get pods -o wide && \ -echo "Waiting for network-node pods to be active (first deployment takes ~10m)...." +echo "Waiting for network-node pods to be phase=running (first deployment takes ~10m)...." kubectl wait --for=jsonpath='{.status.phase}'=Running pod -l fullstack.hedera.com/type=network-node --timeout=900s +echo "Waiting for network-node pods to be condition=ready (first deployment takes ~10m)...." +kubectl wait --for=condition=ready pod -l fullstack.hedera.com/type=network-node --timeout=900s + echo "Service Information...." kubectl get svc -o wide diff --git a/charts/fullstack-deployment/Chart.lock b/charts/fullstack-deployment/Chart.lock index c4e57b209..8aa8ab8eb 100644 --- a/charts/fullstack-deployment/Chart.lock +++ b/charts/fullstack-deployment/Chart.lock @@ -4,7 +4,7 @@ dependencies: version: 0.2.0 - name: hedera-mirror repository: https://hashgraph.github.io/hedera-mirror-node/charts - version: 0.110.1 + version: 0.111.1 - name: tenant repository: https://operator.min.io/ version: 5.0.12 @@ -14,5 +14,5 @@ dependencies: - name: haproxy-ingress repository: https://haproxy-ingress.github.io/charts version: 0.14.5 -digest: sha256:0e6897144860871142fd0db8c0a34fc113dc66121aa50c1482e89d932d323af8 -generated: "2024-08-09T12:47:26.726721+01:00" +digest: sha256:ca8cade42bbfa3211fde7112cb0998e8c7c86587c9113b10f2cbd209683113b0 +generated: "2024-09-06T10:44:29.620625+01:00" diff --git a/charts/fullstack-deployment/templates/network-node-statefulset.yaml b/charts/fullstack-deployment/templates/network-node-statefulset.yaml index e7076b7b6..df541734d 100644 --- a/charts/fullstack-deployment/templates/network-node-statefulset.yaml +++ b/charts/fullstack-deployment/templates/network-node-statefulset.yaml @@ -156,7 +156,6 @@ spec: task() { mkdir -p /opt/hgcapp/recordStreams/record{{ $node.accountId }}/sidecar chmod 777 /opt/hgcapp/recordStreams/record{{ $node.accountId }}/sidecar - curl network-{{ $node.name }}-0.network-{{ $node.name }}.{{ default $.Release.Namespace $.Values.global.namespaceOverride }}.svc.cluster.local:13133 } task failureThreshold: 30 @@ -537,8 +536,29 @@ spec: {{- toYaml . | nindent 10 }} {{- end }} {{- end }} - {{- if gt $initContainersLength 0 }} initContainers: + - name: init-hedera + image: curlimages/curl:8.9.1 + command: + - "sh" + - "-c" + - | + loop=1 + while [ "$loop" -ne 0 ]; do + loop=0; + {{- range $index, $node := $.Values.hedera.nodes }} + nslookup network-{{ $node.name }}-0.network-{{ $node.name }}.{{ default $.Release.Namespace $.Values.global.namespaceOverride }}.svc.cluster.local; + rc=$?; + if [ "$loop" -eq 0 -a "$rc" -eq 0 ]; then + loop=0; + else + loop=1; + fi + {{- end }} + sleep 5; + done + return 0 + {{- if gt $initContainersLength 0 }} {{- toYaml $.Values.hedera.initContainers | nindent 8 }} {{- end }} {{ end }} diff --git a/charts/fullstack-deployment/tests/test_basic_deployment.bats b/charts/fullstack-deployment/tests/test_basic_deployment.bats index 69f0b31b0..e352a58f9 100644 --- a/charts/fullstack-deployment/tests/test_basic_deployment.bats +++ b/charts/fullstack-deployment/tests/test_basic_deployment.bats @@ -10,7 +10,10 @@ setup() { log_debug "Expected total nodes: ${TOTAL_NODES}" log_debug "----------------------------------------------------------------------------" + log_debug "Waiting for network node pods to be phase=running..." kubectl wait --for=jsonpath='{.status.phase}'=Running pod -l fullstack.hedera.com/type=network-node --timeout=300s -n "${NAMESPACE}" || return "${EX_ERR}" + log_debug "Waiting for network node pods to be condition=ready..." + kubectl wait --for=condition=ready pod -l fullstack.hedera.com/type=network-node --timeout=300s -n "${NAMESPACE}" || return "${EX_ERR}" local resp="$(get_pod_list network-node)" local nodes=(${resp}) # convert into an array