Skip to content

Commit

Permalink
ci/debian: Speedup minimal variant installation
Browse files Browse the repository at this point in the history
We installed full dependencies and then remove them. Faster and easier
to review is to install only what will not be later removed.
But still attempt to remove (in case something was installed for
whatever reason - this should not happen in containers which are
minimal, but 1) just in case 2) can be used on VM for testing.

Implement this by several lists of packages and usual passing
environment variables.

In the end speedup is ~ 1 min 20 sec, but it's also easier to see what
happen.

Link: https://lore.kernel.org/ltp/[email protected]/
Reported-by: Andrea Cervesato <[email protected]>
Acked-by: Andrea Cervesato <[email protected]>
Reviewed-by: Li Wang <[email protected]>
Signed-off-by: Petr Vorel <[email protected]>
  • Loading branch information
pevik committed Aug 28, 2024
1 parent cfa462f commit f2e2a0e
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
INSTALL=${{ matrix.container }}
INSTALL="${INSTALL%%:*}"
INSTALL="${INSTALL%%/*}"
./ci/$INSTALL.sh
ACTION="$VARIANT" ./ci/$INSTALL.sh
if [ "$VARIANT" ]; then ./ci/$INSTALL.$VARIANT.sh; fi
- name: Compiler version
Expand Down
17 changes: 1 addition & 16 deletions ci/debian.minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,4 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) 2018-2024 Petr Vorel <[email protected]>

apt="apt remove -y"

$apt \
asciidoc-base \
asciidoctor \
libacl1-dev \
libaio-dev \
libcap-dev \
libkeyutils-dev \
libnuma-dev \
libselinux1-dev \
libsepol-dev \
libssl-dev

# Missing on Ubuntu 18.04 LTS (Bionic Beaver)
$apt ruby-asciidoctor-pdf || true
ACTION="remove-nonessential" $(dirname $0)/debian.sh
84 changes: 53 additions & 31 deletions ci/debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,61 @@ apt update
# workaround for Ubuntu impish asking to interactively configure tzdata
export DEBIAN_FRONTEND="noninteractive"

apt="apt install -y --no-install-recommends"

$apt \
acl-dev \
asciidoc-base \
asciidoc-dblatex \
asciidoctor \
autoconf \
automake \
build-essential \
debhelper \
devscripts \
clang \
gcc \
git \
iproute2 \
libacl1-dev \
libaio-dev \
libcap-dev \
libc6-dev \
libjson-perl \
libkeyutils-dev \
libmnl-dev \
libnuma-dev \
libselinux1-dev \
libsepol-dev \
libssl-dev \
libtirpc-dev \
linux-libc-dev \
lsb-release \
install="apt install -y --no-install-recommends"
remove="apt remove -y"

pkg_minimal="
acl-dev
autoconf
automake
build-essential
debhelper
devscripts
clang
gcc
git
iproute2
libc6-dev
libjson-perl
libmnl-dev
libtirpc-dev
linux-libc-dev
lsb-release
pkg-config
"

pkg_nonessential="
asciidoc-base
asciidoc-dblatex
asciidoctor
libacl1-dev
libaio-dev
libcap-dev
libkeyutils-dev
libnuma-dev
libselinux1-dev
libsepol-dev
libssl-dev
"

# Missing on Ubuntu 18.04 LTS (Bionic Beaver)
$apt ruby-asciidoctor-pdf || true
pkg_maybe_nonessential="ruby-asciidoctor-pdf"

case "$ACTION" in
minimal)
echo "=== Installing only minimal dependencies ==="
$install $pkg_minimal
;;
remove-nonessential)
echo "=== Make sure devel libraries are removed ==="
$remove $pkg_nonessential
$remove $pkg_maybe_nonessential || true
;;
*)
echo "=== Installing dependencies ==="
$install $pkg_minimal $pkg_nonessential
$install $pkg_maybe_nonessential || true
;;
esac

df -hT

0 comments on commit f2e2a0e

Please sign in to comment.