Skip to content

Commit

Permalink
tests_l2: Added qat workload
Browse files Browse the repository at this point in the history
Signed-off-by: vbedida79 <veenadhari.bedida@intel.com>
  • Loading branch information
vbedida79 committed Aug 30, 2023
1 parent 8aad524 commit 150f817
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 0 deletions.
62 changes: 62 additions & 0 deletions tests/l2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,68 @@ $ oc logs intel-dgpu-clinfo-56mh2
Device OpenCL C all versions OpenCL
```

### Verify Intel® QuickAssist Technology provisioning
This workload runs [qatlib](https://github.com/intel/qatlib) sample tests for compression and crypto. Refer to the [qatlib readme](https://github.com/intel/qatlib/blob/main/INSTALL) for more details.
* Build the workload container image.

```$ oc apply -f https://raw.githubusercontent.com/intel/intel-technology-enabling-for-openshift/main/tests/l2/qat/qatlib_build.yaml ```

* Deploy and execute the workload.

* Run with privileged SCC
```$oc adm policy add-scc-to-user privileged -z intel-qat```

```$ oc apply -f https://raw.githubusercontent.com/intel/intel-technology-enabling-for-openshift/main/tests/l2/qat/qatlib_job.yaml```

* Check the results.
```
$ oc get pods
intel-qat-workload-llhph 0/1 Completed 0 6m34s
```


* For crypto test `./cpa_sample_code runTests=32` and resource `qat.intel.com/dc`

```
$ oc logs intel-qat-workload-llhph
API Traditional
Session State STATELESS
Algorithm DEFLATE
Huffman Type STATIC
Mode ASYNCHRONOUS
CNV Enabled YES
Direction COMPRESS
Packet Size 8192
Compression Level 1
Corpus CALGARY_CORPUS
Corpus Filename calgary
CNV Recovery Enabled YES
Number of threads 12
Total Responses 475200
Total Retries 7983119
Clock Cycles Start 618007337509561
Clock Cycles End 618007830333759
Total Cycles 492824198
CPU Frequency(kHz) 1700171
Throughput(Mbps) 107760
Compression Ratio 0.4897
```

* Similarly, for crypto test with same image: command `./cpa_sample_code runTests=2` and resource `qat.intel.com/cy`.


```
RSA CRT DECRYPT
Modulus Size 2048
Number of Threads 6
Total Submissions 600000
Total Responses 600000
Total Retries 29945749
CPU Frequency(kHz) 1700158
Operations per second 58510
```


## See Also
For Intel SGX demos on vanilla Kubernetes, refer to [link](https://github.com/intel/intel-device-plugins-for-kubernetes/tree/main/demo/sgx-sdk-demo)
For GPU demos on vanilla Kubernetes, refer to [link](https://github.com/intel/intel-device-plugins-for-kubernetes/tree/main/demo/intel-opencl-icd)
61 changes: 61 additions & 0 deletions tests/l2/qat/qatlib_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright (c) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
name: intel-qat-workload
namespace: intel-qat
spec: {}
---
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
name: intel-qat-workload
namespace: intel-qat
spec:
triggers:
- type: "ConfigChange"
- type: "ImageChange"
runPolicy: "Serial"
source:
type: Dockerfile
dockerfile: |
FROM registry.access.redhat.com/ubi8/ubi AS builder
ARG QATLIB_VERSION="23.02.0"
RUN dnf -y update && \
dnf install -y gcc \
systemd-devel \
make \
automake \
autoconf \
libtool \
openssl-devel \
http://mirror.centos.org/centos/8-stream/PowerTools/x86_64/os/Packages/nasm-2.15.03-3.el8.x86_64.rpm \
git && \
git clone -b $QATLIB_VERSION https://github.com/intel/qatlib
RUN cd /qatlib && \
./autogen.sh && \
./configure \
--prefix=/usr \
--enable-systemd=no && \
make -j && \
make install samples-install
WORKDIR /usr/bin
ENTRYPOINT ["/usr/bin/cpa_sample_code"]
strategy:
type: Docker
noCache: true
dockerStrategy:
buildArgs:
- name: "QATLIB_VERSION"
value: "23.02.0"

output:
to:
kind: ImageStreamTag
name: intel-qat-workload:latest
24 changes: 24 additions & 0 deletions tests/l2/qat/qatlib_job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (c) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
apiVersion: batch/v1
kind: Job
metadata:
name: intel-qat-workload
namespace: intel-qat
spec:
template:
spec:
restartPolicy: Never
containers:
- name: intel-qat-job
image: image-registry.openshift-image-registry.svc:5000/intel-qat/intel-qat-workload:latest
imagePullPolicy: IfNotPresent
command: ["./cpa_sample_code", "runTests=32"]
securityContext:
privileged: true
resources:
requests:
qat.intel.com/dc: '1'
limits:
qat.intel.com/dc: '1'
serviceAccount: intel-qat

0 comments on commit 150f817

Please sign in to comment.