Skip to content

Commit

Permalink
Bump kubevirtci
Browse files Browse the repository at this point in the history
[4ad94f0 Label rook storage class](kubevirt/kubevirtci#1267)
[88a4f6b fix: Wait until istio cni files appear before copying them](kubevirt/kubevirtci#1262)
[4cc1018 Run ./hack/bump-cdi.sh](kubevirt/kubevirtci#1249)
[6149a01 Include manifests that are part of gocli when checking for prepull images](kubevirt/kubevirtci#1265)
[1b17b20 fix: Remove extra slash in file path and remove unneeded sed](kubevirt/kubevirtci#1258)
[b35649a Automatic bump of CentOS Stream to latest](kubevirt/kubevirtci#1257)
[374b5e9 bug: Move namespace and CRD files to names with higher alphabetical order to be created first](kubevirt/kubevirtci#1255)
[79bfd07 Run bazel run //robots/cmd/kubevirtci-bumper:kubevirtci-bumper -- -ensure-only-latest-three --k8s-provider-dir /home/prow/go/src/github.com/kubevirt/project-infra/../kubevirtci/cluster-provision/k8s --cluster-up-dir /home/prow/go/src/github.com/kubevirt/project-infra/../kubevirtci/cluster-up/cluster](kubevirt/kubevirtci#1256)
[ba145b2 bug: Fix KSM flag passing to the gocli](kubevirt/kubevirtci#1254)
[8501d22 Opts package](kubevirt/kubevirtci#1217)
[4f37d07 Automatic bump of CentOS Stream to latest](kubevirt/kubevirtci#1250)

```release-note
NONE
```

Signed-off-by: kubevirt-bot <[email protected]>
  • Loading branch information
kubevirt-bot committed Sep 10, 2024
1 parent 1a50ec5 commit 33c973d
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 184 deletions.
2 changes: 1 addition & 1 deletion cluster-up-sha.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
41b822114a0158f14ff8a86f206dc459241726e4
c61ba644b63ba81139b926461caf228562d05110
53 changes: 53 additions & 0 deletions cluster-up/cluster/ephemeral-provider-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,59 @@ function _add_common_params() {
params=" --enable-fips $params"
fi

if [ "$KUBEVIRT_WITH_MULTUS_V3" == "true" ]; then
params=" --deploy-multus $params"
fi

if [ "$KUBEVIRT_WITH_CNAO" == "true" ]; then
params=" --enable-cnao $params"
fi

if [ "$KUBEVIRT_DEPLOY_CDI" == "true" ]; then
params=" --deploy-cdi $params"
fi

if [ -n "$KUBEVIRT_CUSTOM_CDI_VERSION" ]; then
params=" --cdi-version=$KUBEVIRT_CUSTOM_CDI_VERSION $params"
fi

if [ "$KUBEVIRT_DEPLOY_AAQ" == "true" ]; then
params=" --deploy-aaq $params"
fi

if [ -n "$KUBEVIRT_CUSTOM_AAQ_VERSION" ]; then
params=" --aaq-version=$KUBEVIRT_CUSTOM_AAQ_VERSION $params"
fi

if [ "$KUBEVIRT_KSM_ON" == "true" ]; then
params=" --enable-ksm $params"
fi

if [ ! -z $KUBEVIRT_KSM_SLEEP_BETWEEN_SCANS_MS ]; then
params=" --ksm-scan-interval=$KUBEVIRT_KSM_SLEEP_BETWEEN_SCANS_MS $params"
fi

if [ ! -z $KUBEVIRT_KSM_PAGES_TO_SCAN ]; then
params=" --ksm-page-count=$KUBEVIRT_KSM_PAGES_TO_SCAN $params"
fi

if [ "$KUBEVIRT_SWAP_ON" == "true" ]; then
params=" --enable-swap $params"
fi

if [ ! -z $KUBEVIRT_SWAP_SIZE_IN_GB ]; then
params=" --swap-size=$KUBEVIRT_SWAP_SIZE_IN_GB $params"
fi

if [ ! -z $KUBEVIRT_SWAPPINESS ]; then
params=" --swapiness=$KUBEVIRT_SWAPPINESS $params"
fi

if [ $KUBEVIRT_UNLIMITEDSWAP == "true" ]; then
params=" --unlimited-swap $params"
fi


if [ -n "$KUBEVIRTCI_PROXY" ]; then
params=" --docker-proxy=$KUBEVIRTCI_PROXY $params"
fi
Expand Down
9 changes: 0 additions & 9 deletions cluster-up/cluster/k8s-1.28/provider.sh

This file was deleted.

173 changes: 2 additions & 171 deletions cluster-up/cluster/k8s-provider-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,6 @@ set -e
source "${KUBEVIRTCI_PATH}/cluster/ephemeral-provider-common.sh"


#if UNLIMITEDSWAP is set to true - Kubernetes workloads can use as much swap memory as they request, up to the system limit.
#otherwise Kubernetes workloads can use as much swap memory as they request, up to the system limit by default
function configure_swap_memory () {
if [ "$KUBEVIRT_SWAP_ON" == "true" ] ;then
for nodeNum in $(seq -f "%02g" 1 $KUBEVIRT_NUM_NODES); do
if [ ! -z $KUBEVIRT_SWAP_SIZE_IN_GB ]; then
$ssh node${nodeNum} -- sudo dd if=/dev/zero of=/swapfile count=$KUBEVIRT_SWAP_SIZE_IN_GB bs=1G
$ssh node${nodeNum} -- sudo mkswap /swapfile
fi

$ssh node${nodeNum} -- sudo swapon -a

if [ ! -z $KUBEVIRT_SWAPPINESS ]; then
$ssh node${nodeNum} -- "sudo /bin/su -c \"echo vm.swappiness = $KUBEVIRT_SWAPPINESS >> /etc/sysctl.conf\""
$ssh node${nodeNum} -- sudo sysctl vm.swappiness=$KUBEVIRT_SWAPPINESS
fi

if [ $KUBEVIRT_UNLIMITEDSWAP == "true" ]; then
$ssh node${nodeNum} -- "sudo sed -i ':a;N;\$!ba;s/memorySwap: {}/memorySwap:\n swapBehavior: UnlimitedSwap/g' /var/lib/kubelet/config.yaml"
$ssh node${nodeNum} -- sudo systemctl restart kubelet
fi
done
fi
}

function configure_ksm_module () {
if [ "$KUBEVIRT_KSM_ON" == "true" ] ;then
for nodeNum in $(seq -f "%02g" 1 $KUBEVIRT_NUM_NODES); do
$ssh node${nodeNum} -- "echo 1 | sudo tee /sys/kernel/mm/ksm/run >/dev/null"
if [ ! -z $KUBEVIRT_KSM_SLEEP_BETWEEN_SCANS_MS ]; then
$ssh node${nodeNum} -- "echo ${KUBEVIRT_KSM_SLEEP_BETWEEN_SCANS_MS} | sudo tee /sys/kernel/mm/ksm/sleep_millisecs >/dev/null "
fi
if [ ! -z $KUBEVIRT_KSM_PAGES_TO_SCAN ]; then
$ssh node${nodeNum} -- "echo ${KUBEVIRT_KSM_PAGES_TO_SCAN} | sudo tee /sys/kernel/mm/ksm/pages_to_scan >/dev/null "
fi
done
fi
}

function configure_memory_overcommitment_behavior () {
configure_swap_memory
configure_ksm_module
}

function deploy_cnao() {
if [ "$KUBEVIRT_WITH_CNAO" == "true" ] || [ "$KUBVIRT_WITH_CNAO_SKIP_CONFIG" == "true" ]; then
$kubectl create -f /opt/cnao/namespace.yaml
$kubectl create -f /opt/cnao/network-addons-config.crd.yaml
$kubectl create -f /opt/cnao/operator.yaml

if [ "$KUBVIRT_WITH_CNAO_SKIP_CONFIG" != "true" ]; then
create_network_addons_config
fi

# Install whereabouts on CNAO lanes
$kubectl create -f /opt/whereabouts
fi
}

function deploy_kwok() {
if [[ ${KUBEVIRT_DEPLOY_KWOK} == "true" ]]; then
Expand All @@ -72,129 +14,24 @@ function deploy_kwok() {
fi
}

function create_network_addons_config() {
local nac="/opt/cnao/network-addons-config-example.cr.yaml"
if [ "$KUBEVIRT_WITH_MULTUS_V3" == "true" ]; then
local no_multus_nac="/opt/cnao/no-multus-nac.yaml"
$ssh node01 -- "awk '!/multus/' ${nac} | sudo tee ${no_multus_nac}"
nac=${no_multus_nac}
fi

$kubectl apply -f ${nac}
}

function wait_for_cnao_ready() {
if [ "$KUBEVIRT_WITH_CNAO" == "true" ] || [ "$KUBVIRT_WITH_CNAO_SKIP_CONFIG" == "true" ]; then
$kubectl wait deployment -n cluster-network-addons cluster-network-addons-operator --for condition=Available --timeout=200s
if [ "$KUBVIRT_WITH_CNAO_SKIP_CONFIG" != "true" ]; then
$kubectl wait networkaddonsconfig cluster --for condition=Available --timeout=200s
fi
fi
}

function deploy_multus() {
if [ "$KUBEVIRT_WITH_MULTUS_V3" == "true" ]; then
$kubectl create -f /opt/multus/multus.yaml
fi
}

function wait_for_multus_ready() {
if [ "$KUBEVIRT_WITH_MULTUS_V3" == "true" ]; then
$kubectl rollout status -n kube-system ds/kube-multus-ds --timeout=200s
fi
}

function deploy_istio() {
if [ "$KUBEVIRT_DEPLOY_ISTIO" == "true" ]; then
if [ "$KUBEVIRT_WITH_CNAO" == "true" ]; then
$kubectl create -f /opt/istio/istio-operator-with-cnao.cr.yaml
else
$kubectl create -f /opt/istio/istio-operator.cr.yaml
fi
fi
}

function wait_for_istio_ready() {
if [ "$KUBEVIRT_DEPLOY_ISTIO" == "true" ]; then
istio_operator_ns=istio-system
retries=0
max_retries=20
while [[ $retries -lt $max_retries ]]; do
echo "waiting for istio-operator to be healthy"
sleep 5
health=$($kubectl -n $istio_operator_ns get istiooperator istio-operator -o jsonpath="{.status.status}")
if [[ $health == "HEALTHY" ]]; then
break
fi
retries=$((retries + 1))
done
if [ $retries == $max_retries ]; then
echo "waiting istio-operator to be healthy failed"
exit 1
fi
fi
}

# copy_istio_cni_conf_files copy the generated Istio CNI net conf file
# (at '/etc/cni/multus/net.d/') to where Multus expect CNI net conf files ('/etc/cni/net.d/')
function copy_istio_cni_conf_files() {
if [ "$KUBEVIRT_DEPLOY_ISTIO" == "true" ] && [ "$KUBEVIRT_WITH_CNAO" == "true" ]; then
for nodeNum in $(seq -f "%02g" 1 $KUBEVIRT_NUM_NODES); do
$ssh node${nodeNum} -- "until ls /etc/cni/multus > /dev/null 2>&1; do sleep 1; done"
$ssh node${nodeNum} -- sudo cp -uv /etc/cni/multus/net.d/*istio*.conf /etc/cni/net.d/
done
fi
}

function deploy_cdi() {
if [ "$KUBEVIRT_DEPLOY_CDI" == "true" ]; then
if [ -n "${KUBEVIRT_CUSTOM_CDI_VERSION}" ]; then
$ssh node01 -- 'sudo sed --regexp-extended -i s/v[0-9]+\.[0-9]+\.[0-9]+\(.*\)?$/'"$KUBEVIRT_CUSTOM_CDI_VERSION"'/g /opt/cdi-*-operator.yaml'
fi

LATEST_CDI_OPERATOR=$($ssh node01 -- 'ls -rt /opt/cdi-*-operator.yaml | tail -n 1')
LATEST_CDI_CR=$($ssh node01 -- 'ls -rt /opt/cdi-*-cr.yaml | tail -n 1')
$kubectl create -f $LATEST_CDI_OPERATOR
$kubectl create -f $LATEST_CDI_CR
fi
}

function wait_for_cdi_ready() {
if [ "$KUBEVIRT_DEPLOY_CDI" == "true" ]; then
while [ "$($kubectl get pods --namespace cdi | grep -c 'cdi-')" -lt 4 ]; do
$kubectl get pods --namespace cdi
sleep 10
done
$kubectl wait --for=condition=Ready pod --timeout=180s --all --namespace cdi
fi
}

# configure Prometheus to select kubevirt prometheusrules
function configure_prometheus() {
if [[ $KUBEVIRT_DEPLOY_PROMETHEUS == "true" ]] && $kubectl get crd prometheuses.monitoring.coreos.com; then
_kubectl patch prometheus k8s -n monitoring --type='json' -p='[{"op": "replace", "path": "/spec/ruleSelector", "value":{}}, {"op": "replace", "path": "/spec/ruleNamespaceSelector", "value":{"matchLabels": {}}}]'
fi
}

function deploy_aaq() {
if [ "$KUBEVIRT_DEPLOY_AAQ" == "true" ]; then
if [ -n "${KUBEVIRT_CUSTOM_AAQ_VERSION}" ]; then
$ssh node01 -- 'sudo sed --regexp-extended -i s/v[0-9]+\.[0-9]+\.[0-9]+\(.*\)?$/'"$KUBEVIRT_CUSTOM_AAQ_VERSION"'/g /opt/aaq/aaq-*-operator.yaml'
fi

$kubectl create -f /opt/aaq/aaq-*-operator.yaml
$kubectl create -f /opt/aaq/aaq-*-cr.yaml
fi
}

function wait_for_aaq_ready() {
if [ "$KUBEVIRT_DEPLOY_AAQ" == "true" ]; then
while [ "$($kubectl get pods --namespace aaq | grep -c 'aaq-')" -lt 4 ]; do
$kubectl get pods --namespace aaq
sleep 10
done
$kubectl wait --for=condition=Ready pod --timeout=180s --all --namespace aaq
fi
}

function wait_for_kwok_ready() {
if [ "KUBEVIRT_DEPLOY_KWOK" == "true" ]; then
Expand Down Expand Up @@ -259,17 +96,11 @@ function up() {
$kubectl label node -l $label node-role.kubernetes.io/worker=''

configure_prometheus
configure_memory_overcommitment_behavior
configure_cpu_manager

deploy_cnao
deploy_multus
deploy_istio
deploy_cdi
deploy_aaq
deploy_kwok

until wait_for_cnao_ready && wait_for_istio_ready && wait_for_cdi_ready && wait_for_multus_ready && wait_for_aaq_ready && wait_for_kwok_ready; do
until wait_for_kwok_ready; do
echo "Waiting for cluster components..."
sleep 5
done
Expand Down
2 changes: 1 addition & 1 deletion cluster-up/hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ provider_prefix=${JOB_NAME:-${KUBEVIRT_PROVIDER}}${EXECUTOR_NUMBER}
job_prefix=${JOB_NAME:-kubevirt}${EXECUTOR_NUMBER}

mkdir -p $KUBEVIRTCI_CONFIG_PATH/$KUBEVIRT_PROVIDER
KUBEVIRTCI_TAG=2408151028-a0ad3359
KUBEVIRTCI_TAG=2409091541-4ad94f0b
2 changes: 1 addition & 1 deletion cluster-up/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2408151028-a0ad3359
2409091541-4ad94f0b
2 changes: 1 addition & 1 deletion hack/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cdi_namespace=cdi
image_pull_policy=${IMAGE_PULL_POLICY:-IfNotPresent}
verbosity=${VERBOSITY:-2}
package_name=${PACKAGE_NAME:-kubevirt-dev}
kubevirtci_git_hash="2408151028-a0ad3359"
kubevirtci_git_hash="2409091541-4ad94f0b"
conn_check_ipv4_address=${CONN_CHECK_IPV4_ADDRESS:-""}
conn_check_ipv6_address=${CONN_CHECK_IPV6_ADDRESS:-""}
conn_check_dns=${CONN_CHECK_DNS:-""}
Expand Down

0 comments on commit 33c973d

Please sign in to comment.