From bd482ab60baf50e3b87ef6da44091f68741ca553 Mon Sep 17 00:00:00 2001 From: Luke Repko Date: Tue, 9 Dec 2025 15:49:00 -0600 Subject: [PATCH 1/2] fix(setup): Improve yq installation and handling Add verbosity to the wget command so we can troubleshoot download failures if encountered more easily, as well as very clear and concise messaging around whether or not yq really got installed. YQ is more necessary on the remote host than the local host that runs the hyperconverged-lab script, so warn about it not getting installed locally but fail if not present on the remote host as it's a pre-requisite to running many install scripts. --- bin/setup-openstack.sh | 8 ++++---- scripts/hyperconverged-lab.sh | 31 +++++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/bin/setup-openstack.sh b/bin/setup-openstack.sh index 768df84c..86529619 100755 --- a/bin/setup-openstack.sh +++ b/bin/setup-openstack.sh @@ -17,7 +17,7 @@ function waitErator() { local start_time start_time=$(date +%s) local timeout_seconds=$((30 * 60)) # 30 minutes - + while [ ${#pids[@]} -gt 0 ]; do # Check for timeout local current_time @@ -33,7 +33,7 @@ function waitErator() { echo "==== PROCESS TIMEOUT =====================================" exit 1 fi - + for pid in "${!pids[@]}"; do # Check if process is still running if ! kill -0 ${pid} 2>/dev/null; then @@ -41,7 +41,7 @@ function waitErator() { # Use || to prevent set -e from killing the script before we can log the failure wait ${pid} || local exit_code=$? exit_code=${exit_code:-0} - + if [ $exit_code -ne 0 ]; then echo "==== PROCESS FAILED =====================================" echo "Command: ${pid_commands[$pid]}" @@ -57,7 +57,7 @@ function waitErator() { done sleep 1 done - + echo "All processes completed successfully." } diff --git a/scripts/hyperconverged-lab.sh b/scripts/hyperconverged-lab.sh index 52638382..b2b745ac 100755 --- a/scripts/hyperconverged-lab.sh +++ b/scripts/hyperconverged-lab.sh @@ -10,16 +10,26 @@ EXCLUDE_LIST=() export TEST_LEVEL="${TEST_LEVEL:-off}" +# yq installation constants +YQ_VERSION="v4.2.0" +YQ_BINARY="yq_linux_amd64" + function installYq() { - export VERSION=v4.2.0 - export BINARY=yq_linux_amd64 - wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -q -O - | tar xz && sudo mv ${BINARY} /usr/local/bin/yq + if wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY}.tar.gz -O - | tar xz && sudo mv ${YQ_BINARY} /usr/local/bin/yq; then + echo "Successfully installed yq version ${YQ_VERSION}" + return 0 + else + echo "Failed to install yq" + return 1 + fi } # Install yq locally if needed... if ! yq --version 2> /dev/null; then echo "yq is not installed. Attempting to install yq" - installYq + if ! installYq; then + echo "[WARNING] Failed to install yq locally" + fi fi @@ -430,6 +440,19 @@ if [ ! -d "/etc/genestack" ]; then sudo chown \${USER}:\${USER} -R /etc/genestack fi +# Install yq on the remote host if not already present +if ! command -v yq &> /dev/null; then + echo "Installing yq on remote host..." + if wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY}.tar.gz -O - | tar xz && sudo mv ${YQ_BINARY} /usr/local/bin/yq; then + echo "Successfully installed yq version ${YQ_VERSION} on remote host" + else + echo "Failed to install yq on remote host" + exit 1 + fi +else + echo "yq already available on remote host: \$(yq --version)" +fi + # We need to clobber the sample or else we get a bogus LB vip cat > /etc/genestack/manifests/metallb/metallb-openstack-service-lb.yml < Date: Wed, 10 Dec 2025 11:44:21 -0600 Subject: [PATCH 2/2] fix(setup): Add retry logic to post-setup Troubleshooting the lab build failures, post setup is being executed within seconds after the nova install completes, which may be too fast. If I can confirm it's a race condition, we will want a more intelligent way to determine when cluster is ready before proceeding to post-setup. For now, just adding dumb retry logic to the openstack commands to see if that helps. --- scripts/hyperconverged-lab.sh | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/scripts/hyperconverged-lab.sh b/scripts/hyperconverged-lab.sh index b2b745ac..fba51367 100755 --- a/scripts/hyperconverged-lab.sh +++ b/scripts/hyperconverged-lab.sh @@ -1257,6 +1257,48 @@ echo "Installing OpenStack" sudo /opt/genestack/bin/setup-openstack.sh EOC +# Run Genestack post setup +ssh -o ForwardAgent=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -t ${SSH_USERNAME}@${JUMP_HOST_VIP} <