Skip to content

saithriftv2: link VPP libraries for platform=vpp + bookworm/py3 build fixes#2299

Open
nicholasching wants to merge 5 commits into
opencomputeproject:masterfrom
nicholasching:sai_vpp_ut_saithrift_build
Open

saithriftv2: link VPP libraries for platform=vpp + bookworm/py3 build fixes#2299
nicholasching wants to merge 5 commits into
opencomputeproject:masterfrom
nicholasching:sai_vpp_ut_saithrift_build

Conversation

@nicholasching

Copy link
Copy Markdown

Context / motivation

This PR is part of the SAIVPP unit-test framework: a Docker harness (docker-sai-test-vpp) that runs the upstream OCP sai_test PTF suite against the real VPP SAI backend (libsaivs) in one container — VPP + saiserver + PTF + veth/AF_PACKET topology. That work is documented in our devdocs under sonic-sairedis/.azure-pipelines/docker-sai-test-vpp/devdocs/ (see progress.md).

To run the suite, saiserver (saithriftv2) must build and link against the VPP SAI backend on a bookworm/python3 toolchain. Upstream saithriftv2 only has a vs link line and a python2.7 install path, so it does not build for the vpp platform on bookworm. This is Phase 1, Task 2 of the SAIVPP UT HLD (the saithriftv2 Makefile work).

What this change does

Build/packaging only, no test logic:

  • test/saithriftv2/Makefile — add a platform=vpp link line that pulls in the 5 VPP libraries SaiVppXlate.c requires (-lvlib -lvlibapi -lvppapiclient -lvlibmemoryclient -lvppinfra) plus -lswsscommon; also add -lswsscommon to the vs line.
  • test/saithriftv2/src/saiserver.cpp — enable SWSS debug logging at startup (swss::Logger to STDOUT), so the harness captures a high-level SAI RPC trace in saiserver.log (used throughout our debugging).
  • debian/python-saithrift.install — install the Python bindings from the python3 dist-packages path so the package builds on bookworm (was hardcoded to python2.7/site-packages).
  • test/saithriftv2/convert_header.py — fix an enum __str__ that did split(".")[1] and threw an IndexError on some enum names; use self.name instead.

Scope / risk

  • 4 files, +11/−3 — build flags, a packaging path, a logging init, and a one-line stringification fix.
  • No change to SAI semantics, RPC surface, or test logic.
  • The vpp link line is new (additive); the vs line only gains -lswsscommon.

Signed-off-by: Nicholas Ching <nicholaslching@gmail.com>
Signed-off-by: Nicholas Ching <nicholaslching@gmail.com>
Signed-off-by: Nicholas Ching <nicholaslching@gmail.com>
Signed-off-by: Nicholas Ching <nicholaslching@gmail.com>
@nicholasching

Copy link
Copy Markdown
Author

@tjchadaga please run azure pipeline when possible; this PR is needed for an upstream feature at Cisco ASAP, thanks!

Comment thread test/saithriftv2/src/saiserver.cpp Outdated
#include <netinet/in.h>
#include <arpa/inet.h>
#include "sai_rpc.h"
#include <swss/logger.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds extra dependency on SONiC swss. This is not right for the projects running independently from SONiC.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree! I was using that before to route saiserver logs to stdout for debugging. We do not need it anymore; I have pushed another commit to remove it. Thanks Fred!

Signed-off-by: Nicholas Ching <nicholaslching@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants