mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
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 <mikko.ylinen@intel.com>
This commit is contained in:
parent
47f5b34ad2
commit
06dbc1331b
@ -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"]
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user