From f5bfb22355befeddfc4f313b753f81fe919b8e98 Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Sun, 15 Nov 2020 11:10:09 +0100 Subject: [PATCH] schutzbot: pin osbuild-composer Pin the osbuild-composer that schutzbot runs a reverse dependency test against. This allows to control which exact version to test against, and ensures that PRs against osbuild always run against the same version. Now that osbuild-composer's CI uploads RPMs to a predictable destination (the same one that osbuild uses), we can use that instead of rebuilding osbuild-composer on every CI run. This should speed up the mockbuild stage considerably. Pin it to v24 now. --- schutzbot/deploy.sh | 17 +++++++++++++++-- schutzbot/mockbuild.sh | 6 ++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/schutzbot/deploy.sh b/schutzbot/deploy.sh index 5276c40f..c10b9148 100755 --- a/schutzbot/deploy.sh +++ b/schutzbot/deploy.sh @@ -1,6 +1,11 @@ #!/bin/bash set -euxo pipefail +DNF_REPO_BASEURL=http://osbuild-composer-repos.s3-website.us-east-2.amazonaws.com + +# The osbuild-composer commit to run reverse-dependency test against. +OSBUILD_COMPOSER_COMMIT=692a8076bb4bf38dae05ce99631ebcdd3f0ab054 + # Get OS details. source /etc/os-release ARCH=$(uname -m) @@ -14,15 +19,23 @@ fi # Add osbuild team ssh keys. cat schutzbot/team_ssh_keys.txt | tee -a ~/.ssh/authorized_keys > /dev/null -# Set up a dnf repository with the RPMs we want to test +# Set up dnf repositories with the RPMs we want to test sudo tee /etc/yum.repos.d/osbuild.repo << EOF [osbuild] name=osbuild ${GIT_COMMIT} -baseurl=http://osbuild-composer-repos.s3-website.us-east-2.amazonaws.com/osbuild/${ID}-${VERSION_ID}/${ARCH}/${GIT_COMMIT} +baseurl=${DNF_REPO_BASEURL}/osbuild/${ID}-${VERSION_ID}/${ARCH}/${GIT_COMMIT} enabled=1 gpgcheck=0 # Default dnf repo priority is 99. Lower number means higher priority. priority=5 + +[osbuild-composer] +name=osbuild-composer ${OSBUILD_COMPOSER_COMMIT} +baseurl=${DNF_REPO_BASEURL}/osbuild-composer/${ID}-${VERSION_ID}/${ARCH}/${OSBUILD_COMPOSER_COMMIT} +enabled=1 +gpgcheck=0 +# Give this a slightly lower priority, because we used to have osbuild in this repo as well. +priority=10 EOF if [[ $ID == rhel ]]; then diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index aa311edd..f0e2676d 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -65,14 +65,12 @@ greenprint "📤 RPMS will be uploaded to: ${REPO_URL}" # Build source RPMs. greenprint "🔧 Building source RPMs." make srpm -git clone --quiet https://github.com/osbuild/osbuild-composer osbuild-composer -make -C osbuild-composer srpm # Compile RPMs in a mock chroot greenprint "🎁 Building RPMs with mock" sudo mock -r $MOCK_CONFIG --no-bootstrap-chroot \ - --resultdir $REPO_DIR --with=tests \ - rpmbuild/SRPMS/*.src.rpm osbuild-composer/rpmbuild/SRPMS/*.src.rpm + --resultdir $REPO_DIR \ + rpmbuild/SRPMS/*.src.rpm sudo chown -R $USER ${REPO_DIR} # Change the ownership of all of our repo files from root to our CI user.