Skip to content

Commit

Permalink
extraConfigDpu: Move to Kubecon Intel VSP/P4 img
Browse files Browse the repository at this point in the history
Signed-off-by: Salvatore Daniele <[email protected]>
  • Loading branch information
SalDaniele committed Nov 13, 2024
1 parent c255f37 commit 2968d90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions dpuVendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ def build_push(self, h: host.Host, imgReg: ImageRegistry, sha: str) -> str:
if h.is_localhost():
env = os.environ.copy()
env["IMGTOOL"] = "podman"
env["P4_NAME"] = "fxp-net_linux-networking"
env["P4_DIR"] = "fxp-net_linux-networking"

ret = h.run("make -C /root/ipu-opi-plugins/ipu-plugin image", env=env)
else:
ret = h.run("IMGTOOL=podman make -C /root/ipu-opi-plugins/ipu-plugin image")
Expand Down
10 changes: 5 additions & 5 deletions extraConfigDpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
DPU_OPERATOR_REPO = "https://github.com/openshift/dpu-operator.git"
MICROSHIFT_KUBECONFIG = "/root/kubeconfig.microshift"
OSE_DOCKERFILE = "https://pkgs.devel.redhat.com/cgit/containers/dpu-operator/tree/Dockerfile?h=rhaos-4.17-rhel-9"
P4_IMG = "wsfd-advnetlab240.anl.eng.bos2.dc.redhat.com:5000/intel-ipu-p4-sdk:10-9-2024"
P4_IMG = "wsfd-advnetlab223.anl.eng.bos2.dc.redhat.com:5000/intel-ipu-sdk:kubecon-aarch64"

KERNEL_RPMS = [
"https://download-01.beak-001.prod.iad2.dc.redhat.com/brewroot/vol/rhel-9/packages/kernel/5.14.0/427.2.1.el9_4/x86_64/kernel-5.14.0-427.2.1.el9_4.x86_64.rpm",
Expand Down Expand Up @@ -151,16 +151,16 @@ def wait_vsp_ds_running(client: K8sClient) -> None:

def ensure_p4_pod_running(lh: host.Host, acc: host.Host, imgReg: ImageRegistry) -> None:
lh.run_or_die(f"podman pull --tls-verify=false {P4_IMG}")
lh.run_or_die(f"podman tag {P4_IMG} {imgReg.url()}/intel-ipu-p4-sdk:10-9-2024")
lh.run_or_die(f"podman push {imgReg.url()}/intel-ipu-p4-sdk:10-9-2024")
lh.run_or_die(f"podman tag {P4_IMG} {imgReg.url()}/kubecon-aarch64")
lh.run_or_die(f"podman push {imgReg.url()}/kubecon-aarch64")
uname = acc.run("uname -r").out.strip()
logger.info("Manually starting P4 container")
cmd = f"podman run --network host -d --privileged --entrypoint='[\"/bin/sh\", \"-c\", \"sleep 5; sh /entrypoint.sh\"]' -v /lib/modules/{uname}:/lib/modules/{uname} -v data1:/opt/p4 {imgReg.url()}/intel-ipu-p4-sdk:10-9-2024"
cmd = f"podman run -d --privileged -v /lib/modules/{uname}:/lib/modules/{uname} -v /opt/p4/p4-cp-nws/var/run:/opt/p4/p4-cp-nws/var/run -v /sys:/sys -p 9559:9559 {imgReg.url()}/kubecon-aarch64"
acc.run_or_die(cmd)
# Occasionally the P4 pod fails to start
while True:
time.sleep(10)
if "intel-ipu-p4-sdk:10-9-2024" in acc.run("podman ps").out:
if "kubecon-aarch64" in acc.run("podman ps").out:
break
logger.info("Failed to start p4 container, retrying")
acc.run_or_die(cmd)
Expand Down

0 comments on commit 2968d90

Please sign in to comment.