Skip to content

Commit c2e323b

Browse files
authored
Merge pull request #534 from bart0sh/PR0097-dsa-demo
implement DSA demo
2 parents 5d80f2d + 2e4de52 commit c2e323b

File tree

4 files changed

+108
-0
lines changed

4 files changed

+108
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979

8080
# Demo images
8181
- crypto-perf
82+
- dsa-accel-config-demo
8283
- opae-nlb-demo
8384
- openssl-qat-engine
8485
- sgx-sdk-demo

cmd/dsa_plugin/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Table of Contents
1414
* [Build the plugin](#build-the-plugin)
1515
* [Run the plugin as administrator](#run-the-plugin-as-administrator)
1616
* [Verify plugin registration](#verify-plugin-registration)
17+
* [Testing the plugin](#testing-the-plugin)
1718

1819
## Introduction
1920

@@ -128,3 +129,64 @@ master
128129
dsa.intel.com/wq-user-dedicated: 1
129130
dsa.intel.com/wq-user-shared: 1
130131
```
132+
133+
### Testing the plugin
134+
135+
We can test the plugin is working by deploying the provided example accel-config test image.
136+
137+
1. Build a Docker image with an accel-config tests:
138+
139+
```bash
140+
$ make dsa-accel-config-demo
141+
...
142+
Successfully tagged dsa-accel-config-demo:devel
143+
```
144+
145+
1. Create a pod running unit tests off the local Docker image:
146+
147+
```bash
148+
$ kubectl apply -f ${INTEL_DEVICE_PLUGINS_SRC}/demo/dsa-accel-config-demo-pod.yaml
149+
pod/dsa-accel-config-demo created
150+
```
151+
152+
1. Wait until pod is completed:
153+
154+
```bash
155+
$ kubectl get pods |grep dsa-accel-config-demo
156+
dsa-accel-config-demo 0/1 Completed 0 31m
157+
158+
1. Review the job's logs:
159+
160+
```bash
161+
$ kubectl logs dsa-accel-config-demo | tail
162+
[debug] PF in sub-task[6], consider as passed
163+
[debug] PF in sub-task[7], consider as passed
164+
[debug] PF in sub-task[8], consider as passed
165+
[debug] PF in sub-task[9], consider as passed
166+
[debug] PF in sub-task[10], consider as passed
167+
[debug] PF in sub-task[11], consider as passed
168+
[debug] PF in sub-task[12], consider as passed
169+
[debug] PF in sub-task[13], consider as passed
170+
[debug] PF in sub-task[14], consider as passed
171+
[debug] PF in sub-task[15], consider as passed
172+
```
173+
174+
If the pod did not successfully launch, possibly because it could not obtain the DSA
175+
resource, it will be stuck in the `Pending` status:
176+
177+
```bash
178+
$ kubectl get pods
179+
NAME READY STATUS RESTARTS AGE
180+
dsa-accel-config-demo 0/1 Pending 0 7s
181+
```
182+
183+
This can be verified by checking the Events of the pod:
184+
185+
```bash
186+
187+
$ kubectl describe pod dsa-accel-config-demo | grep -A3 Events:
188+
Events:
189+
Type Reason Age From Message
190+
---- ------ ---- ---- -------
191+
Warning FailedScheduling 2m26s default-scheduler 0/1 nodes are available: 1 Insufficient dsa.intel.com/wq-user-dedicated, 1 Insufficient dsa.intel.com/wq-user-shared.
192+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: dsa-accel-config-demo
5+
spec:
6+
containers:
7+
- name: dsa-accel-config-demo
8+
image: dsa-accel-config-demo:devel
9+
imagePullPolicy: IfNotPresent
10+
resources:
11+
limits:
12+
dsa.intel.com/wq-user-dedicated: 1
13+
dsa.intel.com/wq-user-shared: 1
14+
cpu: 1
15+
16+
restartPolicy: Never
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM fedora:32 AS builder
2+
3+
RUN dnf install -y wget autoconf automake libtool m4 diffutils file make dnf-utils
4+
RUN dnf install -y libuuid-devel json-c-devel kmod-devel libudev-devel
5+
6+
ARG ACCEL_CONFIG_VERSION=v2.8
7+
8+
RUN wget -O- https://github.com/intel/idxd-config/archive/accel-config-$ACCEL_CONFIG_VERSION.tar.gz | tar -zx
9+
10+
RUN cd idxd-config-accel-config-$ACCEL_CONFIG_VERSION && \
11+
mkdir m4 && \
12+
./autogen.sh && \
13+
./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 --enable-test=yes --disable-docs && \
14+
make && \
15+
make check && \
16+
make install
17+
18+
FROM fedora:32
19+
20+
RUN dnf install -y libuuid json-c kmod udev
21+
22+
COPY --from=builder /lib64/libaccel-config.so.1 /lib64/
23+
COPY --from=builder /lib64/libaccel-config.so.1.0.0 /lib64/
24+
RUN ldconfig
25+
26+
COPY --from=builder /usr/bin/accel-config /usr/bin/
27+
COPY --from=builder /usr/share/accel-config/test /test
28+
29+
ENTRYPOINT cd /test && sed '/_cleanup$/d;/start_dsa$/d;/enable_wqs$/d;/stop_dsa$/d;/disable_wqs$/d' dsa_user_test_runner.sh | sh

0 commit comments

Comments
 (0)