From 87a13a73cd0469e02fc583a9cbfe556f07bc2afe Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Tue, 26 Oct 2021 21:09:32 -0400 Subject: [PATCH] [Nokia] Add protobuf and grpc C++ and python lib to support Nokia IXR7250E platform (#8366) Nokia IXR7250E platform requires grpcio, grpcio-tools python library, and libprotobuf-dev, libgrpc++ library Modified the build_debian.sh install libprotobuf-dev and libgrpc++ to support nokia ndk Modified the sonic_debian_extension.j2 to install the grpcio and grpcio-tools in the host Modified the docker-platform-monitor/Dockerfile.js to install grpcio and grpcio-tools for the pmon container. Image running success. --- build_debian.sh | 2 ++ dockers/docker-platform-monitor/Dockerfile.j2 | 7 ++++++- files/build_templates/sonic_debian_extension.j2 | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/build_debian.sh b/build_debian.sh index e23dde2458e7..6619c4f0e4e5 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -320,6 +320,8 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in python3-distutils \ python3-pip \ cron \ + libprotobuf17 \ + libgrpc++ \ haveged \ jq diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 index d8988b8f6ebe..21536f43c013 100755 --- a/dockers/docker-platform-monitor/Dockerfile.j2 +++ b/dockers/docker-platform-monitor/Dockerfile.j2 @@ -42,7 +42,12 @@ RUN pip2 install 'setuptools==40.8.0' # NOTE: Only install enum34 for Python 2, as our version of Python 3 is 3.7, which # contains 'enum' as part of the standard library. Installing enum34 there will # cause conflicts. -RUN pip2 install enum34 +RUN pip2 install enum34 \ + grpcio==1.39.0 \ + grpcio-tools==1.39.0 + +RUN pip3 install grpcio==1.39.0 \ + grpcio-tools==1.39.0 # Barefoot platform vendors' sonic_platform packages import the Python 'thrift' library RUN pip2 install thrift==0.13.0 diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 16f2e8eb96ef..5d2e3306291f 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -123,6 +123,12 @@ sudo rm -rf $FILESYSTEM_ROOT/$REDIS_DUMP_LOAD_PY2_WHEEL_NAME # Install Python module for psutil sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install psutil +# Install Python module for grpcio and grpcio-toole +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install "grpcio==1.39.0" +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install "grpcio-tools==1.39.0" +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio==1.39.0" +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio-tools==1.39.0" + # Install SwSS SDK Python 3 package # Note: the scripts will be overwritten by corresponding Python 2 package SWSSSDK_PY3_WHEEL_NAME=$(basename {{swsssdk_py3_wheel_path}})