feat: add rancher integration pipeline#1033
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new GitHub Actions workflow for Rancher integration that automates version patching, building Harvester artifacts, and running integration tests.
- Adds a workflow to patch RKE2 and Rancher versions, build artifacts, and deploy/test clusters.
- Includes steps for cloning ipxe-examples, performing cluster setup, running tests, and collecting logs.
0835b17 to
072422c
Compare
| working-directory: ${{ steps.ipxe.outputs.VAGRANT_HOME }} | ||
| run: | | ||
| vagrant destroy -f | ||
| - name: Remove OVMF.fd line if needed |
There was a problem hiding this comment.
What's the purpose for this?
There was a problem hiding this comment.
I copy this from
harvester-installer/.github/workflows/vagrant-install.yaml
Lines 47 to 53 in 6973fcd
There was a problem hiding this comment.
If the OVMF file is present in the system, the VM will run in UEFI mode, otherwise, it will run in legacy BIOS mode. Not every runner has the file presented.
There was a problem hiding this comment.
If some snippets are resuable, suggest creating util scripts or workflows, then share them with each other. In addition, please also add comments to clarify the purpose, or prefer making the step name self-explantory. It will be good for understanding.
innobead
left a comment
There was a problem hiding this comment.
Can we make a reusable workflow which can be used in both workflow to reduce duplicated implementation here? Basically, have a job running the reusbale workflow, then start the different steps in another job.
| working-directory: ./ci/terraform | ||
| run: | | ||
| ./cleanup_test_files.sh | ||
| - name: Testing existing files |
There was a problem hiding this comment.
Check files exist on provisioned hosts
nit: The name is quite general, can we make them specific? What files should exist. check_files.sh is also too common.
There was a problem hiding this comment.
Since check_files.sh is used in other workflow, I will update the naming in the next PR.
| ./test_terraform_vm.sh ${{ steps.ipxe.outputs.VAGRANT_HOME }}/settings.yml | ||
|
|
||
| - name: Check Rancher System Agent | ||
| run: | |
There was a problem hiding this comment.
Should we move this just after Setup cluster?
There was a problem hiding this comment.
I prefer to keep it after terraform check. If it checks rancher-system-agent just after setup cluster, the cluster may not be ready.
There was a problem hiding this comment.
I see, then it can be part of tests.
|
The ultimate goal is to automatically detect the versions of Rancher and RKE2, and then run these workflows. There are a few things we need to improve later.
|
12f7b4a to
851bacf
Compare
innobead
left a comment
There was a problem hiding this comment.
Just a few minor feedback. After resolving them, we can merge this first, so you can verify and fine-tune this later.
| - name: Create new-version.yaml | ||
| working-directory: ./ci/upgrade | ||
| run: | | ||
| ./create_upgrade_file.sh |
There was a problem hiding this comment.
This should be create_version_file.sh instead?
BTW, can we simplify the upgrade operation as follows? When creating a new version or upgrade, apply it directly.
- name: Start file server
run: |
python3 -m http.server 8000 --bind 0.0.0.0 &
- name: Create the upgrade version
working-directory: ./ci/upgrade
run: |
./create_version.sh
- name: Create the upgrade
working-directory: ./ci/upgrade
run: |
./create_upgrade.sh
|
|
||
| - name: Check Rancher System Agent | ||
| run: | | ||
| for i in 0 1 2; do |
There was a problem hiding this comment.
Can we move this to check_rancher_system_agent.sh? I would like to move all checks and tests under the terraform folder to make them consistent as the existing test scripts like test_terraform_vm.sh.
|
|
||
| - name: Test Login | ||
| run: | | ||
| node0_ip=$(yq e ".harvester_network_config.cluster[0].ip" ${{ steps.ipxe.outputs.VAGRANT_HOME }}/settings.yml) |
There was a problem hiding this comment.
ditto, move this to check_login.sh
| exit 1 | ||
| fi | ||
|
|
||
| - name: Test RKE2 cert rotation |
There was a problem hiding this comment.
check_rke2_cert_rotation.sh
Signed-off-by: PoAn Yang <poan.yang@suse.com>
Signed-off-by: PoAn Yang <poan.yang@suse.com>
Signed-off-by: PoAn Yang <poan.yang@suse.com>
Signed-off-by: PoAn Yang <poan.yang@suse.com>
Problem:
Solution:
Related Issue(s):
harvester/harvester#7889
Test plan:
Additional documentation or context