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 <eric.adams@intel.com>
This commit is contained in:
Eric Adams 2021-04-01 19:14:02 +00:00
parent c0c7bef2b8
commit 010d57f4e2
2 changed files with 19 additions and 14 deletions

View File

@ -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 \

28
tools/osbuilder/dockerfiles/QAT/run.sh Normal file → Executable file
View File

@ -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