Skip to content

Commit

Permalink
fix: incorrect NODE_NAMES (#925)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com>
  • Loading branch information
JeffreyDallas authored Jul 16, 2024
1 parent 0416b44 commit 81629a8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 40 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/support/scripts/direct-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ function start_node_all() {

verify_node_all || return "${EX_ERR}"

sleep 2

verify_haproxy || return "${EX_ERR}"

return "${EX_OK}"
}

Expand Down
32 changes: 4 additions & 28 deletions .github/workflows/support/scripts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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}"
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/support/scripts/helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/support/scripts/nmt-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ function start_node_all() {

verify_node_all || return "${EX_ERR}"

sleep 2

verify_haproxy || return "${EX_ERR}"

return "${EX_OK}"
}

Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/support/scripts/template.env

This file was deleted.

0 comments on commit 81629a8

Please sign in to comment.