-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Broadcom RPC build following syncd container upgrade to Bookworm …
…(#20949) Why I did it With the syncd container upgrade to Bookworm in #19712, the RPC containers started failing to build. There are some additional changes needed to the RPC container build and to use a newer version of the PTF package. Work item tracking Microsoft ADO (number only): 30368269 How I did it Modify the RPC dockerfiles to use Python 3, and to use the existing nanomsg package in Debian. Also, enable the Broadcom RPC image build as part of PRs.
- Loading branch information
1 parent
3ca6e7b
commit a98bee6
Showing
7 changed files
with
100 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 46 additions & 33 deletions
79
platform/broadcom/docker-syncd-brcm-dnx-rpc/Dockerfile.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,71 @@ | ||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} | ||
FROM docker-syncd-brcm-dnx-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} | ||
|
||
## Make apt-get non-interactive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
COPY \ | ||
{% for deb in docker_syncd_brcm_dnx_rpc_debs.split(' ') -%} | ||
debs/{{ deb }}{{' '}} | ||
{%- endfor -%} | ||
debs/ | ||
|
||
RUN apt-get purge -y syncd | ||
|
||
## Pre-install the fundamental packages | ||
RUN apt-get update \ | ||
&& apt-get -y install \ | ||
net-tools \ | ||
python3-pip \ | ||
python-setuptools \ | ||
python3-pip \ | ||
python3-dev \ | ||
python-is-python3 \ | ||
python3-scapy \ | ||
build-essential \ | ||
libssl-dev \ | ||
libffi-dev \ | ||
python-dev \ | ||
wget \ | ||
cmake \ | ||
libqt5core5a \ | ||
libqt5network5 \ | ||
libboost-atomic1.74.0 | ||
|
||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ | ||
{% for deb in docker_syncd_brcm_dnx_rpc_debs.split(' ') -%} | ||
dpkg_apt debs/{{ deb }}{{'; '}} | ||
{%- endfor %} | ||
|
||
RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ | ||
&& tar xvfz 1.0.0.tar.gz \ | ||
&& cd nanomsg-1.0.0 \ | ||
&& mkdir -p build \ | ||
&& cmake . \ | ||
&& make install \ | ||
&& ldconfig \ | ||
&& cd .. \ | ||
&& rm -fr nanomsg-1.0.0 \ | ||
&& rm -f 1.0.0.tar.gz \ | ||
&& pip2 install cffi==1.7.0 \ | ||
&& pip2 install --upgrade cffi==1.7.0 \ | ||
&& pip2 install wheel \ | ||
&& pip2 install nnpy \ | ||
libnanomsg5 \ | ||
libnanomsg-dev | ||
|
||
{% if docker_syncd_brcm_dnx_rpc_debs.strip() -%} | ||
# Copy locally-built Debian package dependencies | ||
{{ copy_files("debs/", docker_syncd_brcm_dnx_rpc_debs.split(' '), "/debs/") }} | ||
{% endif %} | ||
|
||
{% if docker_syncd_brcm_dnx_rpc_pydebs.strip() -%} | ||
# Copy locally-built Debian package dependencies | ||
{{ copy_files("python-debs/", docker_syncd_brcm_dnx_rpc_pydebs.split(' '), "/debs/") }} | ||
{% endif %} | ||
|
||
{% if docker_syncd_brcm_dnx_rpc_debs.strip() -%} | ||
# Install locally-built Debian packages and implicitly install their dependencies | ||
{{ install_debian_packages(docker_syncd_brcm_dnx_rpc_debs.split(' ')) }} | ||
{% endif %} | ||
|
||
{% if docker_syncd_brcm_dnx_rpc_pydebs.strip() -%} | ||
# Install locally-built Debian packages and implicitly install their dependencies | ||
{{ install_debian_packages(docker_syncd_brcm_dnx_rpc_pydebs.split(' ')) }} | ||
{% endif %} | ||
|
||
RUN pip3 install cffi==1.16.0 \ | ||
&& pip3 install wheel \ | ||
&& pip3 install nnpy \ | ||
&& mkdir -p /opt \ | ||
&& cd /opt \ | ||
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ | ||
&& mkdir ptf && cd ptf && wget https://raw.githubusercontent.com/p4lang/ptf/master/src/ptf/afpacket.py && touch __init__.py \ | ||
&& apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \ | ||
&& rm -rf /root/deps | ||
|
||
COPY ["ptf_nn_agent.conf", "/etc/supervisor/conf.d/"] | ||
|
||
## Clean up | ||
RUN apt-get -y purge \ | ||
cmake \ | ||
libssl-dev \ | ||
libffi-dev \ | ||
python3-dev \ | ||
python3-pip \ | ||
libthrift-dev \ | ||
build-essential | ||
|
||
RUN apt-get clean -y && \ | ||
apt-get autoclean -y && \ | ||
apt-get autoremove -y && \ | ||
rm -rf /debs | ||
|
||
ENTRYPOINT ["/usr/local/bin/supervisord"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters