-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add protobuf and dashapi to sonic-mgmt #15743
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,6 +147,27 @@ RUN dpkg -i \ | |
| debs/{{ deb }}{{' '}} | ||
| {%- endfor %} | ||
|
|
||
| # 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 \ | ||
| && wget https://sonicstorage.blob.core.windows.net/public/ubuntu/20.04/libprotobuf-lite32_3.21.12-3_amd64.deb \ | ||
| && wget https://sonicstorage.blob.core.windows.net/public/ubuntu/20.04/libprotobuf32_3.21.12-3_amd64.deb \ | ||
| && wget https://sonicstorage.blob.core.windows.net/public/ubuntu/20.04/libprotoc-dev_3.21.12-3_amd64.deb \ | ||
| && wget https://sonicstorage.blob.core.windows.net/public/ubuntu/20.04/libprotoc32_3.21.12-3_amd64.deb \ | ||
| && wget https://sonicstorage.blob.core.windows.net/public/ubuntu/20.04/protobuf-compiler_3.21.12-3_amd64.deb \ | ||
| && wget https://sonicstorage.blob.core.windows.net/public/ubuntu/20.04/python3-protobuf_3.21.12-3_amd64.deb \ | ||
| && dpkg -i *.deb \ | ||
| && rm -rf /tmp/protobuf | ||
|
|
||
| # 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 \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| && git clone https://github.com/sonic-net/sonic-dash-api.git \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is within the docker, not available.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I created a issue #15848. And ask for solving in future PR. |
||
| && protoc -I=sonic-dash-api/proto --python_out=/usr/lib/python3/dist-packages/dash_api sonic-dash-api/proto/*.proto \ | ||
| && rm -rf /tmp/sonic-dash-api | ||
|
|
||
| RUN mkdir /var/run/sshd | ||
| EXPOSE 22 | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
It is also used in FROM in the beginning of the file. Will dpkg fail if we upgrade the FROM line to new version? #Pending
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.