Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect NODE_NAMES #925

Merged
merged 6 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 @@
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

Check warning on line 88 in .github/workflows/support/scripts/env.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/support/scripts/env.sh#L88

NMT_VERSION appears unused. Verify use (or export if used externally).
PLATFORM_VERSION=v0.49.0-alpha.2

Check warning on line 89 in .github/workflows/support/scripts/env.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/support/scripts/env.sh#L89

PLATFORM_VERSION appears unused. Verify use (or export if used externally).

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.

Loading