Skip to content

Add machine initialization script for e2e CI runners - #75

Merged
eliorerz merged 1 commit into
osac-project:mainfrom
eliorerz:OSAC-1568-machine-init
Jun 24, 2026
Merged

eliorerz merged 1 commit into
osac-project:mainfrom
eliorerz:OSAC-1568-machine-init

Conversation

@eliorerz

@eliorerz eliorerz commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Single script (scripts/machine-init.sh) to initialize a bare-metal machine for OSAC e2e CI. Installs all dependencies, configures cluster-tool in local mode, sets up DNS and HAProxy.

Steps

Step What it does
packages Install system packages: libvirt, qemu-kvm, podman, haproxy, pigz, skopeo, zstd, jq, git, dnsmasq, python3
services Enable libvirtd, haproxy (SNI config), podman.socket; open firewall ports
oc Install OpenShift CLI from official mirror
cluster-tool Clone repo, install binary, configure local-mode server, SSH keypair, data dirs, DNS, podman parallel downloads
vault Install Vault CLI from HashiCorp repo
verify Show installed versions and storage info; exit non-zero if any check fails

Usage

# Run all steps
sudo ./scripts/machine-init.sh

# Run specific steps
sudo ./scripts/machine-init.sh cluster-tool
sudo ./scripts/machine-init.sh packages services

# Specify storage path
sudo ./scripts/machine-init.sh --data-path /data/cluster-tool

Design

  • Idempotent: safe to re-run; skips already-installed components, never overwrites existing configs
  • Selective: run individual steps or any combination
  • Local mode: registers cluster-tool with --host local (runner IS the bare-metal machine)
  • Auto-detection: storage path defaults to largest partition if not specified
  • Verified on osac-ci-1: tested step-by-step on the actual runner machine

Summary by CodeRabbit

  • Chores
    • Added a root-only end-to-end CI machine initialization script for bare-metal automation.
    • Provisions OS packages and core services, including local OpenShift tooling and required CLIs.
    • Installs Vault CLI, sets up cluster tooling (storage selection, SSH keys, data directories, and network/DNS adjustments).
    • Includes selectable step execution, automated verification checks, and a clear “next steps” checklist after provisioning.

@openshift-ci

openshift-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eliorerz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@eliorerz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 49 minutes and 14 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 7beac559-91fe-4b4d-9917-16c27ea3324d

📥 Commits

Reviewing files that changed from the base of the PR and between 9055b51 and 12845bd.

📒 Files selected for processing (1)
  • scripts/machine-init.sh

Walkthrough

A new Bash script scripts/machine-init.sh is added. It provisions a bare-metal machine for OSAC end-to-end CI by running selectable steps: OS package installation, system service configuration, oc/kubectl install, osac CLI install, cluster-tool installation and configuration, Vault CLI install, and a verification summary.

Changes

Bare-metal OSAC CI provisioning script

Layer / File(s) Summary
Script entry point: shebang, usage, arg parsing, preflight
scripts/machine-init.sh
Defines shebang, usage/help text, strict-mode Bash, argument parsing for --data-path/--help/step names, root-only preflight check, should_run helper, and startup banner.
packages and services steps
scripts/machine-init.sh
Installs OS packages via dnf; enables libvirtd; writes default HAProxy config when the expected backend is absent, sets SELinux boolean, conditionally opens firewall ports, restarts/enables haproxy; enables podman.socket.
OpenShift and CLI tool installation
scripts/machine-init.sh
Downloads and installs oc/kubectl from the stable OpenShift client tarball when oc is not already present; installs pinned osac CLI binary via direct download when missing.
cluster-tool installation and configuration
scripts/machine-init.sh
Installs or updates cluster-tool binary from git; writes per-user config with CLUSTER_TOOL_DATA (explicit or auto-detected from partitions); creates data directories, generates SSH keypair, configures podman parallel copies, registers local server metadata, and sets up NetworkManager dnsmasq with resolv.conf polling.
Vault CLI installation
scripts/machine-init.sh
Installs Vault CLI via HashiCorp yum repository when missing.
Verification and main orchestration
scripts/machine-init.sh
Defines _check helper that tallies tool installation failures and prints version checks and storage availability; runs all selected steps in sequence; prints Next Steps checklist.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

