Skip to content

Commit

Permalink
ci: improve maintenance of test containers
Browse files Browse the repository at this point in the history
Consolidate list of package generation into test-packages.sh tool.
  • Loading branch information
Henrik66 committed Jul 15, 2023
1 parent 30a2f8c commit 9371948
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 185 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ jobs:
- { dockerfile: 'Dockerfile-Debian', tag: 'debian:latest' }
- { dockerfile: 'Dockerfile-Gentoo', tag: 'gentoo:latest' }
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
Expand Down
53 changes: 1 addition & 52 deletions test/container/Dockerfile-Arch
Original file line number Diff line number Diff line change
Expand Up @@ -9,56 +9,5 @@ RUN su build -c 'cd && git clone https://aur.archlinux.org/paru-bin.git && cd pa

# Install needed packages for the dracut CI container
# Assume that initramfs virtual package is installed so that the default mkinitcpio package does not get installed
RUN su build -c 'paru --needed --noconfirm -Syu --assume-installed initramfs \
asciidoc \
astyle \
bash-completion \
biosdevname \
bluez \
btrfs-progs \
busybox \
bzip2 \
cifs-utils \
connman \
cpio \
cryptsetup \
dash \
dhclient \
dhcp \
dmraid \
e2fsprogs \
f2fs-tools \
fuse3 \
iproute \
iputils \
kbd \
linux \
lvm2 \
lzop \
mdadm \
memstrack \
multipath-tools \
nbd \
ndctl \
networkmanager \
nfs-utils \
ntfs-3g \
nvme-cli \
open-iscsi \
parted \
pcsclite \
pigz \
qemu \
rng-tools \
sbsigntools \
shellcheck \
shfmt \
squashfs-tools \
strace \
tar \
tcpdump \
tgt \
tpm2-tools \
vi \
which' \
RUN su build -c "paru --needed --noconfirm -Syu --assume-installed initramfs $(./tools/test-packages.sh)" \
&& yes | paru -Sccd
64 changes: 5 additions & 59 deletions test/container/Dockerfile-Debian
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,12 @@ FROM docker.io/debian:latest

MAINTAINER https://github.com/dracutdevs/dracut

