diff options
Diffstat (limited to 'docker')
-rwxr-xr-x | docker/scripts/build_executor_docker_image.sh | 4 | ||||
-rwxr-xr-x | docker/scripts/dbld_csit_find_ansible_packages.py | 7 | ||||
-rwxr-xr-x | docker/scripts/dbld_csit_install_packages.sh | 13 | ||||
-rwxr-xr-x | docker/scripts/dbld_lfit_requirements.sh | 8 | ||||
-rwxr-xr-x | docker/scripts/dbld_vpp_install_packages.sh | 24 | ||||
-rw-r--r-- | docker/scripts/lib_apt.sh | 55 | ||||
-rw-r--r-- | docker/scripts/lib_common.sh | 9 | ||||
-rw-r--r-- | docker/scripts/lib_csit.sh | 30 | ||||
-rw-r--r-- | docker/scripts/lib_vpp.sh | 54 |
9 files changed, 160 insertions, 44 deletions
diff --git a/docker/scripts/build_executor_docker_image.sh b/docker/scripts/build_executor_docker_image.sh index 7a731956e..30cc6bdd5 100755 --- a/docker/scripts/build_executor_docker_image.sh +++ b/docker/scripts/build_executor_docker_image.sh @@ -1,6 +1,6 @@ #! /bin/bash -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2024 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: @@ -105,7 +105,7 @@ docker_build_setup_ciman docker_build_setup_vpp docker_build_setup_csit for executor_os_name in $os_names ; do - docker_from_image="$(echo $executor_os_name | sed -e 's/-/:/')" + docker_from_image="${executor_os_name/-/:}" # Remove '-' and '.' from executor_os_name in Docker Hub repo name os_name="${executor_os_name//-}" repository="fdiotools/${EXECUTOR_CLASS}-${os_name//.}" diff --git a/docker/scripts/dbld_csit_find_ansible_packages.py b/docker/scripts/dbld_csit_find_ansible_packages.py index 52ed4c3b0..50b7d8478 100755 --- a/docker/scripts/dbld_csit_find_ansible_packages.py +++ b/docker/scripts/dbld_csit_find_ansible_packages.py @@ -37,6 +37,7 @@ class CsitAnsibleYamlStruct: self.__dict__.update(entries) def packages_in_csit_ansible_yaml_file(yamlfile: str, distro, arch) -> list: + codename = os.getenv("OS_CODENAME") with open(yamlfile) as yf: csit_ansible_yaml = yaml.safe_load(yf) if csit_ansible_yaml is None: @@ -50,7 +51,11 @@ def packages_in_csit_ansible_yaml_file(yamlfile: str, distro, arch) -> list: packages += [pkg for pkg in cays.packages_by_arch[arch] if type(pkg) is str] if distro in [*cays.packages_by_distro]: - packages += [pkg for pkg in cays.packages_by_distro[distro] + if codename in [*cays.packages_by_distro[distro]]: + packages += [pkg for pkg in cays.packages_by_distro[distro][codename] + if type(pkg) is str] + else: + packages += [pkg for pkg in cays.packages_by_distro[distro] if type(pkg) is str] return packages diff --git a/docker/scripts/dbld_csit_install_packages.sh b/docker/scripts/dbld_csit_install_packages.sh index e303ce28e..7f48d0751 100755 --- a/docker/scripts/dbld_csit_install_packages.sh +++ b/docker/scripts/dbld_csit_install_packages.sh @@ -1,6 +1,6 @@ #! /bin/bash -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2024 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: @@ -16,8 +16,7 @@ set -euxo pipefail export CIMAN_DOCKER_SCRIPTS=${CIMAN_DOCKER_SCRIPTS:-"$(dirname $BASH_SOURCE)"} -. "$CIMAN_DOCKER_SCRIPTS/lib_csit.sh" -. "$CIMAN_DOCKER_SCRIPTS/lib_vpp.sh" +source "$CIMAN_DOCKER_SCRIPTS/lib_csit.sh" must_be_run_in_docker_build @@ -33,8 +32,11 @@ else echo_log "Starting $(basename $0)" fi +python3 -m venv "$DOCKER_BUILD_VENV_DIR" +source "$DOCKER_BUILD_VENV_DIR"/bin/activate + do_git_config csit -for vpp_branch in ${VPP_BRANCHES[$OS_NAME]} ; do +for vpp_branch in ${CSIT_VPP_BRANCHES[$OS_NAME]} ; do # Returns checked out branch in csit_branch csit_checkout_branch_for_vpp "$vpp_branch" @@ -44,8 +46,10 @@ for vpp_branch in ${VPP_BRANCHES[$OS_NAME]} ; do # Install/cache python packages csit_install_hugo "$csit_branch" + deactivate # Install/cache python packages csit_pip_cache "$csit_branch" + source "$DOCKER_BUILD_VENV_DIR"/bin/activate done # Install csit OS packages @@ -57,4 +61,5 @@ csit_install_hugo "master" # Install/cache python packages csit_pip_cache "master" +deactivate echo_log -e "Completed $(basename $0)!\n\n==========" diff --git a/docker/scripts/dbld_lfit_requirements.sh b/docker/scripts/dbld_lfit_requirements.sh index ca54edd89..c67c2e579 100755 --- a/docker/scripts/dbld_lfit_requirements.sh +++ b/docker/scripts/dbld_lfit_requirements.sh @@ -1,6 +1,6 @@ #! /bin/bash -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2024 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: @@ -48,7 +48,11 @@ lf-activate-venv() { EOF # Install lftools & boto3 for log / artifact upload. -python3 -m pip install boto3 +pip_options="" +if [ "$OS_CODENAME" = "noble" ] || [ "$OS_CODENAME" = "bookworm" ] ; then + pip_options=" --break-system-packages" +fi +python3 -m pip install$pip_options boto3 mkdir -p "$LF_VENV" OLD_PATH="$PATH" python3 -m venv "$LF_VENV" diff --git a/docker/scripts/dbld_vpp_install_packages.sh b/docker/scripts/dbld_vpp_install_packages.sh index 5e1e0f8f0..be8b34cdc 100755 --- a/docker/scripts/dbld_vpp_install_packages.sh +++ b/docker/scripts/dbld_vpp_install_packages.sh @@ -1,6 +1,6 @@ #! /bin/bash -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2024 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: @@ -15,7 +15,7 @@ set -euxo pipefail -export CIMAN_DOCKER_SCRIPTS=${CIMAN_DOCKER_SCRIPTS:-"$(dirname $BASH_SOURCE)"} +export CIMAN_DOCKER_SCRIPTS=${CIMAN_DOCKER_SCRIPTS:-"$(dirname "${BASH_SOURCE[0]}")"} . "$CIMAN_DOCKER_SCRIPTS/lib_vpp.sh" . "$CIMAN_DOCKER_SCRIPTS/lib_apt.sh" @@ -23,10 +23,10 @@ must_be_run_in_docker_build echo_log if ! vpp_supported_executor_class "$FDIOTOOLS_EXECUTOR_CLASS" ; then - echo_log "VPP is not supported on executor class '$FDIOTOOLS_EXECUTOR_CLASS'. Skipping $(basename $0)..." + echo_log "VPP is not supported on executor class '$FDIOTOOLS_EXECUTOR_CLASS'. Skipping $(basename "$0")..." exit 0 else - echo_log "Starting $(basename $0)" + echo_log "Starting $(basename "$0")" fi do_git_config vpp @@ -34,7 +34,7 @@ for branch in ${VPP_BRANCHES[$OS_NAME]} ; do do_git_branch "$branch" # Install OS packages - make_vpp "install-dep" "$branch" + make_vpp "install-deps" "$branch" # Download, build, and cache external deps packages make_vpp "install-ext-deps" "$branch" @@ -47,11 +47,21 @@ for branch in ${VPP_BRANCHES[$OS_NAME]} ; do exit 1 fi if [ -f "$vpp_ext_deps_pkg" ] ; then - cp -f $vpp_ext_deps_pkg $DOCKER_DOWNLOADS_DIR + cp -f "$vpp_ext_deps_pkg" $DOCKER_DOWNLOADS_DIR else echo "ERROR: Missing VPP external deps package: '$vpp_ext_deps_pkg'" exit 1 fi + + # Install hs-test depndencies + if [ "$OS_NAME" = "ubuntu-22.04" ] && [ "$branch" = "master" ] ; then + make_vpp build "$branch" "false" + make_vpp build-release "$branch" "false" + make_vpp build-vpp-gcov "$branch" "false" + install_hst_deps "$branch" + git clean -qfdx + fi + # TODO: remove this after all supported VPP branches have removed # python3-virtualenv & virtualenv from install-deps which are no longer # used in vpp repo. These packages can mess up csit virtualenv @@ -76,4 +86,4 @@ for branch in ${VPP_BRANCHES[$OS_NAME]} ; do esac done -echo_log -e "Completed $(basename $0)!\n\n==========" +echo_log -e "Completed $(basename "$0")!\n\n==========" diff --git a/docker/scripts/lib_apt.sh b/docker/scripts/lib_apt.sh index 6cf37ae76..d5ec1589f 100644 --- a/docker/scripts/lib_apt.sh +++ b/docker/scripts/lib_apt.sh @@ -1,7 +1,7 @@ # lib_apt.sh - Docker build script apt library. # For import only. -# Copyright (c) 2023 Cisco and/or its affiliates. +# Copyright (c) 2024 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: @@ -20,6 +20,9 @@ if [ -n "$(alias lib_apt_imported 2> /dev/null)" ] ; then fi alias lib_apt_imported=true +DIND_FROM_IMAGE="cruizba/ubuntu-dind:jammy-26.1.3-r2" +HST_FROM_IMAGE="ubuntu:22.04" + export CIMAN_DOCKER_SCRIPTS=${CIMAN_DOCKER_SCRIPTS:-"$(dirname $BASH_SOURCE)"} . "$CIMAN_DOCKER_SCRIPTS/lib_common.sh" . "$CIMAN_DOCKER_SCRIPTS/lib_csit.sh" @@ -135,6 +138,7 @@ RUN apt-get update -qq \\ make \\ python3-pip \\ python3-venv \\ + python3-virtualenv \\ rsync \\ ruby-dev \\ software-properties-common \\ @@ -157,12 +161,18 @@ RUN wget https://releases.hashicorp.com/terraform/1.7.3/terraform_1.7.3_linux_$d && unzip terraform_1.7.3_linux_$dpkg_arch.zip \\ && mv terraform /usr/bin \\ && rm -f terraform_1.7.3_linux_$dpkg_arch.zip +EOF + + generate_apt_dockerfile_install_golang + + cat <<EOF >>"$DOCKERFILE" # Install packages for all project branches # RUN apt-get update -qq \\ && dbld_vpp_install_packages.sh \\ && dbld_csit_install_packages.sh \\ + && apt-get install -y pkg-config \\ && rm -r /var/lib/apt/lists/* EOF } @@ -172,10 +182,35 @@ generate_apt_dockerfile_clean() { # Clean up copy-in build tree RUN dbld_dump_build_logs.sh \\ + && apt-get -y autoremove \\ && rm -rf "/tmp/*" "$DOCKER_BUILD_FILES_DIR" "/root/.ccache" EOF } +generate_apt_dockerfile_install_golang() { + local go_tarball_arch="amd64" + + if [ "$OS_ARCH" = "aarch64" ] ; then + go_tarball_arch="arm64" + fi + + cat <<EOF >>"$DOCKERFILE" + +# Install golang for HostStack Test (HST) jobs +# +ENV GOPATH /go +ENV GOROOT /usr/local/go +ENV PATH \$GOPATH/bin:/usr/local/go/bin:\$PATH +RUN rm -rf /usr/local/go /usr/bin/go \\ + && wget -P /tmp "https://go.dev/dl/go${DOCKER_GOLANG_VERSION}.linux-${go_tarball_arch}.tar.gz" \\ + && tar -C /usr/local -xzf "/tmp/go${DOCKER_GOLANG_VERSION}.linux-${go_tarball_arch}.tar.gz" \\ + && rm "/tmp/go${DOCKER_GOLANG_VERSION}.linux-${go_tarball_arch}.tar.gz" \\ + && ln -s /usr/local/go/bin/go /usr/bin/go \\ + && echo -n "\nGOPATH=\$GOPATH\nGOROOT=\$GOROOT" | tee -a /etc/environment \\ + && mkdir -p "\$GOPATH/src" "\$GOPATH/bin" && chmod -R 777 "\$GOPATH" +EOF +} + # Generate 'builder' class apt dockerfile builder_generate_apt_dockerfile() { local executor_class="$1" @@ -183,7 +218,7 @@ builder_generate_apt_dockerfile() { local executor_image="$3" local vpp_install_skip_sysctl_envvar=""; - generate_apt_dockerfile_common $executor_class $executor_image + generate_apt_dockerfile_common "$executor_class" "$executor_image" csit_builder_generate_docker_build_files cat <<EOF >>"$DOCKERFILE" @@ -336,6 +371,13 @@ generate_apt_dockerfile() { local executor_os_name="$2" local from_image="$3" local executor_image="$4" + local is_dind_image="false" + + # TODO: Enable HST on AARCH64 when supported in vpp/extras/hs-test + if [ "$from_image" = "$HST_FROM_IMAGE" ] ; then + from_image="$DIND_FROM_IMAGE" + is_dind_image="true" + fi cat <<EOF >"$DOCKERIGNOREFILE" **/__pycache__ @@ -347,6 +389,13 @@ LABEL Description="FD.io CI '$executor_class' executor docker image for $executo LABEL Vendor="fd.io" LABEL Version="$DOCKER_TAG" EOF - ${executor_class}_generate_apt_dockerfile "$executor_class" \ + if [ "$is_dind_image" = "true" ] ; then + cat <<EOF >>"$DOCKERFILE" +# Remove extraneous environment variable(s) created in "$from_image" +ENV DEBUG= +EOF + fi + + "${executor_class}"_generate_apt_dockerfile "$executor_class" \ "$executor_os_name" "$executor_image" } diff --git a/docker/scripts/lib_common.sh b/docker/scripts/lib_common.sh index 150441bb7..916191b80 100644 --- a/docker/scripts/lib_common.sh +++ b/docker/scripts/lib_common.sh @@ -1,7 +1,7 @@ # lib_common.sh - Docker build script common library. # For import only. -# Copyright (c) 2022 Cisco and/or its affiliates. +# Copyright (c) 2024 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: @@ -153,8 +153,8 @@ export EXECUTOR_CLASS_ARCH="$EXECUTOR_DEFAULT_CLASS-$OS_ARCH" export EXECUTOR_CLASSES="$EXECUTOR_DEFAULT_CLASS csit_dut csit_shim" export EXECUTOR_ARCHS="aarch64 x86_64" declare -A EXECUTOR_CLASS_ARCH_OS_NAMES -EXECUTOR_CLASS_ARCH_OS_NAMES["builder-aarch64"]="ubuntu-20.04 ubuntu-22.04" -EXECUTOR_CLASS_ARCH_OS_NAMES["builder-x86_64"]="debian-11 ubuntu-20.04 ubuntu-22.04" +EXECUTOR_CLASS_ARCH_OS_NAMES["builder-aarch64"]="ubuntu-20.04 ubuntu-22.04 ubuntu-24.04" +EXECUTOR_CLASS_ARCH_OS_NAMES["builder-x86_64"]="debian-11 debian-12 ubuntu-20.04 ubuntu-22.04 ubuntu-24.04" EXECUTOR_CLASS_ARCH_OS_NAMES["csit_dut-aarch64"]="ubuntu-22.04" EXECUTOR_CLASS_ARCH_OS_NAMES["csit_dut-x86_64"]="ubuntu-22.04" EXECUTOR_CLASS_ARCH_OS_NAMES["csit_shim-aarch64"]="ubuntu-22.04" @@ -226,15 +226,18 @@ executor_verify_os_name() { # Docker variables export DOCKER_DATE=${DOCKER_DATE:-"$(date -u +%Y_%m_%d_%H%M%S_UTC)"} export DOCKER_BUILD_DIR="/scratch/docker-build" +export DOCKER_BUILD_VENV_DIR="$DOCKER_BUILD_DIR"/venv export DOCKER_CIMAN_ROOT="$DOCKER_BUILD_DIR/ci-management" export DOCKERFILE="$DOCKER_BUILD_DIR/Dockerfile" export DOCKERIGNOREFILE="$DOCKER_BUILD_DIR/.dockerignore" export DOCKERFILE_FROM=${DOCKERFILE_FROM:="${OS_ID}:${OS_VERSION_ID}"} export DOCKER_TAG="$DOCKER_DATE-$OS_ARCH" export DOCKER_VPP_DIR="$DOCKER_BUILD_DIR/vpp" +export DOCKER_VPP_DL_CACHE_DIR="$DOCKER_BUILD_DIR"/vpp_ext_deps_downloads export DOCKER_CSIT_DIR="$DOCKER_BUILD_DIR/csit" export DOCKER_DOWNLOADS_DIR="/root/Downloads" export DOCKER_BUILD_FILES_DIR="$DOCKER_BUILD_DIR/files" +export DOCKER_GOLANG_VERSION="1.22.5" docker_build_setup_ciman() { if [ "$(dirname $CIMAN_ROOT)" != "$DOCKER_BUILD_DIR" ] ; then diff --git a/docker/scripts/lib_csit.sh b/docker/scripts/lib_csit.sh index 2e877f803..06cfb471b 100644 --- a/docker/scripts/lib_csit.sh +++ b/docker/scripts/lib_csit.sh @@ -1,7 +1,7 @@ # lib_csit.sh - Docker build script CSIT library. # For import only. -# Copyright (c) 2023 Cisco and/or its affiliates. +# Copyright (c) 2024 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: @@ -24,6 +24,20 @@ export CIMAN_DOCKER_SCRIPTS="${CIMAN_DOCKER_SCRIPTS:-$(dirname ${BASH_SOURCE[0]} . "$CIMAN_DOCKER_SCRIPTS/lib_common.sh" . "$CIMAN_DOCKER_SCRIPTS/lib_apt.sh" +# Branches must be listed in chronological order -- oldest stable branch +# first and master last. +# +# Note: CI Jobs for each architecture are maintained in +# .../ci-management/jjb/vpp/vpp.yaml +# All OS's and branches are included in the 'os' and 'stream' +# definitions respectively, then the exclude list maintained +# to create an enumerated set of jobs jobs that match the +# definitions here. +declare -A CSIT_VPP_BRANCHES +CSIT_VPP_BRANCHES["ubuntu-22.04"]="stable/2406 master" +CSIT_VPP_BRANCHES["ubuntu-24.04"]="master" +export CSIT_VPP_BRANCHES + CSIT_SUPPORTED_EXECUTOR_CLASSES="builder csit_dut" csit_supported_executor_class() { if ! grep -q "${1:-}" <<< "$CSIT_SUPPORTED_EXECUTOR_CLASSES" ; then @@ -35,6 +49,7 @@ csit_supported_executor_class() { csit_supported_os() { case "$1" in ubuntu-22.04) return 0 ;; + ubuntu-24.04) return 0 ;; *) ;; esac return 1 @@ -67,7 +82,7 @@ csit_install_packages() { bld_log="${bld_log}-$branchname-csit_install_packages-bld.log" git clean -qfdx - python3 -m pip install pyyaml + pip install pyyaml local exclude_roles="-e calibration -e kernel -e mellanox -e nomad -e consul -e aws -e vpp" [ "$OS_ARCH" = "aarch64" ] && exclude_roles="$exclude_roles -e iperf" @@ -78,6 +93,7 @@ csit_install_packages() { packages="$(dbld_csit_find_ansible_packages.py --$OS_ID --$OS_ARCH $yaml_files)" packages="${packages/jammy /}" packages="${packages/focal /}" + packages="${packages/noble /}" packages="${packages/libmbedcrypto1/libmbedcrypto3}" packages="${packages/libmbedtls10/libmbedtls12}" packages="$(echo ${packages//python\-/python3\-} | tr ' ' '\n' | sort -u | xargs)" @@ -117,7 +133,6 @@ csit_install_hugo() { git clean -qfdx source "$csit_bash_function_dir"/hugo.sh - go_install 2>&1 | tee -a "$bld_log" hugo_install 2>&1 | tee -a "$bld_log" else @@ -150,14 +165,11 @@ csit_pip_cache() { rm -rf "$PYTHONPATH/env" # Activate / install CSIT python virtualenv ($CSIT_DIR/requirements.txt) - local common_sh="$csit_bash_function_dir/common.sh" - # shellcheck disable=1090 - source "$common_sh" - activate_virtualenv "${CSIT_DIR}" "${CSIT_DIR}/requirements.txt" 2>&1 | tee -a "$bld_log" + source "$csit_bash_function_dir"/common.sh + activate_virtualenv "${CSIT_DIR}" "${CSIT_DIR}"/requirements.txt 2>&1 | tee -a "$bld_log" # Install tox python requirements - activate_virtualenv "${CSIT_DIR}" "${CSIT_DIR}/tox-requirements.txt" 2>&1 |\ - tee -a "$bld_log" + activate_virtualenv "${CSIT_DIR}" "${CSIT_DIR}"/tox-requirements.txt 2>&1 | tee -a "$bld_log" # Clean up virtualenv directories git checkout -q -- . diff --git a/docker/scripts/lib_vpp.sh b/docker/scripts/lib_vpp.sh index 39e2ca192..54aa4bee0 100644 --- a/docker/scripts/lib_vpp.sh +++ b/docker/scripts/lib_vpp.sh @@ -1,7 +1,7 @@ # lib_vpp.sh - Docker build script VPP library. # For import only. -# Copyright (c) 2023 Cisco and/or its affiliates. +# Copyright (c) 2024 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: @@ -20,8 +20,8 @@ if [ -n "$(alias lib_vpp_imported 2> /dev/null)" ] ; then fi alias lib_vpp_imported=true -export CIMAN_DOCKER_SCRIPTS=${CIMAN_DOCKER_SCRIPTS:-"$(dirname $BASH_SOURCE)"} -. $CIMAN_DOCKER_SCRIPTS/lib_common.sh +export CIMAN_DOCKER_SCRIPTS=${CIMAN_DOCKER_SCRIPTS:-"$(dirname "${BASH_SOURCE[0]}")"} +. "$CIMAN_DOCKER_SCRIPTS"/lib_common.sh VPP_SUPPORTED_EXECUTOR_CLASSES="builder" @@ -32,23 +32,45 @@ vpp_supported_executor_class() { return 0 } +install_hst_deps() { + local branch=${1:-"master"} + local branchname=${branch/\//_} + local hst_dir="./extras/hs-test" + local bld_log="$DOCKER_BUILD_LOG_DIR" + bld_log="${bld_log}/$FDIOTOOLS_IMAGENAME-$branchname" + bld_log="${bld_log}-install_hst_deps_bld.log" + + if [ -d "$hst_dir" ] ; then + make -C "$hst_dir" install-deps 2>&1 | tee -a "$bld_log" + fi +} + make_vpp() { local target=$1 local branch=${2:-"master"} - local branchname="$(echo $branch | sed -e 's,/,_,')" + local clean=${3:-"true"} + local branchname=${branch/\//_} local bld_log="$DOCKER_BUILD_LOG_DIR" + if [ "$target" = "install-ext-deps" ] ; then + if [ -d "$DOCKER_VPP_DL_CACHE_DIR" ] ; then + mkdir -p "$DOCKER_DOWNLOADS_DIR" + cp -a "$DOCKER_VPP_DL_CACHE_DIR"/* "$DOCKER_DOWNLOADS_DIR" + fi + fi bld_log="${bld_log}/$FDIOTOOLS_IMAGENAME-$branchname" bld_log="${bld_log}-make_vpp_${target}-bld.log" makefile_target="^${target}:" - if [ -z "$(grep $makefile_target Makefile)" ] ; then + if ! grep "$makefile_target" Makefile ; then echo "Make target '$target' does not exist in VPP branch '$branch'!" return fi - git clean -qfdx + if [ "$clean" = "true" ] ; then + git clean -qfdx + fi description="'make UNATTENDED=yes $target' in $(pwd) ($branch)" echo_log -e " Starting $description..." - make UNATTENDED=yes $target 2>&1 | tee -a "$bld_log" + make UNATTENDED=yes "$target" 2>&1 | tee -a "$bld_log" git checkout -q -- . echo_log " Completed $description!" } @@ -56,13 +78,13 @@ make_vpp() { make_vpp_test() { local target=$1 local branch=${2:-"master"} - local branchname="$(echo $branch | sed -e 's,/,_,')" + local branchname=${branch/\//_} local bld_log="$DOCKER_BUILD_LOG_DIR" bld_log="${bld_log}/$FDIOTOOLS_IMAGENAME-$branchname" bld_log="${bld_log}-make_vpp_test_${target}-bld.log" makefile_target="^${target}:" - if [ -z "$(grep -e $makefile_target test/Makefile)" ] ; then + if ! grep -e "$makefile_target" test/Makefile ; then echo "Make test target '$target' does not exist in VPP branch '$branch'!" return fi @@ -70,7 +92,7 @@ make_vpp_test() { description="'make -C test $target' in $(pwd) ($branch)" echo_log " Starting $description..." make WS_ROOT="$DOCKER_VPP_DIR" BR="$DOCKER_VPP_DIR/build-root" \ - TEST_DIR="$DOCKER_VPP_DIR/test" -C test $target 2>&1 | tee -a $bld_log + TEST_DIR="$DOCKER_VPP_DIR"/test -C test "$target" 2>&1 | tee -a "$bld_log" remove_pyc_files_and_pycache_dirs git checkout -q -- . echo_log " Completed $description!" @@ -81,6 +103,10 @@ docker_build_setup_vpp() { if [ ! -d "$DOCKER_VPP_DIR" ] ; then echo_log "Cloning VPP into $DOCKER_VPP_DIR..." git clone -q https://gerrit.fd.io/r/vpp $DOCKER_VPP_DIR + if [ -d "$DOCKER_DOWNLOADS_DIR" ] ; then + mkdir -p "$DOCKER_VPP_DL_CACHE_DIR" + cp -a "$DOCKER_DOWNLOADS_DIR"/* "$DOCKER_VPP_DL_CACHE_DIR" + fi fi clean_git_repo $DOCKER_VPP_DIR fi @@ -96,7 +122,9 @@ docker_build_setup_vpp() { # to create an enumerated set of jobs jobs that match the # definitions here. declare -A VPP_BRANCHES -VPP_BRANCHES["debian-11"]="stable/2310 stable/2402 master" -VPP_BRANCHES["ubuntu-20.04"]="stable/2310 stable/2402 master" -VPP_BRANCHES["ubuntu-22.04"]="stable/2310 stable/2402 master" +VPP_BRANCHES["debian-11"]="stable/2402 stable/2406 master" +VPP_BRANCHES["debian-12"]="master" +VPP_BRANCHES["ubuntu-20.04"]="stable/2402 stable/2406 master" +VPP_BRANCHES["ubuntu-22.04"]="stable/2402 stable/2406 master" +VPP_BRANCHES["ubuntu-24.04"]="master" export VPP_BRANCHES |