Skip to content

Commit 06dbc13

Browse files
committed
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>
1 parent 47f5b34 commit 06dbc13

File tree

2 files changed

+31
-35
lines changed

2 files changed

+31
-35
lines changed
Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,49 @@
1-
# CLEAR_LINUX_BASE and CLEAR_LINUX_VERSION can be used to make the build
2-
# reproducible by choosing an image by its hash and installing an OS version
3-
# with --version=:
4-
# CLEAR_LINUX_BASE=clearlinux@sha256:b8e5d3b2576eb6d868f8d52e401f678c873264d349e469637f98ee2adf7b33d4
5-
# CLEAR_LINUX_VERSION="--version=29970"
1+
# Copyright 2021 Intel Corporation. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# GOLANG_BASE can be used to make the build reproducible by choosing an
16+
# image by its hash:
17+
# GOLANG_BASE=golang@sha256:9d64369fd3c633df71d7465d67d43f63bb31192193e671742fa1c26ebc3a6210
618
#
719
# This is used on release branches before tagging a stable version.
8-
# The master branch defaults to using the latest Clear Linux.
9-
ARG CLEAR_LINUX_BASE=clearlinux/golang:latest
20+
# The main branch defaults to using the latest Golang base image.
21+
ARG GOLANG_BASE=golang:1.15-buster
1022

11-
FROM ${CLEAR_LINUX_BASE} as builder
23+
FROM ${GOLANG_BASE} as builder
1224

13-
ARG CLEAR_LINUX_VERSION=
14-
15-
RUN swupd update --no-boot-update ${CLEAR_LINUX_VERSION}
16-
RUN ldconfig
1725
ARG DIR=/intel-device-plugins-for-kubernetes
1826
ARG GO111MODULE=on
27+
ARG BUILDFLAGS="-ldflags=-w -s"
1928
WORKDIR $DIR
2029
COPY . .
2130

22-
ARG TAGS_KERNELDRV=kerneldrv
23-
24-
RUN mkdir /install_root \
25-
&& swupd os-install \
26-
${CLEAR_LINUX_VERSION} \
27-
--path /install_root \
28-
--statedir /swupd-state \
29-
$(test -z "${TAGS_KERNELDRV}" || echo "--bundles=libstdcpp") \
30-
--no-boot-update \
31-
&& rm -rf /install_root/var/lib/swupd/*
32-
3331
ARG QAT_DRIVER_RELEASE="qat1.7.l.4.11.0-00001"
3432

35-
RUN test -z "${TAGS_KERNELDRV}" \
36-
|| ( swupd bundle-add wget c-basic \
37-
&& mkdir -p /usr/src/qat \
33+
RUN mkdir -p /usr/src/qat \
3834
&& cd /usr/src/qat \
3935
&& wget https://01.org/sites/default/files/downloads/${QAT_DRIVER_RELEASE}.tar.gz \
4036
&& tar xf *.tar.gz \
4137
&& cd /usr/src/qat/quickassist/utilities/adf_ctl \
4238
&& make KERNEL_SOURCE_DIR=/usr/src/qat/quickassist/qat \
43-
&& install -D adf_ctl /install_root/usr/local/bin/adf_ctl )
44-
RUN cd cmd/qat_plugin; echo "build tags: ${TAGS_KERNELDRV}"; GO111MODULE=${GO111MODULE} go install -tags "${TAGS_KERNELDRV}"; cd -
39+
&& install -D adf_ctl /install_root/usr/local/bin/adf_ctl
40+
RUN cd cmd/qat_plugin; GO111MODULE=${GO111MODULE} CGO_ENABLED=1 go install -tags kerneldrv; cd -
4541
RUN chmod a+x /go/bin/qat_plugin \
4642
&& install -D /go/bin/qat_plugin /install_root/usr/local/bin/intel_qat_device_plugin \
4743
&& install -D ${DIR}/LICENSE /install_root/usr/local/share/package-licenses/intel-device-plugins-for-kubernetes/LICENSE \
4844
&& scripts/copy-modules-licenses.sh ./cmd/qat_plugin /install_root/usr/local/share/
4945

50-
FROM scratch as final
46+
FROM debian:buster-slim
5147
COPY --from=builder /install_root /
5248
ENV PATH=/usr/local/bin
5349
ENTRYPOINT ["/usr/local/bin/intel_qat_device_plugin"]

cmd/qat_plugin/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ For more details on the `-dpdk-driver` choice, see
7878
For more details on the available options to the `-kernel-vf-drivers` option, see the list of
7979
vf drivers available in the [Linux Kernel](https://github.com/torvalds/linux/tree/master/drivers/crypto/qat).
8080

81-
If the `-mode` parameter is set to `kerneldrv`, no other parameter documented above are valid,
81+
If the `-mode` parameter is set to `kernel`, no other parameter documented above are valid,
8282
except the `klog` logging related parameters.
83-
`kerneldrv` mode implements resource allocation based on system configured [logical instances][7].
83+
`kernel` mode implements resource allocation based on system configured [logical instances][7].
8484

85-
> **Note**: `kerneldrv` mode is excluded by default from all builds (including those hosted on the Docker hub),
85+
> **Note**: `kernel` mode is excluded by default from all builds (including those hosted on the Docker hub),
8686
> by default. See the [Build the plugin image](#build-the-plugin-image) section for more details.
8787
88-
The `kerneldrv` mode does not guarantee full device isolation between containers
88+
The `kernel` mode does not guarantee full device isolation between containers
8989
and therefore it's not recommended. This mode will be deprecated and removed once `libqat`
9090
implements non-UIO based device access.
9191

@@ -166,8 +166,8 @@ $ make intel-qat-plugin
166166
Successfully tagged intel/intel-qat-plugin:devel
167167
```
168168

169-
> **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`
170-
> to get `kerneldrv` functionality added to the build.
169+
> **Note**: `kernel` mode is excluded from the build by default. Run `make intel-qat-plugin-kerneldrv`
170+
> to get a `kernel` mode enabled image.
171171
172172
#### Deploy the DaemonSet
173173

0 commit comments

Comments
 (0)