-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add protobuf and dashapi to sonic-mgmt #15743
Conversation
Signed-off-by: Ze Gan <ganze718@gmail.com>
i think the software should be installed in docker-ptf not docker-mgmt |
where do we plan to run the sonic-mgmt pytest? is it running from sonic-mgmt or is it from docker-ptf? |
can you use docker_sonic_mgmt_debs, so that people if they want to build locally, they can still build it without depending on azp? |
All protobuf and dash payloads are for control plane which is loaded in sonic-mgmt, docker-ptf is only used for packet-gen of dataplane. So, To insteall protobuf and dash in sonic-mgmt is reasonable. |
I tried it before. But the docker of sonic-mgmt is based on ubuntu20.04 instead of debian bullseye, There are some differences on dependencies. But in the future, when the sonic-mgmt is upgraded to ubuntu22.04, I believe we can directly install them from |
Let's just build and install in sonic-mgmt container? |
1 similar comment
Let's just build and install in sonic-mgmt container? |
78eeecc
to
18770b1
Compare
/azp run |
No commit pushedDate could be found for PR 15743 in repo sonic-net/sonic-buildimage |
Signed-off-by: Ze Gan <ganze718@gmail.com>
This reverts commit 0d415b6.
Signed-off-by: Ze Gan <ganze718@gmail.com>
# Install protobuf 3.21.12 | ||
RUN mkdir -p /tmp/protobuf \ | ||
cd /tmp/protobuf \ | ||
&& wget https://sonicstorage.blob.core.windows.net/public/ubuntu/20.04/libprotobuf-dev_3.21.12-3_amd64.deb \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These packets are compiled in ubuntu20.04. Actually, a better method is to install these packets from bullseye slave by sonic_mgmt_debs variable, but due to bullseye and ubuntu dependencies issues, like python 3.8 and python 3.9, we have to install a pre-compiled version.
If we upgrade this docker to a new version, like ubuntu22.04, we can follow the typical method to build this docker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider 20.04 as a named constant.
# Install dash-api | ||
RUN cd /tmp \ | ||
&& mkdir -p /usr/lib/python3/dist-packages/dash_api \ | ||
&& wget https://raw.githubusercontent.com/sonic-net/sonic-buildimage/master/src/sonic-dash-api/pypkg/__init__.py -O /usr/lib/python3/dist-packages/dash_api/__init__.py \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUN cd /tmp \ | ||
&& mkdir -p /usr/lib/python3/dist-packages/dash_api \ | ||
&& wget https://raw.githubusercontent.com/sonic-net/sonic-buildimage/master/src/sonic-dash-api/pypkg/__init__.py -O /usr/lib/python3/dist-packages/dash_api/__init__.py \ | ||
&& git clone https://github.com/sonic-net/sonic-dash-api.git \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is within the docker, not available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to worry if this code on a release branch, but it actually wget/git clone some master files? For example, when branch out 202311, this dockerfile will pull master code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- If we want to access the files in src, we have to mount the src folder to Docker build workspace. But the files in src may be too many(More than 30GB) for Docker daemon which will dramatically downgrade the performance of Docker daemon.
- After the sonic-mgmt upgrade to 20.04, I believe we can follow the typical method, docker_mgmt_debs, to install them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explore # 1: you do not need to mount src folder, just copy what you need to Docker build workspace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under the current framework, I didn't find a script to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a issue #15848. And ask for solving in future PR.
Signed-off-by: Ze Gan <ganze718@gmail.com>
#### Why I did it The testcases in sonic-mgmt need the packages of protobuf and dashapi ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it Because the docker of sonic-mgmt is based on ubuntu20.04, it cannot directly install the packages compiled by slave due to dependency issues. Download related packaged directly from Azp. #### How to verify it Check azp stats.
Why I did it
The testcases in sonic-mgmt need the packages of protobuf and dashapi
Work item tracking
How I did it
Because the docker of sonic-mgmt is based on ubuntu20.04, it cannot directly install the packages compiled by slave due to dependency issues. Download related packaged directly from Azp.
How to verify it
Check azp stats.
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)