-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework and fix nightly install tests (#5692)
* Remove microos install test * Rename ubuntu install test * Consolidate install testing checks * Move to linux GitHub Action runners * Bump leap to 15.5 * Bump Windows 2019 to libvirt image Signed-off-by: Derek Nola <[email protected]> * Fix go version for integration tests Signed-off-by: Derek Nola <[email protected]> --------- Signed-off-by: Derek Nola <[email protected]>
- Loading branch information
Showing
13 changed files
with
262 additions
and
520 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: 'Setup Vagrant and Libvirt' | ||
description: 'A composite action that installs latest versions of vagrant and libvirt for use on ubuntu based runners' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Add vagrant to apt-get sources | ||
shell: bash | ||
run: | | ||
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg | ||
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list | ||
sudo sed -i 's/^# deb-src/deb-src/' /etc/apt/sources.list | ||
- name: Install vagrant and libvirt | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libvirt-daemon libvirt-daemon-system vagrant | ||
sudo systemctl enable --now libvirtd | ||
- name: Build vagrant dependencies | ||
shell: bash | ||
run: | | ||
sudo apt-get build-dep -y vagrant ruby-libvirt | ||
sudo apt-get install -y --no-install-recommends libxslt-dev libxml2-dev libvirt-dev ruby-bundler ruby-dev zlib1g-dev | ||
# This is a workaround for the libvirt group not being available in the current shell | ||
# https://github.com/actions/runner-images/issues/7670#issuecomment-1900711711 | ||
- name: Make the libvirt socket rw accessible to everyone | ||
shell: bash | ||
run: | | ||
sudo chmod a+rw /var/run/libvirt/libvirt-sock | ||
|
||
- name: Install vagrant-libvirt plugin | ||
shell: bash | ||
run: vagrant plugin install vagrant-libvirt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
def waitForControlPlane(vm, box) | ||
hostname = box.include?("opensuse") ? "$(hostnamectl --static)" : "$(hostname)" | ||
vm.provision "rke2-wait-for-cp", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh| | ||
sh.inline = <<~SHELL | ||
#!/usr/bin/env bash | ||
set -eu -o pipefail | ||
echo 'Waiting for node (and static pods) to be ready ...' | ||
time { | ||
timeout 240 bash -c 'while ! (kubectl wait --for condition=ready node/#{hostname} 2>/dev/null); do sleep 5; done' | ||
timeout 240 bash -c 'while ! (kubectl wait --for condition=ready -n kube-system pod/etcd-#{hostname} 2>/dev/null); do sleep 5; done' | ||
timeout 240 bash -c 'while ! (kubectl wait --for condition=ready -n kube-system pod/kube-apiserver-#{hostname} 2>/dev/null); do sleep 5; done' | ||
timeout 240 bash -c 'while ! (kubectl wait --for condition=ready -n kube-system pod/kube-scheduler-#{hostname} 2>/dev/null); do sleep 5; done' | ||
timeout 240 bash -c 'while ! (kubectl wait --for condition=ready -n kube-system pod/kube-proxy-#{hostname} 2>/dev/null); do sleep 5; done' | ||
timeout 240 bash -c 'while ! (kubectl wait --for condition=ready -n kube-system pod/kube-controller-manager-#{hostname} 2>/dev/null); do sleep 5; done' | ||
timeout 240 bash -c 'while ! (kubectl wait --for condition=ready -n kube-system pod/cloud-controller-manager-#{hostname} 2>/dev/null); do sleep 5; done' | ||
} | ||
kubectl get node,all -A -o wide | ||
SHELL | ||
end | ||
end | ||
|
||
|
||
def waitForCanal(vm) | ||
vm.provision "rke2-wait-for-canal", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh| | ||
sh.inline = <<~SHELL | ||
#!/usr/bin/env bash | ||
set -eu -o pipefail | ||
time { | ||
timeout 240 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s daemonset/rke2-canal 2>/dev/null); do sleep 5; done' | ||
} | ||
SHELL | ||
end | ||
end | ||
|
||
def waitForCoreDNS(vm) | ||
vm.provision "rke2-wait-for-coredns", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh| | ||
sh.inline = <<~SHELL | ||
#!/usr/bin/env bash | ||
set -eu -o pipefail | ||
time { | ||
timeout 240 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s deploy/rke2-coredns-rke2-coredns 2>/dev/null); do sleep 5; done' | ||
timeout 240 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s deploy/rke2-coredns-rke2-coredns-autoscaler 2>/dev/null); do sleep 5; done' | ||
} | ||
SHELL | ||
end | ||
end | ||
|
||
def waitForIngressNginx(vm) | ||
vm.provision "rke2-wait-for-ingress-nginx", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh| | ||
sh.inline = <<~SHELL | ||
#!/usr/bin/env bash | ||
set -eu -o pipefail | ||
time { | ||
timeout 240 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s daemonset/rke2-ingress-nginx-controller 2>/dev/null); do sleep 5; done' | ||
} | ||
SHELL | ||
end | ||
end | ||
|
||
def waitForMetricsServer(vm) | ||
vm.provision "rke2-wait-for-metrics-server", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh| | ||
sh.inline = <<~SHELL | ||
#!/usr/bin/env bash | ||
set -eu -o pipefail | ||
time { | ||
timeout 240 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s deploy/rke2-metrics-server 2>/dev/null); do sleep 5; done' | ||
} | ||
SHELL | ||
end | ||
end | ||
|
||
def checkRKE2Processes(vm) | ||
vm.provision "rke2-procps", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh| | ||
sh.inline = <<~SHELL | ||
#!/usr/bin/env bash | ||
set -eux -o pipefail | ||
ps auxZ | grep -E 'etcd|kube|rke2|container|spc_t|unconfined_t' | grep -v grep | ||
SHELL | ||
end | ||
end | ||
|
||
def kubectlStatus(vm) | ||
vm.provision "rke2-status", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh| | ||
sh.inline = <<~SHELL | ||
#!/usr/bin/env bash | ||
set -eux -o pipefail | ||
kubectl get node,all -A -o wide | ||
SHELL | ||
end | ||
end |
Oops, something went wrong.