COPY tools/* /tmp/
WORKDIR /tmp

# Install needed packages for the dracut CI container
# Install dracut as a linux-initramfs-tool provider so that the default initramfs-tool package does not get installed
# Uninstall initramfs-tools-core as a workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=994492
RUN apt-get update -y -qq && apt-get upgrade -y -qq && apt-get install -y -qq --no-install-recommends dracut && \
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends -o Dpkg::Use-Pty=0 \
asciidoc \
astyle \
btrfs-progs \
busybox-static \
bzip2 \
ca-certificates \
console-setup \
cpio \
cryptsetup \
curl \
dash \
debhelper \
debhelper-compat \
dmraid \
docbook \
docbook-xml \
docbook-xsl \
fdisk \
g++ \
gawk \
git \
iputils-arping \
iputils-ping \
isc-dhcp-client \
isc-dhcp-server \
kmod \
less \
libdmraid-dev \
libkmod-dev \
linux-image-generic \
lvm2 \
make \
mdadm \
multipath-tools \
nbd-client \
nbd-server \
network-manager \
nfs-kernel-server \
ntfs-3g \
open-iscsi \
ovmf \
parted \
pigz \
pkg-config \
procps \
qemu-system-x86 \
quilt \
shellcheck \
squashfs-tools \
strace \
sudo \
systemd-boot-efi \
tcpdump \
tgt \
thin-provisioning-tools \
vim \
wget \
RUN apt-get update -y -qq && apt-get upgrade -y -qq && apt-get install -y -qq --no-install-recommends dracut && pwd && ls -Rla | grep dracut && \
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends -o Dpkg::Use-Pty=0 $(/tmp/tools/test-packages.sh) \
&& apt-get clean && dpkg -P --force-depends dracut dracut-core initramfs-tools-core
66 changes: 1 addition & 65 deletions test/container/Dockerfile-Fedora-latest
Original file line number Diff line number Diff line change
Expand Up @@ -3,69 +3,5 @@ FROM registry.fedoraproject.org/fedora:latest
MAINTAINER https://github.com/dracutdevs/dracut

# Install needed packages for the dracut CI container
RUN dnf -y install --setopt=install_weak_deps=False \
asciidoc \
bash-completion \
biosdevname \
bluez \
btrfs-progs \
busybox \
bzip2 \
cifs-utils \
cryptsetup \
dash \
dbus-daemon \
device-mapper-multipath \
dhcp-client \
dhcp-server \
dmraid \
e2fsprogs \
f2fs-tools \
fcoe-utils \
fuse3 \
gcc \
git \
iproute \
iputils \
iscsi-initiator-utils \
kbd \
kernel \
kmod-devel \
libkcapi-hmaccalc \
libselinux-utils \
lvm2 \
lzop \
make \
mdadm \
memstrack \
mksh \
nbd \
ndctl \
NetworkManager \
nfs-utils \
ntfs-3g \
ntfsprogs \
nvme-cli \
parted \
pcsc-lite \
pigz \
qemu-system-x86-core \
rng-tools \
rpm-build \
sbsigntools \
scsi-target-utils \
ShellCheck \
shfmt \
squashfs-tools \
strace \
sudo \
systemd-boot-unsigned \
systemd-networkd \
systemd-resolved \
tar \
tcpdump \
tpm2-tools \
wget \
which \
xz \
RUN dnf -y install --setopt=install_weak_deps=False $(./tools/test-packages.sh) \
&& dnf -y remove dracut --noautoremove && dnf -y update && dnf clean all
8 changes: 1 addition & 7 deletions test/container/Dockerfile-OpenSuse-latest
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,5 @@ FROM registry.opensuse.org/opensuse/tumbleweed-dnf:latest
MAINTAINER https://github.com/dracutdevs/dracut

# Install needed packages for the dracut CI container
RUN dnf -y install --setopt=install_weak_deps=False \
dash asciidoc mdadm lvm2 dmraid cryptsetup nfs-utils nbd dhcp-server \
strace libkmod-devel gcc bzip2 xz tar wget rpm-build make git bash-completion \
sudo kernel dhcp-client qemu-kvm /usr/bin/qemu-system-$(uname -m) e2fsprogs \
tcpdump iproute iputils kbd NetworkManager btrfsprogs tgt dbus-broker \
iscsiuio open-iscsi which ShellCheck shfmt procps pigz parted squashfs ntfsprogs \
multipath-tools util-linux-systemd systemd-boot \
RUN dnf -y install --setopt=install_weak_deps=False $(./tools/test-packages.sh) \
&& dnf -y remove dracut && dnf -y update && dnf clean all
171 changes: 171 additions & 0 deletions tools/test-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
#!/bin/sh

if [ -f /etc/os-release ]; then
# shellcheck source=somefile
. /etc/os-release
fi

# common packages
cat << EOF
asciidoc
bzip2
cryptsetup
dash
dmraid
gawk
git
kbd
lvm2
make
mdadm
parted
pigz
shfmt
sudo
strace
tar
tcpdump
wget
which
EOF

# packages for rpm based distros
if [ "$ID" = "fedora" ] || [ "$ID" = "opensuse-tumbleweed" ]; then
cat << EOF
bash-completion
dhcp-client
dhcp-server
e2fsprogs
gcc
iproute
iputils
kernel
nbd
NetworkManager
nfs-utils
ntfsprogs
rpm-build
ShellCheck
xz
EOF
fi

if [ "$ID" = "fedora" ] || [ -x /usr/bin/dpkg ] || [ -x /usr/bin/pacman ]; then
cat << EOF
astyle
biosdevname
bluez
btrfs-progs
busybox
cifs-utils
f2fs-tools
fuse3
lzop
memstrack
ndctl
ntfs-3g
nvme-cli
pcsclite
rng-tools
sbsigntools
squashfs-tools
tpm2-tools
vi
EOF
fi

if [ "$ID" = "fedora" ]; then
cat << EOF
dbus-daemon
device-mapper-multipath
fcoe-utils
iscsi-initiator-utils
kmod-devel
libkcapi-hmaccalc
libselinux-utils
mksh
pcsc-lite
qemu-system-x86-core
scsi-target-utils
systemd-boot-unsigned
systemd-networkd
systemd-resolved
EOF
fi

if [ "$ID" = "opensuse-tumbleweed" ]; then
cat << EOF
btrfsprogs
dbus-broker
iscsiuio
libkmod-devel
multipath-tools
open-iscsi
procps
qemu-kvm
squashfs
systemd-boot
tgt
/usr/bin/qemu-system-$(uname -m)
util-linux-systemd
EOF
fi

if [ -x /usr/bin/pacman ]; then
cat << EOF
connman
cpio
dhclient
dhcp
linux
multipath-tools
networkmanager
open-iscsi
pcsclite
qemu
shellcheck
tgt
EOF
fi

# packages for deb based distro's
if [ -x /usr/bin/dpkg ]; then
cat << EOF
busybox-static
ca-certificates
console-setup
cpio
curl
debhelper
debhelper-compat
docbook
docbook-xml
docbook-xsl
fdisk
g++
iputils-arping
iputils-ping
isc-dhcp-client
isc-dhcp-server
kmod
less
libdmraid-dev
libkmod-dev
linux-image-generic
multipath-tools
nbd-client
nbd-server
network-manager
nfs-kernel-server
open-iscsi
ovmf
pkg-config
procps
qemu-system-x86
quilt
shellcheck
systemd-boot-efi
tgt
thin-provisioning-tools
EOF
fi

0 comments on commit 9371948

Please sign in to comment.