Skip to content

Commit

Permalink
Add nutanix os image step (#52204)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgaoshang authored Jun 5, 2024
1 parent f115846 commit 8263ae7
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,13 @@ tests:
test:
- ref: cucushift-installer-check-cluster-health
workflow: cucushift-installer-rehearse-gcp-upi-xpn
- as: nutanix-ipi-zones-single-f28
- as: nutanix-ipi-zones-single-os-image-f28
cluster: build01
cron: 27 16 16 * *
steps:
cluster_profile: nutanix-qe-zone
env:
CLUSTER_OS_IMAGE: https://rhcos.mirror.openshift.com/art/storage/prod/streams/4.16-9.4/builds/416.94.202405171948-0/x86_64/rhcos-416.94.202405171948-0-nutanix.x86_64.qcow2
EXTRACT_MANIFEST_INCLUDED: "true"
SINGLE_ZONE: "true"
test:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5688,7 +5688,7 @@ periodics:
ci.openshift.io/generator: prowgen
job-release: "4.16"
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: periodic-ci-openshift-verification-tests-master-installation-nightly-4.16-nutanix-ipi-zones-single-f28
name: periodic-ci-openshift-verification-tests-master-installation-nightly-4.16-nutanix-ipi-zones-single-os-image-f28
spec:
containers:
- args:
Expand All @@ -5697,8 +5697,8 @@ periodics:
- --lease-server-credentials-file=/etc/boskos/credentials
- --report-credentials-file=/etc/report/credentials
- --secret-dir=/secrets/ci-pull-credentials
- --secret-dir=/usr/local/nutanix-ipi-zones-single-f28-cluster-profile
- --target=nutanix-ipi-zones-single-f28
- --secret-dir=/usr/local/nutanix-ipi-zones-single-os-image-f28-cluster-profile
- --target=nutanix-ipi-zones-single-os-image-f28
- --variant=installation-nightly-4.16
command:
- ci-operator
Expand All @@ -5715,7 +5715,7 @@ periodics:
- mountPath: /secrets/ci-pull-credentials
name: ci-pull-credentials
readOnly: true
- mountPath: /usr/local/nutanix-ipi-zones-single-f28-cluster-profile
- mountPath: /usr/local/nutanix-ipi-zones-single-os-image-f28-cluster-profile
name: cluster-profile
- mountPath: /secrets/gcs
name: gcs-credentials
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
approvers:
- jianlinliu
- gpei
- sgaoshang
reviewers:
- jianlinliu
- gpei
- sgaoshang
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

check_result=0

if [[ -z ${CLUSTER_OS_IMAGE} ]]; then
echo "CLUSTER_OS_IMAGE is not set, skip checking os-image setting"
exit "${check_result}"
fi

echo "CLUSTER_OS_IMAGE is set, check boot os-image setting"

version_os_image=$(echo "$CLUSTER_OS_IMAGE" | cut -d / -f10)
nodes_list=$(oc get nodes -ojson | jq -r '.items[].metadata.name')
for node in $nodes_list; do
if oc debug node/"$node" -n default -- chroot /host journalctl | grep "Booted osImageURL" | grep "$version_os_image"; then
echo "Pass: passed to check node: $node boot os image $version_os_image"
else
echo "Fail: failed to check node: $node boot os image $version_os_image"
check_result=$((check_result + 1))
fi
done

exit "${check_result}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"path": "cucushift/installer/check/nutanix/os-image/cucushift-installer-check-nutanix-os-image-ref.yaml",
"owners": {
"approvers": [
"jianlinliu",
"gpei",
"sgaoshang"
],
"reviewers": [
"jianlinliu",
"gpei",
"sgaoshang"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ref:
as: cucushift-installer-check-nutanix-os-image
from_image:
namespace: ocp
name: "4.14"
tag: upi-installer
commands: cucushift-installer-check-nutanix-os-image-commands.sh
resources:
requests:
cpu: 10m
memory: 100Mi
env:
- name: CLUSTER_OS_IMAGE
default: ""
documentation: |-
Override the default OS image provided in rhcos.json
documentation: |-
Check nutanix os-image setting.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ chain:
steps:
- chain: ipi-conf-nutanix
- ref: ipi-conf-nutanix-zones
- ref: ipi-conf-osimage-nutanix
- chain: ipi-install
- ref: configure-registry-storage-nutanix
- ref: enable-qe-catalogsource
- chain: cucushift-installer-check
- ref: cucushift-installer-check-nutanix-zones
- ref: cucushift-installer-check-nutanix-os-image
documentation: |-
Create an IPI cluster with failureDomains on Nutanix for QE e2e tests.
10 changes: 10 additions & 0 deletions ci-operator/step-registry/ipi/conf/osimage/nutanix/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
approvers:
- jianlinliu
- gpei
- sgaoshang
- jinyunma
reviewers:
- jianlinliu
- gpei
- sgaoshang
- jinyunma
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

if [[ -z ${CLUSTER_OS_IMAGE} ]]; then
echo "CLUSTER_OS_IMAGE is not set, skip setting clusterOSImage"
else
CONFIG="${SHARED_DIR}/install-config.yaml"
PATCH="${SHARED_DIR}/install-config-osimage.yaml.patch"

cat >"${PATCH}" <<EOF
platform:
nutanix:
clusterOSImage: ${CLUSTER_OS_IMAGE}
EOF

yq-go m -x -i "${CONFIG}" "${PATCH}"
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"path": "ipi/conf/osimage/nutanix/ipi-conf-osimage-nutanix-ref.yaml",
"owners": {
"approvers": [
"jianlinliu",
"gpei",
"sgaoshang",
"jinyunma"
],
"reviewers": [
"jianlinliu",
"gpei",
"sgaoshang",
"jinyunma"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ref:
as: ipi-conf-osimage-nutanix
from_image:
namespace: ocp
name: "4.12"
tag: upi-installer
commands: ipi-conf-osimage-nutanix-commands.sh
resources:
requests:
cpu: 10m
memory: 100Mi
env:
- name: CLUSTER_OS_IMAGE
default: ""
documentation: |-
Override the default OS image provided in rhcos.json
documentation: |-
Specify the url to get rhcos boot image

0 comments on commit 8263ae7

Please sign in to comment.