Skip to content

Commit 965ea4b

Browse files
authored
OCPBUGS-67300: Fixes for Agent installer OVE UI driven installation (#1827)
A few fixes when using agent-based-installer with AGENT_E2E_TEST_BOOT_MODE=ISO_NO_REGISTRY as this now runs the full UI-driven installation. - Added delay for the Virtualization checkbox to give the UI enough time to complete the background API call that registers the operator selection with the backend - Use the pull-secret after it has been fully configured - Poll for the API to be available and the oc commands to succeed
1 parent 2e0909c commit 965ea4b

7 files changed

Lines changed: 45 additions & 14 deletions

File tree

agent/06_agent_create_cluster.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,13 @@ function create_config_image() {
8585
function create_agent_iso_no_registry() {
8686
local asset_dir=${1}
8787

88+
AGENT_ISO_BUILDER_IMAGE=$(getAgentISOBuilderImage)
89+
8890
id=$(podman create --pull always --authfile "${PULL_SECRET_FILE}" "${AGENT_ISO_BUILDER_IMAGE}") && podman cp "${id}":/src "${asset_dir}" && podman rm "${id}"
8991

92+
# Update release_info.json as its needed by CI tests
93+
save_release_info ${OPENSHIFT_RELEASE_IMAGE} ${OCP_DIR}
94+
9095
# Create agent ISO without registry a.k.a. OVE ISO
9196
pushd .
9297
cd "${asset_dir}"/src

agent/agent_post_install_validation.sh

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,29 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
66
source $SCRIPTDIR/common.sh
77

88
if [[ "${AGENT_E2E_TEST_BOOT_MODE}" == "ISO_NO_REGISTRY" ]]; then
9-
oc wait clusterversion version --for=condition=Available=True --timeout=60m
10-
oc get csv -A
11-
oc get packagemanifests -n openshift-marketplace
9+
MAX_ATTEMPTS=120
10+
SLEEP_SECONDS=30 # Wait time between connection attempts
11+
ATTEMPT_COUNT=0
12+
13+
echo "Starting oc wait retry loop for API connection up to 60 minutes..."
14+
set +x # Disable debug tracing for cleaner output
15+
while ! oc wait clusterversion version --for=condition=Available=True --timeout=1s 2>/dev/null; do
16+
ATTEMPT_COUNT=$((ATTEMPT_COUNT + 1))
17+
if [ $ATTEMPT_COUNT -ge $MAX_ATTEMPTS ]; then
18+
echo ""
19+
set -x # Re-enable debug tracing
20+
echo "ERROR: API server connection failed after $MAX_ATTEMPTS attempts over 60 minutes."
21+
exit 1
22+
fi
23+
24+
echo -n "."
25+
sleep $SLEEP_SECONDS
26+
done
27+
echo ""
28+
set -x # Re-enable debug tracing
29+
echo "SUCCESS: API server connection established and ClusterVersion is available."
30+
# Run subsequent commands after successful cluster setup
31+
oc get packagemanifests -n openshift-marketplace
1232
fi
1333

1434
installed_control_plane_nodes=$(oc get nodes --selector=node-role.kubernetes.io/master | grep -v AGE | wc -l)

agent/cleanup.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ fi
3131

3232
if [[ -d "${OCP_DIR}/iso_builder" ]]; then
3333
sudo rm -rf "${OCP_DIR}/iso_builder"
34+
35+
AGENT_ISO_BUILDER_IMAGE=$(getAgentISOBuilderImage)
3436
sudo podman rmi -f ${AGENT_ISO_BUILDER_IMAGE} || true
3537
fi
3638

agent/common.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ export ISCSI_DEVICE_NAME=${ISCSI_DEVICE_NAME:-"/dev/sdb"}
2626
# See: https://github.com/openshift/appliance
2727
export APPLIANCE_IMAGE=${APPLIANCE_IMAGE:-"quay.io/edge-infrastructure/openshift-appliance:latest"}
2828

29-
if [ "${AGENT_E2E_TEST_BOOT_MODE}" == "ISO_NO_REGISTRY" ] ; then
30-
full_ocp_version=$(skopeo inspect --authfile $PULL_SECRET_FILE docker://$OPENSHIFT_RELEASE_IMAGE | jq -r '.Labels["io.openshift.release"]')
31-
major_minor_patch_version=$(echo "\"$full_ocp_version\"" | jq -r 'split("-")[0]')
32-
major_minor_version=$(echo $major_minor_patch_version | cut -d'.' -f1,2 )
33-
export AGENT_ISO_BUILDER_IMAGE=${AGENT_ISO_BUILDER_IMAGE:-"registry.ci.openshift.org/ocp/${major_minor_version}:agent-iso-builder"}
34-
echo "Using AGENT_ISO_BUILDER_IMAGE: ${AGENT_ISO_BUILDER_IMAGE}"
35-
fi
36-
3729
# Override command name in case of extraction
3830
export OPENSHIFT_INSTALLER_CMD="openshift-install"
3931

@@ -93,3 +85,11 @@ function getRendezvousIP() {
9385
rendezvousIP=$(ip neigh | grep $node_zero_mac_address | awk '{print $1}')
9486
echo $rendezvousIP
9587
}
88+
89+
function getAgentISOBuilderImage() {
90+
full_ocp_version=$(skopeo inspect --authfile $PULL_SECRET_FILE docker://$OPENSHIFT_RELEASE_IMAGE | jq -r '.Labels["io.openshift.release"]')
91+
major_minor_patch_version=$(echo "\"$full_ocp_version\"" | jq -r 'split("-")[0]')
92+
major_minor_version=$(echo $major_minor_patch_version | cut -d'.' -f1,2 )
93+
agent_iso_builder_image="registry.ci.openshift.org/ocp/${major_minor_version}:agent-iso-builder"
94+
echo ${agent_iso_builder_image}
95+
}

agent/isobuilder/ui_driven_cluster_installation/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,12 @@ func clusterDetails(page *rod.Page, path string) error {
138138
}
139139

140140
func virtualizationBundle(page *rod.Page, path string) error {
141-
page.MustElement("#bundle-virtualization").MustClick().MustWaitEnabled()
141+
checkbox := page.MustElement("#bundle-virtualization")
142+
checkbox.MustScrollIntoView()
143+
checkbox.MustClick()
144+
// Allow UI enough time to complete the background API call
145+
time.Sleep(2 * time.Second)
146+
page.MustElement("button[name='next']").MustWaitEnabled()
142147
err := saveFullPageScreenshot(page, path)
143148
if err != nil {
144149
return err

common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ if [[ ! -z ${AGENT_E2E_TEST_SCENARIO} ]]; then
541541
fi
542542
fi
543543

544-
if [ "$AGENT_OPERATORS" =~ "mtv" ]; then
544+
if [[ "$AGENT_OPERATORS" =~ "mtv" ]]; then
545545
export MASTER_VCPU=9
546546
fi
547547

config_example.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,6 @@ set -x
854854
# To generate an ISO that can be used in a disconnected environment
855855
# without using a registry a.k.a. OVE ISO, set the boot mode to 'ISO_NO_REGISTRY'.
856856
# export AGENT_E2E_TEST_BOOT_MODE=ISO
857-
# export AGENT_ISO_BUILDER_IMAGE="registry.ci.openshift.org/ocp/4.21:agent-iso-builder"
858857

859858
# AGENT_CLEANUP_ISO_BUILDER_CACHE_LOCAL_DEV is an optional environment variable used to trigger
860859
# cleanup of cached files and other artifacts during local development and is useful when

0 commit comments

Comments
 (0)