Skip to content

Commit ec2594d

Browse files
Merge pull request #6401 from vanhalenar/el10-release-scenarios
USHIFT-6716: Add el10 bootc release scenarios
2 parents d9ab91d + 1d5e452 commit ec2594d

33 files changed

Lines changed: 1310 additions & 68 deletions
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# {{- if env.Getenv "BREW_NIGHTLY_RELEASE_VERSION" "" -}}
2+
# Note: This comment makes templating add a new line before the code
3+
FROM localhost/rhel102-test-agent:latest
4+
5+
# Build arguments
6+
ARG USHIFT_RPM_REPO_NAME=microshift-brew
7+
ARG USHIFT_RPM_REPO_PATH=/tmp/$USHIFT_RPM_REPO_NAME
8+
9+
# Copy the MicroShift repository contents
10+
COPY ./rpm-repos/$USHIFT_RPM_REPO_NAME $USHIFT_RPM_REPO_PATH
11+
12+
# Copy repository configuration
13+
COPY ./bootc-images/$USHIFT_RPM_REPO_NAME.repo ./bootc-images/microshift-fast-datapath-rhel9.repo ./bootc-images/microshift-rhocp-y.repo \
14+
/etc/yum.repos.d/
15+
16+
# Print repository configuration contents.
17+
# Install MicroShift, test agent and cleanup.
18+
RUN dnf repoinfo --enabled && \
19+
dnf install -y firewalld systemd-resolved \
20+
{{ range (env.Getenv "MICROSHIFT_MANDATORY_RPMS" | strings.Split " ") -}}
21+
"{{ . }}-{{ env.Getenv "BREW_NIGHTLY_RELEASE_VERSION" }}" \
22+
{{ end -}}
23+
{{ range (env.Getenv "MICROSHIFT_OPTIONAL_RPMS" | strings.Split " ") -}}
24+
"{{ . }}-{{ env.Getenv "BREW_NIGHTLY_RELEASE_VERSION" }}" \
25+
{{ end -}}
26+
{{ if and (env.Getenv "UNAME_M" "") (eq "x86_64" .Env.UNAME_M) -}}
27+
{{ range (env.Getenv "MICROSHIFT_X86_64_RPMS" | strings.Split " ") -}}
28+
"{{ . }}-{{ env.Getenv "BREW_NIGHTLY_RELEASE_VERSION" }}" \
29+
{{ end -}}
30+
{{ end -}}
31+
&& \
32+
systemctl enable microshift microshift-test-agent && \
33+
rm -vf /etc/yum.repos.d/microshift-*.repo && \
34+
rm -rvf $USHIFT_RPM_REPO_PATH && \
35+
dnf clean all
36+
37+
# Configure firewall
38+
RUN firewall-offline-cmd --zone=public --add-port=22/tcp && \
39+
firewall-offline-cmd --zone=trusted --add-source=10.42.0.0/16 && \
40+
firewall-offline-cmd --zone=trusted --add-source=169.254.169.1 && \
41+
firewall-offline-cmd --zone=trusted --add-source=fd01::/48 && \
42+
firewall-offline-cmd --zone=public --add-port=80/tcp && \
43+
firewall-offline-cmd --zone=public --add-port=443/tcp && \
44+
firewall-offline-cmd --zone=public --add-port=5353/udp && \
45+
firewall-offline-cmd --zone=public --add-port=6443/tcp && \
46+
firewall-offline-cmd --zone=public --add-port=30000-32767/tcp && \
47+
firewall-offline-cmd --zone=public --add-port=30000-32767/udp
48+
49+
# Prepare system for testing Generic Device Plugin
50+
COPY --chmod=755 ./bootc-images/build-serialsim.sh /tmp/build-serialsim.sh
51+
RUN /tmp/build-serialsim.sh && rm -f /tmp/build-serialsim.sh
52+
# {{- end -}}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# {{- if env.Getenv "BREW_LREL_RELEASE_VERSION" "" -}}
2+
# Note: This comment makes templating add a new line before the code
3+
FROM localhost/rhel102-bootc-brew-lrel-optional:latest
4+
5+
# Add fips=1 kernel argument
6+
# See https://containers.github.io/bootc/building/kernel-arguments.html
7+
RUN cat > /usr/lib/bootc/kargs.d/01-fips.toml <<'EOF'
8+
kargs = ["fips=1"]
9+
match-architectures = ["x86_64"]
10+
EOF
11+
12+
# Enable the FIPS crypto policy
13+
#
14+
# Note: CNI plugins are required for podman to operate normally on RHEL 9.x.
15+
# This package is no longer installed as cri-o dependency.
16+
RUN dnf install -y crypto-policies-scripts containernetworking-plugins && \
17+
update-crypto-policies --no-reload --set FIPS && \
18+
dnf clean all
19+
# {{- end -}}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# {{- if env.Getenv "BREW_LREL_RELEASE_VERSION" "" -}}
2+
# Note: This comment makes templating add a new line before the code
3+
FROM localhost/rhel102-bootc-brew-lrel-optional:latest
4+
5+
# Enable microshift-tuned service
6+
RUN systemctl enable microshift-tuned
7+
8+
# Configure MicroShift for low-latency workloads
9+
RUN cat > /etc/microshift/config.yaml <<'EOF'
10+
kubelet:
11+
cpuManagerPolicy: static
12+
cpuManagerPolicyOptions:
13+
full-pcpus-only: "true"
14+
cpuManagerReconcilePeriod: 5s
15+
memoryManagerPolicy: Static
16+
topologyManagerPolicy: single-numa-node
17+
reservedSystemCPUs: 0-1
18+
reservedMemory:
19+
- limits:
20+
memory: 1100Mi
21+
numaNode: 0
22+
kubeReserved:
23+
memory: 500Mi
24+
systemReserved:
25+
memory: 500Mi
26+
evictionHard:
27+
imagefs.available: 15%
28+
memory.available: 100Mi
29+
nodefs.available: 10%
30+
nodefs.inodesFree: 5%
31+
evictionPressureTransitionPeriod: 0s
32+
EOF
33+
34+
# Configure tuned baseline variables
35+
RUN cat > /etc/tuned/microshift-baseline-variables.conf <<'EOF'
36+
# Isolated cores should be complementary to kubelet's reserved CPUs.
37+
# Isolated and reserved CPUs should contain all online CPUs.
38+
# Core #3 is for testing offlining hence skipped.
39+
isolated_cores=2,4-5
40+
hugepages_size=2M
41+
hugepages=10
42+
additional_args=test1=on test2=true dummy
43+
offline_cpu_set=3
44+
EOF
45+
46+
# Configure MicroShift tuned profile
47+
RUN cat > /etc/microshift/tuned.yaml <<'EOF'
48+
profile: microshift-baseline
49+
reboot_after_apply: True
50+
EOF
51+
# {{- end -}}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
start_image="rhel102-bootc-brew-lrel-optional"
6+
7+
# Currently, RHOAI is only available for x86_64
8+
check_platform() {
9+
local -r record_junit=${1:-false}
10+
11+
if [[ "${UNAME_M}" =~ aarch64 ]]; then
12+
if "${record_junit}"; then
13+
record_junit "setup" "scenario_create_vms" "SKIPPED"
14+
fi
15+
exit 0
16+
fi
17+
}
18+
19+
scenario_create_vms() {
20+
check_platform true
21+
exit_if_image_not_found "${start_image}"
22+
23+
# Increased disk size because of the additional embedded images (especially OVMS which is ~3.5GiB)
24+
LVM_SYSROOT_SIZE=20480 prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}"
25+
launch_vm rhel102-bootc --vm_disksize 30 --vm_vcpus 4
26+
}
27+
28+
scenario_remove_vms() {
29+
check_platform
30+
exit_if_image_not_found "${start_image}"
31+
32+
remove_vm host1
33+
}
34+
35+
scenario_run_tests() {
36+
check_platform
37+
exit_if_image_not_found "${start_image}"
38+
39+
run_tests host1 \
40+
suites/ai-model-serving/ai-model-serving-online.robot
41+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
start_image="rhel102-bootc-brew-lrel-optional"
6+
7+
scenario_create_vms() {
8+
exit_if_image_not_found "${start_image}"
9+
10+
prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}"
11+
launch_vm rhel102-bootc --vm_vcpus 4
12+
}
13+
14+
scenario_remove_vms() {
15+
exit_if_image_not_found "${start_image}"
16+
17+
remove_vm host1
18+
}
19+
20+
scenario_run_tests() {
21+
exit_if_image_not_found "${start_image}"
22+
23+
run_tests host1 suites/configuration/
24+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
start_image="rhel102-bootc-brew-lrel-optional"
6+
7+
scenario_create_vms() {
8+
exit_if_image_not_found "${start_image}"
9+
10+
prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}"
11+
launch_vm rhel102-bootc --network "${VM_DUAL_STACK_NETWORK}" --vm_vcpus 4
12+
}
13+
14+
scenario_remove_vms() {
15+
exit_if_image_not_found "${start_image}"
16+
17+
remove_vm host1
18+
}
19+
20+
scenario_run_tests() {
21+
exit_if_image_not_found "${start_image}"
22+
run_tests host1 suites/ipv6/dualstack.robot
23+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
start_image="rhel102-bootc-brew-lrel-fips"
6+
7+
check_platform() {
8+
if [[ "${UNAME_M}" =~ aarch64 ]] ; then
9+
record_junit "setup" "scenario_create_vms" "SKIPPED"
10+
exit 0
11+
fi
12+
}
13+
14+
scenario_create_vms() {
15+
check_platform
16+
exit_if_image_not_found "${start_image}"
17+
18+
prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}"
19+
launch_vm rhel102-bootc --fips --vm_vcpus 4
20+
}
21+
22+
scenario_remove_vms() {
23+
check_platform
24+
exit_if_image_not_found "${start_image}"
25+
26+
remove_vm host1
27+
}
28+
29+
scenario_run_tests() {
30+
check_platform
31+
exit_if_image_not_found "${start_image}"
32+
33+
run_tests host1 suites/fips/
34+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
# Redefine network-related settings to use the dedicated IPv6 network bridge
6+
# shellcheck disable=SC2034 # used elsewhere
7+
VM_BRIDGE_IP="$(get_vm_bridge_ip "${VM_IPV6_NETWORK}")"
8+
# shellcheck disable=SC2034 # used elsewhere
9+
WEB_SERVER_URL="http://[${VM_BRIDGE_IP}]:${WEB_SERVER_PORT}"
10+
11+
start_image="rhel102-bootc-brew-lrel-optional"
12+
13+
scenario_create_vms() {
14+
exit_if_image_not_found "${start_image}"
15+
16+
# Using `hostname` here instead of a raw ip because skopeo only allows either
17+
# ipv4 or fqdn's, but not ipv6. Since the registry is hosted on the ipv6
18+
# network gateway in the host, we need to use a combination of the hostname
19+
# plus /etc/hosts resolution (which is taken care of by kickstart).
20+
# Save the original value and temporarily override for prepare_kickstart
21+
local original_mirror_registry_url="${MIRROR_REGISTRY_URL}"
22+
MIRROR_REGISTRY_URL="$(hostname):${MIRROR_REGISTRY_PORT}/microshift"
23+
24+
# Enable IPv6 single stack in kickstart
25+
prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" false true
26+
27+
# Restore original MIRROR_REGISTRY_URL for runtime use
28+
MIRROR_REGISTRY_URL="${original_mirror_registry_url}"
29+
30+
launch_vm rhel102-bootc --network "${VM_IPV6_NETWORK}" --vm_vcpus 4
31+
}
32+
33+
scenario_remove_vms() {
34+
exit_if_image_not_found "${start_image}"
35+
36+
remove_vm host1
37+
}
38+
39+
scenario_run_tests() {
40+
exit_if_image_not_found "${start_image}"
41+
42+
run_tests host1 suites/ipv6/singlestack.robot
43+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
start_image="rhel102-bootc-brew-lrel-optional"
6+
7+
scenario_create_vms() {
8+
exit_if_image_not_found "${start_image}"
9+
10+
prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}"
11+
launch_vm "${start_image}" --vm_vcpus 4
12+
}
13+
14+
scenario_remove_vms() {
15+
exit_if_image_not_found "${start_image}"
16+
17+
remove_vm host1
18+
}
19+
20+
scenario_run_tests() {
21+
exit_if_image_not_found "${start_image}"
22+
23+
run_tests host1 \
24+
--variable "EXPECTED_OS_VERSION:10.2" \
25+
suites/standard1/
26+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Sourced from scenario.sh and uses functions defined there.
4+
5+
start_image="rhel102-bootc-brew-lrel-optional"
6+
7+
scenario_create_vms() {
8+
exit_if_image_not_found "${start_image}"
9+
10+
prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}"
11+
launch_vm "${start_image}" --vm_vcpus 4
12+
}
13+
14+
scenario_remove_vms() {
15+
exit_if_image_not_found "${start_image}"
16+
17+
remove_vm host1
18+
}
19+
20+
scenario_run_tests() {
21+
exit_if_image_not_found "${start_image}"
22+
23+
run_tests host1 suites/standard2/
24+
}

0 commit comments

Comments
 (0)