ci: use package-manager dependency install scripts

Currently, adding a package which is required either for development or testing
requires it to be added in multiple places due to many duplicated Dockerfiles
and installation scripts. This makes it difficult to ensure that all scripts
are updated appropriately and can lead to some places being missed.

This patch consolidates the list of dependencies and adds installation
scripts for each package-manager used in our CI (apk, apt, dnf, pacman).

This change also replaces the `debian/dev-packages.lst` as this subfolder
conflicts with the Ubuntu/Debian packing scripts used for CRIU:
https://github.com/rst0git/criu-deb-packages

This patch also removes the CentOS 8 build scripts as it is EOL
and the container registry is no longer available.

Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
Shashank Balaji 2025-09-17 19:14:36 +09:00 committed by Andrei Vagin
parent 67751bc11b
commit 25f8be0f60
35 changed files with 295 additions and 459 deletions

View file

@ -11,7 +11,7 @@ ifdef CLANG
target-suffix = -clang
endif
TARGETS := alpine fedora-rawhide centos8 archlinux
TARGETS := alpine fedora-rawhide archlinux
ZDTM_OPTS :=
UNAME := $(shell uname -m)
export UNAME

View file

@ -1,23 +0,0 @@
#!/bin/bash
set -e -x
export DEBIAN_FRONTEND=noninteractive
install_retry_counter=0
max_apt_retries=5
# This function loops a couple of times over apt-get, hoping to
# avoid CI errors due to errors during apt-get
# hashsum mismatches, DNS errors and similar things
while true; do
(( install_retry_counter+=1 ))
if [ "${install_retry_counter}" -gt "${max_apt_retries}" ]; then
exit 1
fi
apt-get update -y && apt-get install -y --no-install-recommends "$@" && break
# In case it is a network error let's wait a bit.
echo "Retrying attempt ${install_retry_counter}"
sleep "${install_retry_counter}"
done

View file

@ -7,7 +7,7 @@ set -x -e -o pipefail
# https://github.com/moby/moby/issues/50750 for details on the bug.
export DEBIAN_FRONTEND=noninteractive
apt remove -y docker-ce docker-ce-cli
./apt-install -y ca-certificates curl
../../contrib/apt-install -y ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
@ -18,7 +18,7 @@ echo \
apt update -y
apt-cache madison docker-ce | awk '{ print $3 }'
verstr="$(apt-cache madison docker-ce | awk '{ print $3 }' | sort | grep -v ':28\.'| tail -n 1)"
./apt-install -y "docker-ce=$verstr" "docker-ce-cli=$verstr"
../../contrib/apt-install -y "docker-ce=$verstr" "docker-ce-cli=$verstr"
# docker checkpoint and restore is an experimental feature
echo '{ "experimental": true }' > /etc/docker/daemon.json

View file

@ -2,6 +2,8 @@
cd ../.. || exit 1
sudo modprobe iptable_filter
failures=""
docker build -t criu-openj9-ubuntu-test:latest -f scripts/build/Dockerfile.openj9-ubuntu .

View file

@ -4,7 +4,7 @@ set -o nounset
set -o errexit
set -x
./apt-install \
../../contrib/apt-install \
apt-transport-https \
ca-certificates \
curl \
@ -19,7 +19,7 @@ add-apt-repository \
$(lsb_release -cs) \
stable test"
./apt-install docker-ce
../../contrib/apt-install docker-ce
# shellcheck source=/dev/null
. /etc/lsb-release

View file

