ROX-35008: Add GH action to add VMs to existing OCP clusters#21060
ROX-35008: Add GH action to add VMs to existing OCP clusters#21060vikin91 wants to merge 11 commits into
Conversation
Copy roxagent Quadlet unit files from compliance/virtualmachines/roxagent/quadlet/ into the self-contained scripts/ci/add-vms/quadlet/ module. These are verbatim copies; the Image= line in roxagent.container will be overwritten at install time by install-agent-quadlet.sh. Partially generated by AI. Co-authored-by: Cursor <cursoragent@cursor.com>
Installs OpenShift Virtualization (HyperConverged) operator with VSOCK feature gate and KVM_EMULATION. Idempotent: skips when HCO is already healthy. Extracted from rhacs-vmvm-dev-scripts/virt.sh. Partially generated by AI. Co-authored-by: Cursor <cursoragent@cursor.com>
Creates RHEL VMs on KubeVirt clusters with automation SSH keypair management, image pull secret creation, and pre-existing VM adoption via password fallback. Idempotent: skips running VMs, starts stopped ones, creates missing ones. Partially generated by AI. Co-authored-by: Cursor <cursoragent@cursor.com>
Installs roxagent on VMs using the Quadlet (container) method. Auto-detects the ACS image tag from Central, renders Image= lines in Quadlet files, and delegates to quadlet/install.sh per VM. Idempotent: skips when installed Image= already matches. Partially generated by AI. Co-authored-by: Cursor <cursoragent@cursor.com>
Builds roxagent binary from source and deploys to VMs via virtctl scp. Installs systemd oneshot service + timer matching the Quadlet cadence. Always overwrites (binary has no embedded version). Requires Go. Partially generated by AI. Co-authored-by: Cursor <cursoragent@cursor.com>
Single entrypoint that parses arguments, resolves KUBECONFIG, and orchestrates virt operator install, VM deployment, and agent installation. Prints summary with SSH access instructions. Partially generated by AI. Co-authored-by: Cursor <cursoragent@cursor.com>
Wraps add-vms.sh with CI-specific setup: infractl artifacts download, virt operator install, virtctl install from cluster ConsoleCLIDownload, sshpass install, and SSH key preparation. Installs virt operator before virtctl so the ConsoleCLIDownload resource is available. Partially generated by AI. Co-authored-by: Cursor <cursoragent@cursor.com>
One-click GitHub Actions workflow to add VMs to an Infra-managed ACS cluster and install roxagent. Supports rhel9/rhel10, native and Quadlet agent types, optional image tag override, and optional user SSH key. Partially generated by AI. Co-authored-by: Cursor <cursoragent@cursor.com>
Use ${VAR:-} for AUTOMATION_SSH_PRIVKEY and AUTOMATION_SSH_PUBKEY
in the EXIT trap since they are only set after deploy-vms.sh runs.
Partially generated by AI.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
This change is part of the following stack: Change managed by git-spice. |
|
Skipping CI for Draft Pull Request. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🚀 Build Images ReadyImages are ready for commit fc9f9de. To use with deploy scripts: export MAIN_IMAGE_TAG=4.12.x-143-gfc9f9defed |
- Exit non-zero when no VMs are accessible instead of printing a warning and succeeding (caused green CI with no agent installed) - Increase SSH retry from 30 (~6 min) to 90 (~15 min) to handle fresh VMs where container disk pull + boot + cloud-init is slow - Stop swallowing wait_for_ssh_and_adopt failures with || true Partially generated by AI. Co-authored-by: Cursor <cursoragent@cursor.com>
Description
Add a self-contained
scripts/ci/add-vms/module with shell scripts that automate adding KubeVirt VMs to an ACS cluster and installing roxagent. Includes a composite GitHub Action and aworkflow_dispatchworkflow for one-click execution from the Actions UI.What it does:
sshpass)Why:
Manual VM setup for VM scanning development/testing is error-prone and undocumented. This enables any team member to add VMs to a cluster in one command or one click in GitHub Actions.
Architecture: A main orchestrator (
add-vms.sh) sources modular scripts for each step. Quadlet files are copied verbatim from the source of truth atcompliance/virtualmachines/roxagent/quadlet/. A composite action wraps CI-specific setup (infractl, virtctl, sshpass).User-facing documentation
Testing and quality
Automated testing
How I validated my change