From 8291266890054efeec67191ce55d19655d007465 Mon Sep 17 00:00:00 2001 From: mlok Date: Fri, 6 Aug 2021 18:14:04 -0400 Subject: [PATCH 1/2] [platform] Add protobuf and grpc C++ and python lib to support nokia platform build Signed-off-by: mlok --- 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 077388d941ff..16ba34334303 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -319,6 +319,8 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in python3-distutils \ python3-pip \ cron \ + libprotobuf-dev \ + libgrpc++ \ haveged \ jq diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 index d8988b8f6ebe..67e265d28699 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.26.0 \ + grpcio-tools==1.26.0 + +RUN pip3 install grpcio==1.26.0 \ + grpcio-tools==1.26.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 5c4c843d3902..ef654924fece 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -143,6 +143,12 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install psutil sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip2 install ipaddr sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install ipaddr +# Install Python module for grpcio and grpcio-toole +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install "grpcio==1.26.0" +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install "grpcio-tools==1.26.0" +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio==1.26.0" +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio-tools==1.26.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}}) From c61d380596987c8708e9367692400528d07aeb9d Mon Sep 17 00:00:00 2001 From: mlok Date: Thu, 21 Oct 2021 10:56:02 -0400 Subject: [PATCH 2/2] Update the protobuf and grpcio lib version -- Changed the libbrotbuf-dev to buster lightly version libprotobuf17 -- Change the grpcio 1.26.0 to 1.39.0 --- build_debian.sh | 2 +- dockers/docker-platform-monitor/Dockerfile.j2 | 8 ++++---- files/build_templates/sonic_debian_extension.j2 | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build_debian.sh b/build_debian.sh index 16ba34334303..c4d3d4fc2480 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -319,7 +319,7 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in python3-distutils \ python3-pip \ cron \ - libprotobuf-dev \ + libprotobuf17 \ libgrpc++ \ haveged \ jq diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 index 67e265d28699..21536f43c013 100755 --- a/dockers/docker-platform-monitor/Dockerfile.j2 +++ b/dockers/docker-platform-monitor/Dockerfile.j2 @@ -43,11 +43,11 @@ RUN pip2 install 'setuptools==40.8.0' # contains 'enum' as part of the standard library. Installing enum34 there will # cause conflicts. RUN pip2 install enum34 \ - grpcio==1.26.0 \ - grpcio-tools==1.26.0 + grpcio==1.39.0 \ + grpcio-tools==1.39.0 -RUN pip3 install grpcio==1.26.0 \ - grpcio-tools==1.26.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 ef654924fece..355a0c5a80f1 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -144,10 +144,10 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip2 install ipaddr sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install ipaddr # Install Python module for grpcio and grpcio-toole -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install "grpcio==1.26.0" -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install "grpcio-tools==1.26.0" -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio==1.26.0" -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio-tools==1.26.0" +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