From 06dbc1331bff6eaecae3009a521fd5f75e9be05a Mon Sep 17 00:00:00 2001 From: Mikko Ylinen Date: Wed, 2 Jun 2021 13:09:50 +0300 Subject: [PATCH] images: move intel-qat-plugin-kerneldrv to Debian Also, update the documentation to reflect what is needed to enable and use '-mode kernel'. Signed-off-by: Mikko Ylinen --- .../intel-qat-plugin-kerneldrv.Dockerfile | 54 +++++++++---------- cmd/qat_plugin/README.md | 12 ++--- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/build/docker/intel-qat-plugin-kerneldrv.Dockerfile b/build/docker/intel-qat-plugin-kerneldrv.Dockerfile index 9ce97d55..b56d0273 100644 --- a/build/docker/intel-qat-plugin-kerneldrv.Dockerfile +++ b/build/docker/intel-qat-plugin-kerneldrv.Dockerfile @@ -1,53 +1,49 @@ -# CLEAR_LINUX_BASE and CLEAR_LINUX_VERSION can be used to make the build -# reproducible by choosing an image by its hash and installing an OS version -# with --version=: -# CLEAR_LINUX_BASE=clearlinux@sha256:b8e5d3b2576eb6d868f8d52e401f678c873264d349e469637f98ee2adf7b33d4 -# CLEAR_LINUX_VERSION="--version=29970" +# Copyright 2021 Intel Corporation. All Rights Reserved. +# +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# GOLANG_BASE can be used to make the build reproducible by choosing an +# image by its hash: +# GOLANG_BASE=golang@sha256:9d64369fd3c633df71d7465d67d43f63bb31192193e671742fa1c26ebc3a6210 # # This is used on release branches before tagging a stable version. -# The master branch defaults to using the latest Clear Linux. -ARG CLEAR_LINUX_BASE=clearlinux/golang:latest +# The main branch defaults to using the latest Golang base image. +ARG GOLANG_BASE=golang:1.15-buster -FROM ${CLEAR_LINUX_BASE} as builder +FROM ${GOLANG_BASE} as builder -ARG CLEAR_LINUX_VERSION= - -RUN swupd update --no-boot-update ${CLEAR_LINUX_VERSION} -RUN ldconfig ARG DIR=/intel-device-plugins-for-kubernetes ARG GO111MODULE=on +ARG BUILDFLAGS="-ldflags=-w -s" WORKDIR $DIR COPY . . -ARG TAGS_KERNELDRV=kerneldrv - -RUN mkdir /install_root \ - && swupd os-install \ - ${CLEAR_LINUX_VERSION} \ - --path /install_root \ - --statedir /swupd-state \ - $(test -z "${TAGS_KERNELDRV}" || echo "--bundles=libstdcpp") \ - --no-boot-update \ - && rm -rf /install_root/var/lib/swupd/* - ARG QAT_DRIVER_RELEASE="qat1.7.l.4.11.0-00001" -RUN test -z "${TAGS_KERNELDRV}" \ - || ( swupd bundle-add wget c-basic \ - && mkdir -p /usr/src/qat \ +RUN mkdir -p /usr/src/qat \ && cd /usr/src/qat \ && wget https://01.org/sites/default/files/downloads/${QAT_DRIVER_RELEASE}.tar.gz \ && tar xf *.tar.gz \ && cd /usr/src/qat/quickassist/utilities/adf_ctl \ && make KERNEL_SOURCE_DIR=/usr/src/qat/quickassist/qat \ - && install -D adf_ctl /install_root/usr/local/bin/adf_ctl ) -RUN cd cmd/qat_plugin; echo "build tags: ${TAGS_KERNELDRV}"; GO111MODULE=${GO111MODULE} go install -tags "${TAGS_KERNELDRV}"; cd - + && install -D adf_ctl /install_root/usr/local/bin/adf_ctl +RUN cd cmd/qat_plugin; GO111MODULE=${GO111MODULE} CGO_ENABLED=1 go install -tags kerneldrv; cd - RUN chmod a+x /go/bin/qat_plugin \ && install -D /go/bin/qat_plugin /install_root/usr/local/bin/intel_qat_device_plugin \ && install -D ${DIR}/LICENSE /install_root/usr/local/share/package-licenses/intel-device-plugins-for-kubernetes/LICENSE \ && scripts/copy-modules-licenses.sh ./cmd/qat_plugin /install_root/usr/local/share/ -FROM scratch as final +FROM debian:buster-slim COPY --from=builder /install_root / ENV PATH=/usr/local/bin ENTRYPOINT ["/usr/local/bin/intel_qat_device_plugin"] diff --git a/cmd/qat_plugin/README.md b/cmd/qat_plugin/README.md index f7126455..70dc16e1 100644 --- a/cmd/qat_plugin/README.md +++ b/cmd/qat_plugin/README.md @@ -78,14 +78,14 @@ For more details on the `-dpdk-driver` choice, see For more details on the available options to the `-kernel-vf-drivers` option, see the list of vf drivers available in the [Linux Kernel](https://github.com/torvalds/linux/tree/master/drivers/crypto/qat). -If the `-mode` parameter is set to `kerneldrv`, no other parameter documented above are valid, +If the `-mode` parameter is set to `kernel`, no other parameter documented above are valid, except the `klog` logging related parameters. -`kerneldrv` mode implements resource allocation based on system configured [logical instances][7]. +`kernel` mode implements resource allocation based on system configured [logical instances][7]. -> **Note**: `kerneldrv` mode is excluded by default from all builds (including those hosted on the Docker hub), +> **Note**: `kernel` mode is excluded by default from all builds (including those hosted on the Docker hub), > by default. See the [Build the plugin image](#build-the-plugin-image) section for more details. -The `kerneldrv` mode does not guarantee full device isolation between containers +The `kernel` mode does not guarantee full device isolation between containers and therefore it's not recommended. This mode will be deprecated and removed once `libqat` implements non-UIO based device access. @@ -166,8 +166,8 @@ $ make intel-qat-plugin Successfully tagged intel/intel-qat-plugin:devel ``` -> **Note**: `kerneldrv` mode is excluded from the build by default. Add `EXTRA_BUILD_ARGS="--build-arg TAGS_KERNELDRV=kerneldrv"` and run `make intel-qat-plugin-kerneldrv` -> to get `kerneldrv` functionality added to the build. +> **Note**: `kernel` mode is excluded from the build by default. Run `make intel-qat-plugin-kerneldrv` +> to get a `kernel` mode enabled image. #### Deploy the DaemonSet