1 # lib_yum.sh - Docker build script yum library.
4 # Copyright (c) 2020 Cisco and/or its affiliates.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at:
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Don't import more than once.
18 if [ -n "$(alias lib_yum_imported 2> /dev/null)" ] ; then
21 alias lib_yum_imported=true
23 export CIMAN_DOCKER_SCRIPTS=${CIMAN_DOCKER_SCRIPTS:-"$(dirname $BASH_SOURCE)"}
24 . $CIMAN_DOCKER_SCRIPTS/lib_common.sh
26 dump_yum_package_list() {
27 branchname="$(echo $branch | sed -e 's,/,_,')"
28 yum list installed > \
29 "$DOCKER_BUILD_LOG_DIR/$FDIOTOOLS_IMAGENAME-$branchname-yum-packages.log"
32 yum_install_packages() {
36 yum_install_docker_os_package_dependancies() {
37 yum_install_packages yum-utils
40 yum_install_docker() {
41 yum-config-manager --add-repo \
42 https://download.docker.com/linux/${OS_ID}/docker-ce.repo
43 yum-config-manager --enablerepo=docker-ce-stable
44 yum_install_packages docker-ce docker-ce-cli containerd.io
47 generate_yum_dockerfile() {
48 local executor_os_name=$1
50 local executor_image=$3
51 local from_image_os_id="$(echo $from_image | cut -d: -f2)"
53 cat <<EOF >$DOCKERFILE
54 FROM $from_image AS executor-image
55 LABEL Description="FD.io CI executor docker image for $executor_os_name/$OS_ARCH"
57 LABEL Version="$DOCKER_TAG"
59 # Build Environment Variables
60 ENV FDIOTOOLS_IMAGE=$executor_image
61 ENV LC_ALL=en_US.UTF-8
62 ENV CIMAN_ROOT="$DOCKER_CIMAN_ROOT"
63 ENV PATH=$PATH:$DOCKER_CIMAN_ROOT/docker/scripts
65 # Copy-in build tree containing
66 # ci-management, vpp, & csit git repos
67 WORKDIR $DOCKER_BUILD_DIR
70 # Install baseline packages (minimum build & utils).
72 # ci-management global-jjb requirements:
75 # from global-jjb/packer/provision/baseline.sh:
87 # TODO: Fix broken project requirement install targets
89 # graphviz for 'make bootstrap-doxygen' (VPP)
90 # doxygen for 'make doxygen' (VPP)
91 # enchant for 'make docs' (VPP)
92 # libffi-devel for python cffi install (Ubuntu20.04/VPP/aarch64)
93 # libpcap-devel for python pypcap install (CSIT)
94 # liblapack-devel for python numpy/scipy (CSIT/aarch64)
95 # libopenblas-devel for python numpy/scipy (CSIT/aarch64)
113 java-1.8.0-openjdk \\
114 java-1.8.0-openjdk-devel \\
137 # Install packages for all project branches
140 && dbld_install_docker.sh \\
141 && dbld_vpp_install_packages.sh \\
142 && dbld_csit_install_packages.sh \\
143 && dbld_lfit_requirements.sh \\
146 # CI Runtime Environment
148 ENV VPP_ZOMBIE_NOCHECK=1
149 RUN gem install package_cloud \\
150 && curl -s https://packagecloud.io/install/repositories/fdio/master/script.rpm.sh | sudo bash
153 RUN dbld_dump_build_logs.sh \\