A script descends on bare metal at night,
Installs its packages, haproxy alight,
cluster-tool wired, SSH keys in place,
Vault CLI joins at a comfortable pace.
One --help away from a working machine — 🚀

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a machine initialization script for e2e CI runners, which directly matches the primary purpose of the 442-line addition to scripts/machine-init.sh.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Hardcoded-Secrets ✅ Passed No hardcoded secrets detected. Script uses only public URLs from official repositories and contains no API keys, tokens, passwords, credentials, or sensitive configuration data.
No-Weak-Crypto ✅ Passed Script contains no weak crypto (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom crypto implementations, or unsafe secret comparisons. Only operation is Ed25519 SSH key generation, a modern strong...
No-Injection-Vectors ✅ Passed The script properly protects against injection vectors: eval uses only hardcoded commands, user-supplied DATA_PATH is consistently quoted in command contexts, and STEPS are whitelisted.
Container-Privileges ✅ Passed The custom check targets privileged container/K8s manifest configurations (privileged: true, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation). This PR adds only a Bash shell scri...
No-Sensitive-Data-In-Logs ✅ Passed Script contains no logging of passwords, tokens, API keys, PII, session IDs, or sensitive credentials. All echo statements output only safe information: step names, public URLs, tool versions, file...
Ai-Attribution ✅ Passed No AI tool usage was mentioned in the PR description, commit message, or code. The check is not applicable since the condition "if AI tools were used (mentioned in PR or commits)" is not met.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/machine-init.sh`:
- Around line 304-307: The pkill -x dnsmasq command indiscriminately kills all
dnsmasq processes, including the instance managed by libvirt for VM networking,
which breaks DNS/DHCP for any running virtual machines. Remove the pkill -x
dnsmasq line and the subsequent sleep 1 command, allowing NetworkManager to
manage its own dnsmasq lifecycle when systemctl restart NetworkManager is
executed. This way, only NetworkManager's dnsmasq instance will be restarted
while libvirt's instance remains unaffected.
- Around line 45-47: The --data-path argument parsing lacks validation to ensure
that a value is actually provided after the flag. When the flag is used without
a following argument, $2 will be unset causing an unclear failure with set -u.
Before assigning $2 to DATA_PATH in the --data-path case, add a check to verify
that $2 exists and is not empty. If the argument is missing, the script should
display a clear error message indicating that --data-path requires a value and
then exit with an appropriate error code.
- Around line 200-207: The curl download piped directly to tar silently fails if
the network request errors or returns an error status, since the -s flag
suppresses output and tar will attempt extraction on partial or empty data.
Instead of piping curl to tar, download the file to a temporary location first
within the TMP_OC directory, verify the download succeeded (by checking the curl
exit status or file size), and then extract from the downloaded file. This
ensures download failures are caught before attempting to install the oc and
kubectl binaries from potentially corrupted data.
- Around line 257-260: The DATA_PATH variable is being written unquoted to the
config file in the echo statement that writes CLUSTER_TOOL_DATA. If DATA_PATH
contains spaces, this will result in a malformed config file. Quote the
DATA_PATH variable expansion using double quotes when writing it to ensure the
value is properly preserved even if it contains spaces.
- Around line 310-316: The DNS verification loop that checks for 127.0.0.1 in
/etc/resolv.conf using grep within the for loop iterating 30 times does not
provide any warning if the condition is never satisfied after all iterations
complete. Add a flag variable before the for loop to track whether DNS was
successfully configured, set this flag to true when the grep condition succeeds
(inside the if block), and after the loop completes, add a conditional check
that logs a warning or error message if the flag indicates DNS configuration
failed. This ensures that DNS misconfiguration issues are surfaced to the user
instead of silently allowing the script to continue.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 9151d88e-5021-448f-ac56-ca45fd0a9eaa

📥 Commits

Reviewing files that changed from the base of the PR and between 3950e95 and 23ba453.

📒 Files selected for processing (1)
  • scripts/machine-init.sh

Comment thread scripts/machine-init.sh
Comment on lines +45 to +47
--data-path)
DATA_PATH="$2"
shift 2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Missing argument validation for --data-path.

If a user runs ./machine-init.sh --data-path without providing a value, $2 will be unset, causing an unclear failure with set -u. Validate that the argument exists before using it.

Proposed fix
         --data-path)
+            if [[ -z "${2:-}" ]]; then
+                echo "ERROR: --data-path requires a value." >&2
+                exit 1
+            fi
             DATA_PATH="$2"
             shift 2
             ;;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
--data-path)
DATA_PATH="$2"
shift 2
--data-path)
if [[ -z "${2:-}" ]]; then
echo "ERROR: --data-path requires a value." >&2
exit 1
fi
DATA_PATH="$2"
shift 2
;;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/machine-init.sh` around lines 45 - 47, The --data-path argument
parsing lacks validation to ensure that a value is actually provided after the
flag. When the flag is used without a following argument, $2 will be unset
causing an unclear failure with set -u. Before assigning $2 to DATA_PATH in the
--data-path case, add a check to verify that $2 exists and is not empty. If the
argument is missing, the script should display a clear error message indicating
that --data-path requires a value and then exit with an appropriate error code.

Comment thread scripts/machine-init.sh
Comment on lines +200 to +207
OC_URL="https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz"
echo " Downloading from ${OC_URL}..."
TMP_OC=$(mktemp -d)
curl -sL "${OC_URL}" | tar xz -C "${TMP_OC}"
install -m 0755 "${TMP_OC}/oc" /usr/local/bin/oc
install -m 0755 "${TMP_OC}/kubectl" /usr/local/bin/kubectl 2>/dev/null || true
rm -rf "${TMP_OC}"
echo " oc installed: $(oc version --client 2>/dev/null | head -1)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Download failure not detected when piping curl to tar.

If the download fails (network error, 404, etc.), curl -s silently fails and tar receives partial/empty data. This could result in a missing or corrupted oc binary. Download to a file first and verify success.

Proposed fix
         OC_URL="https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz"
         echo "    Downloading from ${OC_URL}..."
         TMP_OC=$(mktemp -d)
-        curl -sL "${OC_URL}" | tar xz -C "${TMP_OC}"
+        if ! curl -fSL "${OC_URL}" -o "${TMP_OC}/oc.tar.gz"; then
+            echo "ERROR: Failed to download OpenShift CLI." >&2
+            rm -rf "${TMP_OC}"
+            exit 1
+        fi
+        tar xz -C "${TMP_OC}" -f "${TMP_OC}/oc.tar.gz"
         install -m 0755 "${TMP_OC}/oc" /usr/local/bin/oc
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/machine-init.sh` around lines 200 - 207, The curl download piped
directly to tar silently fails if the network request errors or returns an error
status, since the -s flag suppresses output and tar will attempt extraction on
partial or empty data. Instead of piping curl to tar, download the file to a
temporary location first within the TMP_OC directory, verify the download
succeeded (by checking the curl exit status or file size), and then extract from
the downloaded file. This ensures download failures are caught before attempting
to install the oc and kubectl binaries from potentially corrupted data.

Comment thread scripts/machine-init.sh
Comment on lines +257 to +260
# Write config (only if not already present)
if [[ ! -f "${CT_CONFIG_DIR}/config" ]]; then
echo "CLUSTER_TOOL_DATA=${DATA_PATH}" > "${CT_CONFIG_DIR}/config"
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

DATA_PATH is written unquoted to config file.

If DATA_PATH contains spaces (unlikely but possible), the config file will be malformed. Quote the value for robustness.

Proposed fix
     # Write config (only if not already present)
     if [[ ! -f "${CT_CONFIG_DIR}/config" ]]; then
-        echo "CLUSTER_TOOL_DATA=${DATA_PATH}" > "${CT_CONFIG_DIR}/config"
+        echo "CLUSTER_TOOL_DATA=\"${DATA_PATH}\"" > "${CT_CONFIG_DIR}/config"
     fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Write config (only if not already present)
if [[ ! -f "${CT_CONFIG_DIR}/config" ]]; then
echo "CLUSTER_TOOL_DATA=${DATA_PATH}" > "${CT_CONFIG_DIR}/config"
fi
# Write config (only if not already present)
if [[ ! -f "${CT_CONFIG_DIR}/config" ]]; then
echo "CLUSTER_TOOL_DATA=\"${DATA_PATH}\"" > "${CT_CONFIG_DIR}/config"
fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/machine-init.sh` around lines 257 - 260, The DATA_PATH variable is
being written unquoted to the config file in the echo statement that writes
CLUSTER_TOOL_DATA. If DATA_PATH contains spaces, this will result in a malformed
config file. Quote the DATA_PATH variable expansion using double quotes when
writing it to ensure the value is properly preserved even if it contains spaces.

Comment thread scripts/machine-init.sh
Comment on lines +304 to +307
# Kill stale dnsmasq processes before restart
pkill -x dnsmasq 2>/dev/null || true
sleep 1
systemctl restart NetworkManager

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

pkill -x dnsmasq kills all dnsmasq processes, including libvirt's.

Libvirt runs its own dnsmasq instance for VM networking (default network). Killing all dnsmasq processes will break DNS/DHCP for any running VMs and may cause libvirt network issues. NetworkManager should manage its own dnsmasq lifecycle on restart.

Proposed fix — let NetworkManager handle dnsmasq
-        # Kill stale dnsmasq processes before restart
-        pkill -x dnsmasq 2>/dev/null || true
-        sleep 1
         systemctl restart NetworkManager
+        sleep 2  # Give NetworkManager time to spawn dnsmasq
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Kill stale dnsmasq processes before restart
pkill -x dnsmasq 2>/dev/null || true
sleep 1
systemctl restart NetworkManager
systemctl restart NetworkManager
sleep 2 # Give NetworkManager time to spawn dnsmasq
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/machine-init.sh` around lines 304 - 307, The pkill -x dnsmasq command
indiscriminately kills all dnsmasq processes, including the instance managed by
libvirt for VM networking, which breaks DNS/DHCP for any running virtual
machines. Remove the pkill -x dnsmasq line and the subsequent sleep 1 command,
allowing NetworkManager to manage its own dnsmasq lifecycle when systemctl
restart NetworkManager is executed. This way, only NetworkManager's dnsmasq
instance will be restarted while libvirt's instance remains unaffected.

Comment thread scripts/machine-init.sh
Comment on lines +310 to +316
for _ in $(seq 1 30); do
if grep -q '127.0.0.1' /etc/resolv.conf 2>/dev/null; then
echo " DNS configured (resolv.conf -> 127.0.0.1)"
break
fi
sleep 0.5
done

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

DNS verification loop silently continues on timeout.

If /etc/resolv.conf never points to 127.0.0.1 after 30 iterations (15 seconds), the script continues without warning. This masks a DNS misconfiguration that will cause cluster-tool failures later.

Proposed fix
         # Verify resolv.conf points to localhost
+        dns_ok=false
         for _ in $(seq 1 30); do
             if grep -q '127.0.0.1' /etc/resolv.conf 2>/dev/null; then
                 echo "    DNS configured (resolv.conf -> 127.0.0.1)"
+                dns_ok=true
                 break
             fi
             sleep 0.5
         done
+        if [[ "${dns_ok}" != "true" ]]; then
+            echo "    WARNING: resolv.conf does not point to 127.0.0.1. DNS may not work correctly."
+        fi
     fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for _ in $(seq 1 30); do
if grep -q '127.0.0.1' /etc/resolv.conf 2>/dev/null; then
echo " DNS configured (resolv.conf -> 127.0.0.1)"
break
fi
sleep 0.5
done
dns_ok=false
for _ in $(seq 1 30); do
if grep -q '127.0.0.1' /etc/resolv.conf 2>/dev/null; then
echo " DNS configured (resolv.conf -> 127.0.0.1)"
dns_ok=true
break
fi
sleep 0.5
done
if [[ "${dns_ok}" != "true" ]]; then
echo " WARNING: resolv.conf does not point to 127.0.0.1. DNS may not work correctly."
fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/machine-init.sh` around lines 310 - 316, The DNS verification loop
that checks for 127.0.0.1 in /etc/resolv.conf using grep within the for loop
iterating 30 times does not provide any warning if the condition is never
satisfied after all iterations complete. Add a flag variable before the for loop
to track whether DNS was successfully configured, set this flag to true when the
grep condition succeeds (inside the if block), and after the loop completes, add
a conditional check that logs a warning or error message if the flag indicates
DNS configuration failed. This ensures that DNS misconfiguration issues are
surfaced to the user instead of silently allowing the script to continue.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/machine-init.sh`:
- Around line 229-230: The curl command downloading the OSAC binary to
/usr/local/bin/osac uses the `-s` flag which suppresses all output including
error messages, making debugging download failures difficult. Modify the curl
command by adding the `-S` flag to the existing flags (changing `-Lsfo` to
`-LSfo`) so that error messages are displayed while progress indicators remain
hidden, allowing the script to show what went wrong if the download fails.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: e695587b-e1b2-45c0-9799-584ea8c7629e

📥 Commits

Reviewing files that changed from the base of the PR and between cc7c0af and 9055b51.

📒 Files selected for processing (1)
  • scripts/machine-init.sh

Comment thread scripts/machine-init.sh Outdated
Comment on lines +229 to +230
curl -Lsfo /usr/local/bin/osac "${OSAC_URL}"
chmod +x /usr/local/bin/osac

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add -S flag to show errors on download failure.

The -s flag suppresses all output, including error messages. If the download fails (404, network error), the script exits with no indication of what went wrong. Add -S to re-enable error messages while keeping progress hidden.

Proposed fix
-        curl -Lsfo /usr/local/bin/osac "${OSAC_URL}"
+        curl -fsSLo /usr/local/bin/osac "${OSAC_URL}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
curl -Lsfo /usr/local/bin/osac "${OSAC_URL}"
chmod +x /usr/local/bin/osac
curl -fsSLo /usr/local/bin/osac "${OSAC_URL}"
chmod +x /usr/local/bin/osac
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/machine-init.sh` around lines 229 - 230, The curl command downloading
the OSAC binary to /usr/local/bin/osac uses the `-s` flag which suppresses all
output including error messages, making debugging download failures difficult.
Modify the curl command by adding the `-S` flag to the existing flags (changing
`-Lsfo` to `-LSfo`) so that error messages are displayed while progress
indicators remain hidden, allowing the script to show what went wrong if the
download fails.

Adds scripts/machine-init.sh which prepares a bare-metal machine for
OSAC e2e CI: system packages, services (libvirtd, HAProxy, podman),
OpenShift CLI, osac CLI (auto-detects latest release), cluster-tool
in local mode, Vault CLI, and a verification step.

Supports selective steps and --data-path for cluster-tool storage.
@eliorerz
eliorerz force-pushed the OSAC-1568-machine-init branch from b44b28e to 12845bd Compare June 21, 2026 04:30
@omer-vishlitzky

Copy link
Copy Markdown
Contributor

🏗️ CI Triage: infra | Category: BOOT

Root cause: The boot step failed to pull the cluster snapshot image from quay.io due to a registry or network connection issue.

Explanation: During the 'osac-project-cluster-tool-boot' step, the cluster-tool attempted to pull the 'vmaas-kustomize' flavor from quay.io. The skopeo copy command failed with multiple 'unexpected EOF' errors while reading blob bodies, indicating a network interruption or registry unavailability. This is an infrastructure issue unrelated to the PR's code.

Evidence:

build-log.txt:

  [1/5] Downloading from registry               Command failed (exit 1): skopeo copy docker://quay.io/rh-ee-ovishlit/cluster-flavors:vmaas-kustomize dir:/home/cluster-tool/tmp-pull-50319/oci

build-log.txt:

time="2026-06-20T23:56:00-05:00" level=fatal msg="writing blob: happened during read: unexpected EOF (while reconnecting: Get \"https://cdn01.quay.io/quayio-production-s3/sha256/ca/cafa13433a42156ce28ac22062fd49c31d4dcae405bcc400d1b1f45e75c04c40?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIATAAF2YHTGR23ZTE6%2F20260621%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260621T045014Z&X-Amz-Expires=600&X-Amz-SignedHeaders=host&X-Amz-Signature=e257774947f4b06d3b416df19d97306247794e01ae7ef7d3c8d596cf3e7b7557&region=us-east-1&namespace=rh-ee-ovishlit&username=openshift-release-dev+ocm_access_5fe7dee1157e406796567cef18f61c93&repo_name=cluster-flavors&akamai_signature=exp=1782018314~hmac=df0441de93c4361a84827780ea5a62a8ba28587fd4d58dd33763a2287ba14d84\": EOF)"

Suggestion: Retrigger the job. This is a transient infrastructure issue with the Quay.io registry or network connectivity.


Prow job | Build 2068552161951748096 | 🤖 triagent

For deeper investigation, use the /osac-debug-e2e skill with this build ID.

@eliorerz
eliorerz merged commit b3c2097 into osac-project:main Jun 24, 2026
4 of 5 checks passed
@eliorerz
eliorerz deleted the OSAC-1568-machine-init branch June 24, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants