Skip to content

Commit 42c1792

Browse files
committed
fix p4 image entrypoint startup issues
Added some additional sleep for before running p4rt-ctl commands to avoid CPF initialization error. Also added a K8s daemonset spec for p4 container image. Signed-off-by: Halim, Abdul <[email protected]>
1 parent 350cf84 commit 42c1792

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

e2e/artefacts/k8s/p4sdk-ds.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
name: p4sdk-daemonset
5+
spec:
6+
selector:
7+
matchLabels:
8+
name: p4sdk
9+
template:
10+
metadata:
11+
labels:
12+
name: p4sdk
13+
spec:
14+
hostNetwork: true
15+
automountServiceAccountToken: false
16+
containers:
17+
- name: p4sdk
18+
image: localhost:5000/intel-ipu-p4-sdk:latest
19+
imagePullPolicy: Always
20+
securityContext:
21+
privileged: true
22+
command: [ "/entrypoint.sh" ]
23+
volumeMounts:
24+
- name: host-libmodules
25+
mountPath: /lib/modules
26+
mountPropagation: HostToContainer
27+
volumes:
28+
- name: host-libmodules
29+
hostPath:
30+
path: /lib/modules
31+
type: Directory
32+

p4sdk/images/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func_set_br_pipe(){
3333
CPF_INFO_FILE=cpf_info_file.txt
3434
CONF_DIR=/usr/share/stratum/es2k
3535
CONF_FILE=es2k_skip_p4.conf
36-
$SDE_INSTALL/bin/vfio_bind.sh 8086:1453 > $CPF_INFO_FILE 2>&1
36+
$SDE_INSTALL/bin/vfio_bind.sh 8086:1453 | tail -n 1 > $CPF_INFO_FILE 2>&1
3737
IOMMU_GROUP=$(awk '{print $5}' $CPF_INFO_FILE)
3838
CPF_BDF=$(awk '{print $2}' $CPF_INFO_FILE)
3939
export IOMMU_GROUP

0 commit comments

Comments
 (0)