Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Nokia] Add protobuf and grpc C++ and python lib to support Nokia IXR7250E platform #8366

Merged
merged 2 commits into from
Oct 27, 2021

Conversation

mlok-nokia
Copy link
Contributor

@mlok-nokia mlok-nokia commented Aug 6, 2021

Why I did it

Nokia IXR7250E platform requires grpcio, grpcio-tools python library, and libprotobuf-dev, libgrpc++ library

How I did it

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.

How to verify it

Image running success.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

@mlok-nokia mlok-nokia requested a review from lguohan as a code owner August 6, 2021 22:33
@mlok-nokia mlok-nokia changed the title [Nokia] Add protobuf and grpc C++ and python lib to support nokia platform image build [Nokia] Add protobuf and grpc C++ and python lib to support Nokia IXR7250E platform Aug 6, 2021
@mlok-nokia
Copy link
Contributor Author

@lguohan @judyjoseph @minionatwork Could you please review this PR

@minionatwork
Copy link
Contributor

@judyjoseph @abdosi Can you please review this one as well?

@mlok-nokia
Copy link
Contributor Author

@lguohan @judyjoseph @abdosi @minionatwork Please help to review this PR

@mlok-nokia
Copy link
Contributor Author

@lguohan @judyjoseph @abdosi @minionatwork Please help to review this PR

@mlok-nokia
Copy link
Contributor Author

@judyjoseph @lguohan Please help to review this PR. Thanks

@mlok-nokia
Copy link
Contributor Author

@lguohan @Blueve @judyjoseph @minionatwork Please help to review this PR. Thanks

@anshuv-mfst
Copy link

Hi @ysmanman - please assign reviewers from Arista for this PR.
@abdosi - please review or add respective reviewers from MSFT team.

ysmanman
ysmanman previously approved these changes Sep 28, 2021
@mlok-nokia
Copy link
Contributor Author

@abdosi Song has approved this PR. Could you please review it and help to merge it to master branch?

@judyjoseph
Copy link
Contributor

LGTM, Adding @qiluo-msft to take a look into this PR as well.

@judyjoseph judyjoseph requested a review from qiluo-msft October 14, 2021 20:46
@@ -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++ \
Copy link
Collaborator

@qiluo-msft qiluo-msft Oct 15, 2021

Choose a reason for hiding this comment

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

Do we truly need dev packages in sonic image? #Closed

Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel you install them because pip need them to build wheel from source code. Then is it possible to prebuilt and minimize the sonic image disk usage?

Copy link
Contributor Author

@mlok-nokia mlok-nokia Oct 21, 2021

Choose a reason for hiding this comment

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

I have updated the commit to change the libprotobuf-dev to the buster libprotobuf17.

@@ -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 \
Copy link
Collaborator

@qiluo-msft qiluo-msft Oct 15, 2021

Choose a reason for hiding this comment

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

grpcio==1.26.0

grpcio==1.26.0 \


why pip2 need install dependency explicitly, pip3 does not? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We cannot use the default version because upstream is always changing and current version 1.41.0 doesn't build for python2
I have updated to commit to change the grpcio version from 1.26.0 to the 1.39.0 for both pip2 and pip3.

grpcio-tools==1.26.0

RUN pip3 install grpcio==1.26.0 \
grpcio-tools==1.26.0
Copy link
Collaborator

@qiluo-msft qiluo-msft Oct 15, 2021

Choose a reason for hiding this comment

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

1.26.0

grpcio-tools==1.26.0


Why specify old version? any blocking issue to use latest version? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See previous comment.

-- Changed the libbrotbuf-dev to buster lightly version libprotobuf17
-- Change the grpcio 1.26.0 to 1.39.0
@mlok-nokia
Copy link
Contributor Author

@ysmanman Please help to review this PR.

@mlok-nokia
Copy link
Contributor Author

@qiluo-msft Could you please help to merge this PR? or need other people's review

@qiluo-msft qiluo-msft merged commit b91190d into sonic-net:master Oct 27, 2021
@judyjoseph judyjoseph added the Chassis 🤖 Modular chassis support label Oct 27, 2021
@xumia
Copy link
Collaborator

xumia commented Mar 8, 2022

@mlok-nokia , do you know how to support to install grpcio in armhf?

/# uname -m
armv8l

