Skip to content

Build and test daily RHEL boot.iso #1045

Build and test daily RHEL boot.iso

Build and test daily RHEL boot.iso #1045

name: Build and test daily RHEL boot.iso
on:
schedule:
- cron: 0 3 * * *
# be able to start this action manually from a actions tab when needed
workflow_dispatch:
jobs:
build:
name: run
runs-on: [self-hosted, kstest]
env:
LORAX_BUILD_CONTAINER: registry.access.redhat.com/ubi8
steps:
# self-hosted runners don't do this automatically; also useful to keep stuff around for debugging
# need to run sudo as the launch script and the container create root/other user owned files
- name: Clean up previous run
run: |
sudo podman ps -q --all --filter='ancestor=kstest-runner' | xargs -tr sudo podman rm -f
sudo podman volume rm --all || true
sudo rm -rf *
- name: Update container images used here
run: |
sudo podman pull ${{ env.LORAX_BUILD_CONTAINER }}
sudo podman pull quay.io/rhinstaller/kstest-runner:latest
- name: Checkout repository
uses: actions/[email protected]
- name: Build boot.iso with lorax
run: |
mkdir build
# We have to pre-create loop devices because they are not namespaced in kernel so
# podman can't access newly created ones. That caused failures of tests when runners
# were rebooted.
sudo mknod -m 0660 /dev/loop0 b 7 0 2> /dev/null || true
sudo mknod -m 0660 /dev/loop1 b 7 1 2> /dev/null || true
# /var/tmp tmpfs speeds up lorax and avoids https://bugzilla.redhat.com/show_bug.cgi?id=1906364
sudo podman run --rm -i --privileged --tmpfs /var/tmp:rw,mode=1777 --network host -v $PWD/build:/data ${{ env.LORAX_BUILD_CONTAINER }} <<EOF
set -eux
# lorax must run on RHEL host to produce RHEL guest images :-(
# need to enable internal repos so that we don't need a subscription;
rm /etc/yum.repos.d/*
cat <<EOR > /etc/yum.repos.d/rhel8.repo
[RHEL-8-BaseOS]
name=baseos
baseurl=http://download.devel.redhat.com/nightly/rhel-8/RHEL-8/latest-RHEL-8/compose/BaseOS/x86_64/os/
enabled=1
gpgcheck=0
install_weak_deps=0
module_hotfixes=1
[RHEL-8-AppStream]
name=appstream
baseurl=http://download.devel.redhat.com/nightly/rhel-8/RHEL-8/latest-RHEL-8/compose/AppStream/x86_64/os/
enabled=1
gpgcheck=0
install_weak_deps=0
module_hotfixes=1
EOR
dnf install -y lorax
cd /data
# don't mess around with the volid too much, it causes different network interface naming:
# https://github.com/rhinstaller/kickstart-tests/issues/448
lorax -p "Red Hat Enterprise Linux" \
--version 8 --release 8 --variant=BaseOS --volid=RHEL-8-0-0-BaseOS-x86_64 --nomacboot \
-s http://download.devel.redhat.com/nightly/rhel-8/RHEL-8/latest-RHEL-8/compose/BaseOS/x86_64/os/ \
-s http://download.devel.redhat.com/nightly/rhel-8/RHEL-8/latest-RHEL-8/compose/AppStream/x86_64/os/ \
-s http://download.devel.redhat.com/nightly/rhel-8/RHEL-8/latest-RHEL-8/compose/CRB/x86_64/os/ \
-s http://coprbe.devel.redhat.com/results/rhinstaller-group/Anaconda/rhel-8.dev-x86_64/ \
/data/results
# Make generated files accessible
chmod -R a+rX .
EOF
- name: Upload image build log artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: image-build-logs
path: |
build/*.log
build/*.txt
# useful for manual local debugging
- name: Store generated boot.iso in home directory
run: cp build/results/images/boot.iso /home/github/rhel8-daily-boot.iso
- name: Set up data directory for test
run: |
mkdir -p data/images
cp /home/github/rhel8-daily-boot.iso data/images/boot.iso
- name: Run coverage tests
run: |
source $PWD/containers/runner/skip-testtypes
sudo TEST_JOBS=16 containers/runner/launch --retry --testtype coverage --skip-testtypes "$SKIP_TESTTYPES_RHEL8_DAILY" --platform rhel8
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v3
with:
name: 'logs-rhel8-daily'
# skip the /anaconda subdirectories, too large
path: |
data/logs/kstest.log
data/logs/kstest-*/*.log
- name: Clean up
if: always()
run: |
# just in case it leaves some behind
sudo losetup -d /dev/loop0 2>/dev/null || true
sudo losetup -d /dev/loop1 2>/dev/null || true
sudo rm -rf build