# lib_apt.sh - Docker build script apt library.
# For import only.
-# Copyright (c) 2021 Cisco and/or its affiliates.
+# Copyright (c) 2023 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
--allow-change-held-packages $@
}
-# Used for older OS distro's which are incompatible
-# with modern distro cmake vesrion
-apt_override_cmake_install_with_pip3_version() {
- local os_cmake="/usr/bin/cmake"
- local os_cmake_ver="$($os_cmake --version | head -1)"
- local pip3_cmake="/usr/local/bin/cmake"
-
- python3 -m pip --disable-pip-version-check install cmake || true
- local pip3_cmake_ver="$($pip3_cmake --version | head -1)"
- echo_log "Overriding $OS_NAME '$os_cmake_ver' with '$pip3_cmake_ver'!"
- apt-get remove -y cmake --autoremove || true
- update-alternatives --quiet --remove-all cmake || true
- update-alternatives --quiet --install "$os_cmake" cmake "$pip3_cmake" 100
- echo_log "Default cmake ($(which cmake)) version: '$(cmake --version | head -1)'!"
-}
-
generate_apt_dockerfile_common() {
local executor_class="$1"
local executor_image="$2"
+ local dpkg_arch="$(dpkg --print-architecture)"
cat <<EOF >>"$DOCKERFILE"
# build-essential
#
# TODO: Fix broken project requirement install targets
-# graphviz for 'make bootstrap-doxygen' (VPP)
-# doxygen for 'make doxygen' (VPP)
-# enchant for 'make docs' (VPP)
+# graphviz for doxygen (HICN)
+# doxygen for doxygen (HICN)
# libffi-dev for python cffi install (Ubuntu20.04/VPP/aarch64)
# liblapack-dev for python numpy/scipy (CSIT/aarch64)
# libopenblas-dev for python numpy/scipy (CSIT/aarch64)
# libpcap-dev for python pypcap install (CSIT)
# sshpass for CSIT jobs
#
-# From .../csit/resources/tools/presentation/run_report_*.sh:
-# libxml2
-# libxml2-dev
-# libxslt-dev
-# build-essential
-# zlib1g-dev
-# unzip
-# xvrb
-# texlive-latex-recommended
-# texlive-fonts-recommended
-# texlive-fonts-extra
-# texlive-latex-extra
-# latexmk
-# wkhtmltopdf
-# inkscape
-#
RUN apt-get update -qq \\
&& apt-get install -y \\
apt-transport-https \\
default-jre \\
dnsutils \\
doxygen \\
- enchant \\
emacs \\
facter \\
gawk \\
git-review \\
gnupg-agent \\
graphviz \\
- inkscape \\
iproute2 \\
iputils-clockdiff \\
iputils-ping \\
iputils-tracepath \\
jq \\
- latexmk \\
libffi-dev \\
liblapack-dev \\
libopenblas-dev \\
libpcap-dev \\
- libxml2 \\
- libxml2-dev \\
libxml-xpath-perl \\
- libxslt-dev \\
make \\
python3-pip \\
python3-venv \\
ruby-dev \\
software-properties-common \\
sshpass \\
+ sysstat \\
sudo \\
- texlive-fonts-extra \\
- texlive-fonts-recommended \\
- texlive-latex-extra \\
- texlive-latex-recommended \\
traceroute \\
tree \\
- unzip \\
vim \\
wget \\
- wkhtmltopdf \\
xmlstarlet \\
- xvfb \\
xz-utils \\
- zlib1g-dev \\
&& curl -L https://packagecloud.io/fdio/master/gpgkey | apt-key add - \\
&& curl -s https://packagecloud.io/install/repositories/fdio/master/script.deb.sh | bash \\
- && curl -fsSL https://get.docker.com | sh \\
&& rm -r /var/lib/apt/lists/*
+# Install terraform for CSIT
+#
+RUN wget https://releases.hashicorp.com/terraform/1.7.3/terraform_1.7.3_linux_$dpkg_arch.zip \\
+ && unzip terraform_1.7.3_linux_$dpkg_arch.zip \\
+ && mv terraform /usr/bin \\
+ && rm -f terraform_1.7.3_linux_$dpkg_arch.zip
+
# Install packages for all project branches
#
RUN apt-get update -qq \\
# Clean up copy-in build tree
RUN dbld_dump_build_logs.sh \\
- && rm -rf "/tmp/*" "$DOCKER_BUILD_FILES_DIR"
+ && rm -rf "/tmp/*" "$DOCKER_BUILD_FILES_DIR" "/root/.ccache"
EOF
}
local executor_image="$3"
local vpp_install_skip_sysctl_envvar="";
- if grep -q "debian-9" <<< "$executor_os_name" ; then
- # Workaround to VPP package installation failure on debian-9
- vpp_install_skip_sysctl_envvar="ENV VPP_INSTALL_SKIP_SYSCTL=1"
- fi
generate_apt_dockerfile_common $executor_class $executor_image
csit_builder_generate_docker_build_files
cat <<EOF >>"$DOCKERFILE"
WORKDIR /
$vpp_install_skip_sysctl_envvar
ENV VPP_ZOMBIE_NOCHECK="1"
-# TODO: Mount ccache volume into docker container, then remove this.
-ENV CCACHE_DISABLE="1"
+ENV CCACHE_DIR="/scratch/ccache"
+ENV CCACHE_MAXSIZE="10G"
EOF
generate_apt_dockerfile_clean
}