Skip to content

Commit

Permalink
Abstract rpms creation into step in kickstart-tests workflow
Browse files Browse the repository at this point in the history
We need these RPMs on two places because of kickstart tests for initial-setup.
Let's create them separately and lets use our anaconda-rpm container instead
which has all the required dependencies already.

This container is build now but that will be better when we will start pushing
this container to quay.io repository. Until then this will be a bit slower than
before.
  • Loading branch information
jkonecny12 committed Feb 9, 2021
1 parent b204746 commit e52c500
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/kickstart-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
timeout-minutes: 300
env:
LORAX_BUILD_CONTAINER: fedora:rawhide
ANACONDA_BUILD_CONTAINER: quay.io/rhinstaller/anaconda-rpm:master
ANACONDA_RPMS_DIR: anaconda-rpms
STATUS_NAME: kickstart-test
steps:
# we post statuses manually as this does not run from a pull_request event
Expand Down Expand Up @@ -117,6 +119,16 @@ jobs:
# scripts/makeupdates
# gzip -cd updates.img | cpio -tv

- name: Build Anaconda rpm files
run: |
# Use ${{ env.ANACONDA_BUILD_CONTAINER }} container because it has all the dependencies for build
make -f Makefile.am anaconda-rpm-build
# build RPMs; bump version so that it's higher than rawhide's
sed -ri '/AC_INIT/ s/\[[0-9.]+\]/[999999999]/' configure.ac
mkdir -p ${{ env.ANACONDA_RPMS_DIR }}
podman run --rm -i -v `pwd`:/anaconda:ro,Z -v `pwd`/${{ env.ANACONDA_RPMS_DIR }}:/anaconda-rpms:Z --env RPM_BUILD_DIR=/anaconda-rpms ${{ env.ANACONDA_BUILD_CONTAINER }} /anaconda/dockerfile/anaconda-ci/run-build-and-arg make rpms
- name: Build boot.iso from Rawhide and this branch
run: |
mkdir -p kickstart-tests/data/images
Expand All @@ -126,26 +138,23 @@ jobs:
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 -i --rm --privileged --tmpfs /var/tmp:rw,mode=1777 -v `pwd`:/source:ro -v `pwd`/kickstart-tests/data/images:/images:z ${{ env.LORAX_BUILD_CONTAINER }} <<EOF
sudo podman run -i --rm --privileged --tmpfs /var/tmp:rw,mode=1777 -v `pwd`/${{ env.ANACONDA_RPMS_DIR }}:/anaconda-rpms:ro -v `pwd`:/source:ro -v `pwd`/kickstart-tests/data/images:/images:z ${{ env.LORAX_BUILD_CONTAINER }} <<EOF
set -eux
# /source from host is read-only, build in a copy
cp -a /source/ /tmp/
cd /tmp/source
# install build dependencies and lorax
./scripts/testing/install_dependencies.sh -y
# install lorax
dnf install -y createrepo_c lorax
# build RPMs and repo for it; bump version so that it's higher than rawhide's
sed -ri '/AC_INIT/ s/\[[0-9.]+\]/[999999999]/' configure.ac
./autogen.sh
./configure
make rpms
createrepo_c result/build/01-rpm-build/
# create repository
mkdir -p /tmp/anaconda-rpms
cp -a /anaconda-rpms/*.rpm /tmp/anaconda-rpms
createrepo_c /tmp/anaconda-rpms
# build boot.iso with our rpms
. /etc/os-release
lorax -p Fedora -v \$VERSION_ID -r \$VERSION_ID -s http://pubmirror1.math.uh.edu/fedora-buffet/fedora/linux/development/rawhide/Everything/x86_64/os/ -s file://\$PWD/result/build/01-rpm-build/ lorax
lorax -p Fedora -v \$VERSION_ID -r \$VERSION_ID -s http://pubmirror1.math.uh.edu/fedora-buffet/fedora/linux/development/rawhide/Everything/x86_64/os/ -s file://tmp/anaconda-rpms/ lorax
cp lorax/images/boot.iso /images/
EOF
Expand All @@ -158,6 +167,10 @@ jobs:
- name: Run kickstart tests with ${{ needs.pr-info.outputs.launch_args }} in container
working-directory: kickstart-tests
run: |
# Copy Anaconda rpms to data directory to be used in the container for initials-setup tests
mkdir -p data/additional_repo
cp -a ./${{ env.ANACONDA_RPMS_DIR }} ./data/additional_repo/
sudo TEST_JOBS=16 containers/runner/launch --skip-testtypes 'rhel-only,knownfailure' ${{ needs.pr-info.outputs.launch_args }}
- name: Collect logs
Expand Down
6 changes: 3 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ USER_SITE_BASE ?= $(abs_top_builddir)/python-site
USER_SITE_PACKAGES ?= $(shell PYTHONUSERBASE=$(USER_SITE_BASE) $(PYTHON) -m site --user-site)

RESULT_DIR ?= $(abs_top_builddir)/result
BUILD_RESULT_DIR = $(RESULT_DIR)/build
BUILD_RESULT_DIR ?= $(RESULT_DIR)/build
TEST_RESULT_DIR = $(RESULT_DIR)/tests

SRPM_BUILD_DIR = $(BUILD_RESULT_DIR)/00-srpm-build
RPM_BUILD_DIR = $(BUILD_RESULT_DIR)/01-rpm-build
SRPM_BUILD_DIR ?= $(BUILD_RESULT_DIR)/00-srpm-build
RPM_BUILD_DIR ?= $(BUILD_RESULT_DIR)/01-rpm-build
TEST_INST_BUILD_DIR = $(BUILD_RESULT_DIR)/02-test-install

CONTAINER_ENGINE ?= podman
Expand Down

0 comments on commit e52c500

Please sign in to comment.