diff --git a/.github/workflows/support/scripts/direct-install.sh b/.github/workflows/support/scripts/direct-install.sh index c4841619d..4836c1175 100644 --- a/.github/workflows/support/scripts/direct-install.sh +++ b/.github/workflows/support/scripts/direct-install.sh @@ -92,6 +92,10 @@ function start_node_all() { verify_node_all || return "${EX_ERR}" + sleep 2 + + verify_haproxy || return "${EX_ERR}" + return "${EX_OK}" } diff --git a/.github/workflows/support/scripts/env.sh b/.github/workflows/support/scripts/env.sh index 9fd27b87c..12c202c4c 100644 --- a/.github/workflows/support/scripts/env.sh +++ b/.github/workflows/support/scripts/env.sh @@ -46,34 +46,11 @@ function show_env_vars() { echo "NAMESPACE: ${NAMESPACE}" echo "SCRIPT_DIR: ${SCRIPT_DIR}" echo "TMP_DIR: ${TMP_DIR}" + echo "NODE_NAMES: ${NODE_NAMES[*]}" echo "-----------------------------------------------------------------------------------------------------" echo "" } -function setup_tmp_dir() { - if [ ! -f "${TMP_DIR}/.env" ]; then \ - echo "Creating .env file from template.env" - cp "${SCRIPT_DIR}/template.env" "${TMP_DIR}/.env" - echo "File list in ${TMP_DIR}" - ls -la "${TMP_DIR}" - fi -} - -function load_env_file() { - setup_tmp_dir - if [ -f "${TMP_DIR}/.env" ]; then \ - echo "Loading .env file: ${TMP_DIR}/.env" - set -a - # shellcheck source=./../temp/.env - source "${TMP_DIR}/.env" - set +a - fi -} - -function setup() { - load_env_file -} - function parse_minor_version() { local platform_version="$1" IFS=. read -a VERSION_PARTS <<< "$platform_version" @@ -103,20 +80,19 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" readonly TMP_DIR="${SCRIPT_DIR}/../temp" readonly CLUSTER_SETUP_VALUES_FILE="${TMP_DIR}/cluster-values.yaml" mkdir -p "$TMP_DIR" -load_env_file USER="${USER:-changeme}" CLUSTER_NAME="${CLUSTER_NAME:-fst}" NAMESPACE="${NAMESPACE:-fst-${USER}}" RELEASE_NAME="${RELEASE_NAME:-fst}" -NMT_VERSION=v2.0.0-alpha.0 -PLATFORM_VERSION=v0.39.1 +NMT_VERSION=v1.2.4 +PLATFORM_VERSION=v0.49.0-alpha.2 POD_MONITOR_ROLE="${POD_MONITOR_ROLE:-pod-monitor-role}" GATEWAY_CLASS_NAME="${GATEWAY_CLASS_NAME:-fst-gateway-class}" #NODE_NAMES=(node0 node1 node2 node3) -NODE_NAMES=(node0) +NODE_NAMES=(node0 node1 node2) POD_MONITOR_ROLE="${POD_MONITOR_ROLE:-pod-monitor-role}" GATEWAY_CLASS_NAME="${GATEWAY_CLASS_NAME:-fst-gateway-class}" diff --git a/.github/workflows/support/scripts/helper.sh b/.github/workflows/support/scripts/helper.sh index 1f75834ff..98fe63f84 100755 --- a/.github/workflows/support/scripts/helper.sh +++ b/.github/workflows/support/scripts/helper.sh @@ -678,6 +678,20 @@ function verify_network_state() { return "$EX_OK" } +function verify_haproxy() { + # iterate over each haprox pod check if READY is 1/1 + local pods=$("${KCTL}" get pods -l fullstack.hedera.com/type=haproxy -o jsonpath='{.items[*].metadata.name}') + for pod in ${pods}; do + local status=$("${KCTL}" get pod "${pod}" -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') + if [[ "${status}" != "True" ]]; then + echo "ERROR: <<< HAProxy pod ${pod} is not ready. >>>" + return "${EX_ERR}" + fi + echo "HAProxy pod ${pod} is ready" + done + return "${EX_OK}" +} + function verify_node_all() { if [[ "${#NODE_NAMES[*]}" -le 0 ]]; then echo "ERROR: Node list is empty. Set NODE_NAMES env variable with a list of nodes" diff --git a/.github/workflows/support/scripts/nmt-install.sh b/.github/workflows/support/scripts/nmt-install.sh index ff886fa83..fd236728b 100644 --- a/.github/workflows/support/scripts/nmt-install.sh +++ b/.github/workflows/support/scripts/nmt-install.sh @@ -62,6 +62,10 @@ function start_node_all() { verify_node_all || return "${EX_ERR}" + sleep 2 + + verify_haproxy || return "${EX_ERR}" + return "${EX_OK}" } diff --git a/.github/workflows/support/scripts/template.env b/.github/workflows/support/scripts/template.env deleted file mode 100644 index 9c4d8cf9e..000000000 --- a/.github/workflows/support/scripts/template.env +++ /dev/null @@ -1,12 +0,0 @@ -USER="${USER:-changeme}" -CLUSTER_NAME="${CLUSTER_NAME:-fst}" -NAMESPACE="${NAMESPACE:-fst-${USER}}" -RELEASE_NAME="${RELEASE_NAME:-fst}" -NMT_VERSION=v1.2.4 -PLATFORM_VERSION=v0.49.0-alpha.2 - -POD_MONITOR_ROLE="${POD_MONITOR_ROLE:-pod-monitor-role}" -GATEWAY_CLASS_NAME="${GATEWAY_CLASS_NAME:-fst-gateway-class}" - -#NODE_NAMES=(node0 node1 node2 node3) -NODE_NAMES=(node0)