@ -1,43 +1,22 @@
#!/bin/bash
set -e -x
contrib/dependencies/dnf-packages.sh
dnf install -y \
diffutils \
e2fsprogs \
findutils \
gawk \
gcc \
git \
gnutls-devel \
gzip \
iproute \
iptables \
nftables \
nftables-devel \
libaio-devel \
libasan \
libcap-devel \
libnet-devel \
libnl3-devel \
libbsd-devel \
kmod \
libselinux-utils \
make \
procps-ng \
protobuf-c-devel \
protobuf-devel \
python3-PyYAML \
python3-protobuf \
python3-pip \
python3-importlib-metadata \
python-unversioned-command \
redhat-rpm-config \
sudo \
tar \
which \
e2fsprogs \
rubygem-asciidoctor \
libdrm-devel \
libuuid-devel \
kmod
which
# /tmp is no longer 755 in the rawhide container image and breaks CI - fix it
chmod 1777 /tmp

View file

@ -1,12 +1,7 @@
#!/bin/bash
set -x -e
CI_PKGS=(protobuf-c-compiler libprotobuf-c-dev libaio-dev libgnutls28-dev
libgnutls30 libprotobuf-dev protobuf-compiler libcap-dev
libnl-3-dev gdb bash libnet-dev util-linux asciidoctor
libnl-route-3-dev time libbsd-dev python3-yaml uuid-dev
libperl-dev pkg-config python3-protobuf python3-pip
python3-importlib-metadata libdrm-dev)
CI_PKGS=()
X86_64_PKGS=(gcc-multilib)
@ -60,7 +55,8 @@ ci_prep () {
CI_PKGS+=("${X86_64_PKGS[@]}")
fi
scripts/ci/apt-install "${CI_PKGS[@]}"
contrib/dependencies/apt-packages.sh
contrib/apt-install "${CI_PKGS[@]}"
chmod a+x "$HOME"
}
@ -187,7 +183,7 @@ if [ "${COMPAT_TEST}x" = "yx" ] ; then
done
apt-get remove "${INCOMPATIBLE_LIBS[@]}"
dpkg --add-architecture i386
scripts/ci/apt-install "${IA32_PKGS[@]}"
contrib/apt-install "${IA32_PKGS[@]}"
mkdir -p /usr/lib/x86_64-linux-gnu/
mv "$REFUGE"/* /usr/lib/x86_64-linux-gnu/
fi

View file

@ -22,9 +22,8 @@ setup() {
wget --no-check-certificate https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}-1_"$(dpkg --print-architecture)".deb -O /tmp/vagrant.deb && \
dpkg -i /tmp/vagrant.deb
./apt-install libvirt-clients libvirt-daemon-system libvirt-dev qemu-utils qemu-system \
ruby build-essential libxml2-dev qemu-kvm rsync ebtables dnsmasq-base \
openssh-client
../../contrib/apt-install libvirt-clients libvirt-daemon-system libvirt-dev qemu-utils qemu-system \
ruby build-essential libxml2-dev qemu-kvm rsync ebtables dnsmasq-base openssh-client
systemctl restart libvirtd
vagrant plugin install vagrant-libvirt
vagrant init cloud-image/fedora-${FEDORA_VERSION} --box-version ${FEDORA_BOX_VERSION}
@ -41,16 +40,13 @@ setup() {
vagrant up --provider=libvirt --no-tty
mkdir -p /root/.ssh
vagrant ssh-config >> /root/.ssh/config
ssh default sudo dnf upgrade -y
ssh default sudo dnf install -y gcc git gnutls-devel nftables-devel libaio-devel \
libasan libcap-devel libnet-devel libnl3-devel libbsd-devel make protobuf-c-devel \
protobuf-devel python3-protobuf python3-importlib-metadata \
rubygem-asciidoctor iptables libselinux-devel libbpf-devel python3-yaml libuuid-devel
# Disable sssd to avoid zdtm test failures in pty04 due to sssd socket
ssh default sudo systemctl mask sssd
ssh default 'sudo mkdir -p --mode=777 /vagrant && mv $HOME/criu.tar /vagrant && cd /vagrant && tar xf criu.tar'
ssh default sudo dnf upgrade -y
ssh default sudo /vagrant/criu/contrib/dependencies/dnf-packages.sh
ssh default cat /proc/cmdline
}