From 010d57f4e29d7657fac523586e6f6ffbfb96fc4a Mon Sep 17 00:00:00 2001 From: Eric Adams Date: Thu, 1 Apr 2021 19:14:02 +0000 Subject: [PATCH] osbuilder: Update QAT Dockerfile with new QAT driver version This fixes the QAT driver version and provides a check early in the building process to make sure the driver exists. It also provides hints to users on how to fix themselves if the driver changes again. Fixes: #1618 Signed-off-by: Eric Adams --- tools/osbuilder/dockerfiles/QAT/Dockerfile | 5 ++-- tools/osbuilder/dockerfiles/QAT/run.sh | 28 +++++++++++++--------- 2 files changed, 19 insertions(+), 14 deletions(-) mode change 100644 => 100755 tools/osbuilder/dockerfiles/QAT/run.sh diff --git a/tools/osbuilder/dockerfiles/QAT/Dockerfile b/tools/osbuilder/dockerfiles/QAT/Dockerfile index 0f2ac0845d..e0476aadd0 100644 --- a/tools/osbuilder/dockerfiles/QAT/Dockerfile +++ b/tools/osbuilder/dockerfiles/QAT/Dockerfile @@ -9,9 +9,9 @@ FROM fedora:latest # images being pulled from the registry. # Set AGENT_VERSION as an env variable to specify a specific version of Kata Agent to install -LABEL DOCKERFILE_VERSION="2.0" +LABEL DOCKERFILE_VERSION="2.1" -ENV QAT_DRIVER_VER "qat1.7.l.4.12.0-00011.tar.gz" +ENV QAT_DRIVER_VER "QAT1.7.L.4.13.0-00009.tar.gz" ENV QAT_DRIVER_URL "https://downloadmirror.intel.com/30178/eng/${QAT_DRIVER_VER}" ENV QAT_CONFIGURE_OPTIONS "--enable-icp-sriov=guest" ENV KATA_REPO_VERSION "main" @@ -22,7 +22,6 @@ ENV OUTPUT_DIR "/output" RUN dnf install -y \ bc \ bison \ - curl \ debootstrap \ diffutils \ e2fsprogs \ diff --git a/tools/osbuilder/dockerfiles/QAT/run.sh b/tools/osbuilder/dockerfiles/QAT/run.sh old mode 100644 new mode 100755 index 0f8fe007e9..0ca06e628f --- a/tools/osbuilder/dockerfiles/QAT/run.sh +++ b/tools/osbuilder/dockerfiles/QAT/run.sh @@ -4,7 +4,6 @@ # # SPDX-License-Identifier: Apache-2.0 -set -e set -u # NOTE: Some env variables are set in the Dockerfile - those that are @@ -20,12 +19,27 @@ kata_repo_path=${GOPATH}/src/${kata_repo} tests_repo=github.com/kata-containers/tests tests_repo_path=${GOPATH}/src/${tests_repo} +grab_qat_drivers() +{ + /bin/echo -e "\n\e[1;42mDownload and extract the drivers\e[0m" + mkdir -p $QAT_SRC + cd $QAT_SRC + wget $QAT_DRIVER_URL + if [ ! -f ${QAT_SRC}/${QAT_DRIVER_VER} ];then + /bin/echo -e "\e[1;41mQAT Driver ${QAT_DRIVER_VER} doesn't exist\e[0m" + echo "Check https://01.org/intel-quickassist-technology to find the latest" + echo "QAT driver version, update the Dockerfile, and try again." + exit 1 + fi + tar xzf ${QAT_DRIVER_VER} +} + grab_kata_repos() { # Check out all the repos we will use now, so we can try and ensure they use the specified branch # Only check out the branch needed, and make it shallow and thus space/bandwidth efficient # Use a green prompt with white text for easy viewing - bin/echo -e "\n\e[1;42mClone and checkout Kata repos\e[0m" + /bin/echo -e "\n\e[1;42mClone and checkout Kata repos\e[0m" git clone --single-branch --branch $KATA_REPO_VERSION --depth=1 https://${kata_repo} ${kata_repo_path} git clone --single-branch --branch $KATA_REPO_VERSION --depth=1 https://${tests_repo} ${tests_repo_path} } @@ -64,14 +78,6 @@ build_rootfs() sudo -E SECCOMP=no EXTRA_PKGS='kmod' ${kata_repo_path}/tools/osbuilder/rootfs-builder/rootfs.sh $ROOTFS_OS } -grab_qat_drivers() -{ - /bin/echo -e "\n\e[1;42mDownload and extract the drivers\e[0m" - mkdir -p $QAT_SRC - cd $QAT_SRC - curl -L $QAT_DRIVER_URL | tar zx -} - build_qat_drivers() { /bin/echo -e "\n\e[1;42mCompile driver modules\e[0m" @@ -157,11 +163,11 @@ main() done shift $((OPTIND-1)) + grab_qat_drivers grab_kata_repos configure_kernel build_kernel build_rootfs - grab_qat_drivers build_qat_drivers add_qat_to_rootfs copy_outputs