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 Sep 12, 2023
1 parent 28d01ce commit 449b8f6
Show file tree
Hide file tree
Showing 3 changed files with 160 additions and 0 deletions.
69 changes: 69 additions & 0 deletions tests/l2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,75 @@ $ 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. 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 IPC_LOCK capability for pod

```$ oc apply -f https://raw.githubusercontent.com/intel/intel-technology-enabling-for-openshift/main/security/qatlib_rbac.yaml```

```$ 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-c6g9v 0/1 Completed 0 4m13s
```


* For all sample tests `./cpa_sample_code`

```
$ oc logs intel-qat-workload-c6g9v
qaeMemInit started
icp_sal_userStartMultiProcess("SSL") started
There are no crypto instances
*** QA version information ***
device ID = 0
software = 23.2.0
*** END QA version information ***
Inst 0, Affin: 0, Dev: 0, Accel 0, EE 0, BDF ED:00:01
Inst 1, Affin: 1, Dev: 0, Accel 0, EE 0, BDF ED:00:01
Inst 2, Affin: 2, Dev: 0, Accel 0, EE 0, BDF ED:00:01
Inst 3, Affin: 3, Dev: 0, Accel 0, EE 0, BDF ED:00:01
---------------------------------------
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 4
Total Responses 158400
Total Retries 2242671
Clock Cycles Start 126150916653843
Clock Cycles End 126151409143747
Total Cycles 492489904
CPU Frequency(kHz) 1700160
Throughput(Mbps) 35920
Compression Ratio 0.4897
---------------------------------------
Inst 0, Affin: 0, Dev: 0, Accel 0, EE 0, BDF ED:00:01
Inst 1, Affin: 1, Dev: 0, Accel 0, EE 0, BDF ED:00:01
Inst 2, Affin: 2, Dev: 0, Accel 0, EE 0, BDF ED:00:01
Inst 3, Affin: 3, Dev: 0, Accel 0, EE 0, BDF ED:00:01
---------------------------------------
```


## 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)
62 changes: 62 additions & 0 deletions tests/l2/qat/qatlib_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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
ARG QATLIB_VERSION
RUN dnf -y update && \
dnf install -y gcc \
systemd-devel \
make \
automake \
autoconf \
libtool \
openssl-devel \
zlib-devel \
git && \
git clone -b $QATLIB_VERSION https://github.com/intel/qatlib
RUN cd /qatlib && \
./autogen.sh && \
./configure \
--prefix=/usr \
--disable-fast-crc-in-assembler \
--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.08.0"

output:
to:
kind: ImageStreamTag
name: intel-qat-workload:latest
29 changes: 29 additions & 0 deletions tests/l2/qat/qatlib_job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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"]
securityContext:
capabilities:
add:
[IPC_LOCK]
resources:
requests:
qat.intel.com/dc: '1'
qat.intel.com/cy: '1'
limits:
qat.intel.com/dc: '1'
qat.intel.com/cy: '1'
serviceAccount: intel-qat

0 comments on commit 449b8f6

Please sign in to comment.