2022-03-08T11:27:46.4951787Z Collecting grpcio==1.39.0
2022-03-08T11:27:46.4952884Z   Downloading grpcio-1.39.0.tar.gz (21.3 MB)
2022-03-08T11:27:46.4953551Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 21.3/21.3 MB 33.8 MB/s eta 0:00:00
2022-03-08T11:27:46.4953995Z   Preparing metadata (setup.py): started
2022-03-08T11:27:46.4954617Z   Preparing metadata (setup.py): finished with status 'error'
2022-03-08T11:27:46.4955235Z   error: subprocess-exited-with-error
2022-03-08T11:27:46.4955564Z   
2022-03-08T11:27:46.4956066Z   × python setup.py egg_info did not run successfully.
2022-03-08T11:27:46.4956601Z   │ exit code: 1
2022-03-08T11:27:46.4963191Z   ╰─> [12 lines of output]
2022-03-08T11:27:46.4963614Z       Traceback (most recent call last):
2022-03-08T11:27:46.4963995Z         File "<string>", line 2, in <module>
2022-03-08T11:27:46.4964573Z         File "<pip-setuptools-caller>", line 34, in <module>
2022-03-08T11:27:46.4965359Z         File "/tmp/pip-install-cylmaawx/grpcio_633d44a4a5d345fbaaab0951bf1d9d3f/setup.py", line 257, in <module>
2022-03-08T11:27:46.4965900Z           if check_linker_need_libatomic():
2022-03-08T11:27:46.4966699Z         File "/tmp/pip-install-cylmaawx/grpcio_633d44a4a5d345fbaaab0951bf1d9d3f/setup.py", line 204, in check_linker_need_libatomic
2022-03-08T11:27:46.4967548Z           cpp_test = subprocess.Popen([cxx, '-x', 'c++', '-std=c++11', '-'],
2022-03-08T11:27:46.4968062Z         File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
2022-03-08T11:27:46.4968555Z           self._execute_child(args, executable, preexec_fn, close_fds,
2022-03-08T11:27:46.4969072Z         File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
2022-03-08T11:27:46.4969578Z           raise child_exception_type(errno_num, err_msg, err_filename)
2022-03-08T11:27:46.4970264Z       FileNotFoundError: [Errno 2] No such file or directory: 'c++'
2022-03-08T11:27:46.4970671Z       [end of output]
2022-03-08T11:27:46.4970940Z   
2022-03-08T11:27:46.4971351Z   note: This error originates from a subprocess, and is likely not a problem with pip.
2022-03-08T11:27:46.4972008Z error: metadata-generation-failed
2022-03-08T11:27:46.4972189Z 
2022-03-08T11:27:46.4972951Z × Encountered error while generating package metadata.
2022-03-08T11:27:46.4973503Z ╰─> See above for output.

@mlok-nokia
Copy link
Contributor Author

mlok-nokia commented Mar 9, 2022

@mlok-nokia , do you know how to support to install grpcio in armhf?

/# uname -m armv8l

2022-03-08T11:27:46.4951787Z Collecting grpcio==1.39.0
2022-03-08T11:27:46.4952884Z   Downloading grpcio-1.39.0.tar.gz (21.3 MB)
2022-03-08T11:27:46.4953551Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 21.3/21.3 MB 33.8 MB/s eta 0:00:00
2022-03-08T11:27:46.4953995Z   Preparing metadata (setup.py): started
2022-03-08T11:27:46.4954617Z   Preparing metadata (setup.py): finished with status 'error'
2022-03-08T11:27:46.4955235Z   error: subprocess-exited-with-error
2022-03-08T11:27:46.4955564Z   
2022-03-08T11:27:46.4956066Z   × python setup.py egg_info did not run successfully.
2022-03-08T11:27:46.4956601Z   │ exit code: 1
2022-03-08T11:27:46.4963191Z   ╰─> [12 lines of output]
2022-03-08T11:27:46.4963614Z       Traceback (most recent call last):
2022-03-08T11:27:46.4963995Z         File "<string>", line 2, in <module>
2022-03-08T11:27:46.4964573Z         File "<pip-setuptools-caller>", line 34, in <module>
2022-03-08T11:27:46.4965359Z         File "/tmp/pip-install-cylmaawx/grpcio_633d44a4a5d345fbaaab0951bf1d9d3f/setup.py", line 257, in <module>
2022-03-08T11:27:46.4965900Z           if check_linker_need_libatomic():
2022-03-08T11:27:46.4966699Z         File "/tmp/pip-install-cylmaawx/grpcio_633d44a4a5d345fbaaab0951bf1d9d3f/setup.py", line 204, in check_linker_need_libatomic
2022-03-08T11:27:46.4967548Z           cpp_test = subprocess.Popen([cxx, '-x', 'c++', '-std=c++11', '-'],
2022-03-08T11:27:46.4968062Z         File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
2022-03-08T11:27:46.4968555Z           self._execute_child(args, executable, preexec_fn, close_fds,
2022-03-08T11:27:46.4969072Z         File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
2022-03-08T11:27:46.4969578Z           raise child_exception_type(errno_num, err_msg, err_filename)
2022-03-08T11:27:46.4970264Z       FileNotFoundError: [Errno 2] No such file or directory: 'c++'
2022-03-08T11:27:46.4970671Z       [end of output]
2022-03-08T11:27:46.4970940Z   
2022-03-08T11:27:46.4971351Z   note: This error originates from a subprocess, and is likely not a problem with pip.
2022-03-08T11:27:46.4972008Z error: metadata-generation-failed
2022-03-08T11:27:46.4972189Z 
2022-03-08T11:27:46.4972951Z × Encountered error while generating package metadata.
2022-03-08T11:27:46.4973503Z ╰─> See above for output.

Hi xumia, This grpc installation is introduced for the amd64 image build. Other platform_arch build may not need it. Please try the following. It should address this build issue.

Modify the the docker/docker-platform-monitor/Dockerfile.j2.

{% if CONFIGURED_ARCH == "amd64" %}
RUN pip3 install grpcio==1.39.0
grpcio-tools==1.39.0
{%- endif %}

@xumia xumia mentioned this pull request Mar 11, 2022
6 tasks
yxieca pushed a commit that referenced this pull request Apr 8, 2022
…7250E 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.
yxieca pushed a commit that referenced this pull request Apr 11, 2022
…7250E 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.
@mlok-nokia mlok-nokia deleted the build_grpclib branch April 16, 2022 17:06
yxieca pushed a commit that referenced this pull request Apr 29, 2022
…7250E 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.
yxieca pushed a commit that referenced this pull request May 27, 2022
…7250E 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.
yxieca pushed a commit that referenced this pull request May 31, 2022
…7250E 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chassis 🤖 Modular chassis support Platform: Nokia
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants