[Mellanox] Add support for new "nvidia-bluefield" platform.#18466
Conversation
|
@prgeor , @saiarcot895 , can you help to review it? |
| && cd /opt \ | ||
| && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ | ||
| && apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \ | ||
| && rm -rf /root/deps |
There was a problem hiding this comment.
I know that most of this came from another file (either Dockerfile or sonic-mgmt test case), but can this be replaced with steps to install nanomsg-utils or libnanomsg5 from the Debian repos instead?
Also, should this still be Python 2, or can it be changed to Python 3?
There was a problem hiding this comment.
We don't have a use case for the PRC image right now. I removed all related files. When it will be needed we will submit it in a separate PR.
| {% endif %} | ||
|
|
||
| ## Clean up | ||
| RUN apt-get clean -y && \ |
There was a problem hiding this comment.
Please remove python3-pip, python3-dev, and python3-setuptools.
| pushd mlnx_sai | ||
|
|
||
| # Build the package | ||
| debuild -e 'make_extra_flags="DEFS=-DACS_OS -DCONFIG_SYSLOG"' -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) |
There was a problem hiding this comment.
Cosnidering the rest of the repo uses dpkg-buildpackage, can that be used here instead of debuild?
There was a problem hiding this comment.
Do you see any issues with the debuild utility? All the makefiles we have here are well-tested. Any change to the make files will require us to run the regression and qualify the changes.
There was a problem hiding this comment.
No specific issues, just consistency.
| # put a lock here because dpkg does not allow installing packages in parallel | ||
| while true; do | ||
| if mkdir $(DEST)/dpkg_lock &> /dev/null; then | ||
| { sudo dpkg -i $(SRC_DEB) && rm -d $(DEST)/dpkg_lock && break; } || { rm -d $(DEST)/dpkg_lock && exit 1 ; } |
There was a problem hiding this comment.
If these packages need to be installed as build dependencies, can they be specified as such via the approprate rules.mk file, instead of installing them here?
There was a problem hiding this comment.
It is impossible to do via rules.mk because the package installed here is a part of the archive we download. Theoretically, we can split this into two targets and create dependencies between them but this will require downloading the archive twice.
There was a problem hiding this comment.
What about having a Makefile that only downloads the archive, extracts the packages, and then copies it to target/debs/...? rules.mk would call that Makefile and then expects the packages to get installed.
There was a problem hiding this comment.
This is a good idea. I updated the implementation
| patch -p1 < ../0001-Remove-meson-from-dependencies.patch | ||
|
|
||
| # Build the Debs | ||
| PATH=/usr/bin/:$(PATH) dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) |
There was a problem hiding this comment.
Why the PATH change here?
There was a problem hiding this comment.
In this Makefile it is not needed. Removed
| pushd $(OFED_SRC)/ | ||
| find . -type f -exec touch {} + | ||
|
|
||
| sudo mv /bin/uname /bin/uname.orig |
There was a problem hiding this comment.
If this needs to be done, I would highly recommend instead having this in some manually-created directory, and updating PATH so that that directory is checked first. (Ideally, any package build should allow for specifying the kernel version via an argument or an environment variable, as is usually done for external kernel module builds.)
There was a problem hiding this comment.
I reworked the Makefile. Now this is removed.
dc2b7dc to
60630b8
Compare
60630b8 to
a0871d1
Compare
|
@saiarcot895 can you please check this PR? |
There was a problem hiding this comment.
FYI, Python 3.9 and newer have this functionality in the stdlib: https://docs.python.org/3/library/functools.html#functools.cache
|
@prgeor for review of platform APIs |
liat-grozovik
left a comment
There was a problem hiding this comment.
please check the comment on all new files.
There was a problem hiding this comment.
new file cannot have such header.
There was a problem hiding this comment.
new file cannot have such header
Signed-off-by: Oleksandr Ivantsiv <[email protected]> Co-authored-by: Vivek Reddy <[email protected]> Co-authored-by: Yakiv Huryk <[email protected]>
a0871d1 to
1f6e45c
Compare
|
I was indeed late to review this PR...@liat-grozovik I didn't understand the urgency in merging this PR |
Why I did it
Add support for new Nvidia-bluefield BF-3 DPU.
Work item tracking
How I did it
Define a new
nvidia-bluefieldplatform with a set of makefiles to compile an image with all dependencies. Impleme PMON platform APIHow to verify it
The added changes don't affect the compilation of the existing platforms.
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)