Skip to content

Commit

Permalink
Merge pull request #75 from cevich/cache_buildah_conformance
Browse files Browse the repository at this point in the history
Update Ubuntu packaging
  • Loading branch information
cevich authored Jun 30, 2021
2 parents 102f7bd + 2cb004c commit 90d83ae
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 97 deletions.
63 changes: 0 additions & 63 deletions cache_images/image_builder.json

This file was deleted.

65 changes: 32 additions & 33 deletions cache_images/ubuntu_packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ fi
# automated testing. These packages are not otherwise intended for
# end-user consumption.
VERSION_ID=$(source /etc/os-release; echo $VERSION_ID)
# Overview: https://build.opensuse.org/project/show/devel:kubic:libcontainers:testing
REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/testing/xUbuntu_$VERSION_ID/"
GPG_URL="https://download.opensuse.org/repositories/devel:kubic:libcontainers:testing/xUbuntu_$VERSION_ID/Release.key"

Expand All @@ -49,6 +50,7 @@ curl --fail --silent --location --url "$GPG_URL" | \
INSTALL_PACKAGES=(\
apache2-utils
apparmor
apt-transport-https
aufs-tools
autoconf
automake
Expand All @@ -58,22 +60,19 @@ INSTALL_PACKAGES=(\
build-essential
buildah
bzip2
ca-certificates
conmon
containernetworking-plugins
coreutils
cri-o-runc
criu
crun
curl
dnsmasq
e2fslibs-dev
emacs-nox
file
fuse3
gawk
gcc
gettext
git
gnupg2
go-md2man
iproute2
Expand All @@ -83,6 +82,7 @@ INSTALL_PACKAGES=(\
libapparmor-dev
libbtrfs-dev
libcap-dev
libcap2
libdevmapper-dev
libdevmapper1.02.1
libfuse-dev
Expand All @@ -96,25 +96,30 @@ INSTALL_PACKAGES=(\
libnl-3-dev
libprotobuf-c-dev
libprotobuf-dev
libseccomp2
libseccomp-dev
libseccomp2
libselinux-dev
libsystemd-dev
libtool
libudev-dev
lsb-release
lsof
make
netcat
openssl
parallel
pkg-config
podman
podman-plugins
protobuf-c-compiler
protobuf-compiler
python-is-python3
python2
python3-dateutil
python3-dateutil
python3-docker
python3-pip
python3-protobuf
python3-psutil
python3-pytoml
python3-requests
Expand All @@ -134,40 +139,34 @@ INSTALL_PACKAGES=(\
zlib1g-dev
zstd
)
# Download these package files, but don't install them; Any tests
# wishing to, may install them using their native tools at runtime.
DOWNLOAD_PACKAGES=(\
parallel
)

# These aren't resolvable on Ubuntu 20
if [[ "$OS_RELEASE_VER" -le 2004 ]]; then
INSTALL_PACKAGES+=(\
python-dateutil
python-is-python3
python-protobuf
)
else # e.g. 20.10 and later
INSTALL_PACKAGES+=(\
libcap2
podman-plugins
python-is-python3
python3-dateutil
python3-protobuf
)

fi

echo "Installing general build/testing dependencies"
# Necessary to update cache of newly added repos
lilto $SUDO apt-get -q -y update
bigto $SUDO apt-get -q -y install "${INSTALL_PACKAGES[@]}"

if [[ ${#DOWNLOAD_PACKAGES[@]} -gt 0 ]]; then
echo "Downloading packages for optional installation at runtime, as needed."
$SUDO ln -s /var/cache/apt/archives "$PACKAGE_DOWNLOAD_DIR"
bigto $SUDO apt-get -q -y install --download-only "${DOWNLOAD_PACKAGES[@]}"
fi
# Buildah conformance testing needs to install packages from docker.io
# at runtime. Setup the repo here, so it only affects downloaded
# (cached) packages and not updates/installs (above). Installing packages
# cached in the image is preferable to reaching out to the repository
# at runtime. It also has the desirable effect of preventing the
# possibility of package changes from one CI run to the next (or from
# one branch to the next).
DOWNLOAD_PACKAGES=(\
containerd.io
docker-ce
docker-ce-cli
)
curl --fail --silent --location \
--url https://download.docker.com/linux/ubuntu/gpg | \
gpg --dearmor | \
$SUDO tee /etc/apt/trusted.gpg.d/docker_com.gpg &> /dev/null
echo "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | \
ooe.sh $SUDO tee /etc/apt/sources.list.d/docker.list &> /dev/null
lilto $SUDO apt-get -q -y update
echo "Downloading packages for optional installation at runtime."
$SUDO ln -s /var/cache/apt/archives "$PACKAGE_DOWNLOAD_DIR"
bigto $SUDO apt-get -q -y install --download-only "${DOWNLOAD_PACKAGES[@]}"

echo "Configuring Go environment"
# There are multiple (otherwise conflicting) versions of golang available
Expand Down
2 changes: 1 addition & 1 deletion lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ ubuntu_finalize() {
set +e # Don't fail at the very end
set -x
$SUDO apt-get -qq -y autoremove
$SUDO rm -rf /var/cache/apt
$SUDO rm -f /var/cache/apt/* # DON'T remove archives: packages downloaded there
$SUDO rm -rf /var/lib/apt/lists/*
common_finalize
}
Expand Down

0 comments on commit 90d83ae

Please # to comment.