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

Bookworm migration for all dependency packages in azurepipeline for sonic-gnmi #216

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ endif
sudo CGO_LDFLAGS="$(CGO_LDFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" $(GO) test -race -coverprofile=coverage-data.txt -covermode=atomic -mod=vendor -v github.com/sonic-net/sonic-gnmi/sonic_data_client
sudo CGO_LDFLAGS="$(CGO_LDFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" $(GO) test -race -coverprofile=coverage-dbus.txt -covermode=atomic -mod=vendor -v github.com/sonic-net/sonic-gnmi/sonic_service_client
sudo CGO_LDFLAGS="$(CGO_LDFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" $(TESTENV) $(GO) test -race -coverprofile=coverage-translutils.txt -covermode=atomic -mod=vendor -v github.com/sonic-net/sonic-gnmi/transl_utils
$(GO) get github.com/axw/gocov/...
$(GO) get github.com/AlekSi/gocov-xml
$(GO) install github.com/axw/gocov/gocov@latest
$(GO) install github.com/AlekSi/gocov-xml@latest
$(GO) mod vendor
gocov convert coverage-*.txt | gocov-xml -source $(shell pwd) > coverage.xml
rm -rf coverage-*.txt
Expand Down
46 changes: 18 additions & 28 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ stages:
DIFF_COVER_WORKING_DIRECTORY: $(System.DefaultWorkingDirectory)/sonic-gnmi

container:
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-bullseye:latest
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-bookworm:latest

steps:
- checkout: self
Expand All @@ -80,10 +80,12 @@ stages:
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
patterns: |
target/debs/bullseye/libyang*.deb
target/debs/bullseye/libnl*.deb
target/python-wheels/bullseye/sonic_yang_models*.whl
displayName: "Download bullseye debs"
target/debs/bookworm/libyang*.deb
target/debs/bookworm/libnl*.deb
target/debs/bookworm/libswsscommon*.deb
target/debs/bookworm/python3-swsscommon*.deb
target/python-wheels/bookworm/sonic_yang_models*.whl
displayName: "Download bookworm debs"

- script: |
# PYTEST
Expand All @@ -98,50 +100,38 @@ stages:
sudo service redis-server start

# LIBYANG
sudo dpkg -i ../target/debs/bullseye/libyang*1.0.73*.deb
sudo dpkg -i ../target/debs/bookworm/libyang*1.0.73*.deb
displayName: "Install dependency"

- script: |
# SONIC YANGS
set -ex
sudo pip3 install ../target/python-wheels/bullseye/sonic_yang_models-1.0-py3-none-any.whl
sudo pip3 install ../target/python-wheels/bookworm/sonic_yang_models-1.0-py3-none-any.whl
displayName: "Install sonic yangs"

- script: |
# LIBSWSSCOMMON
sudo apt-get -y purge libnl-3-dev libnl-route-3-dev
sudo dpkg -i ../target/debs/bullseye/libnl-3-200_*.deb
sudo dpkg -i ../target/debs/bullseye/libnl-genl-3-200_*.deb
sudo dpkg -i ../target/debs/bullseye/libnl-route-3-200_*.deb
sudo dpkg -i ../target/debs/bullseye/libnl-nf-3-200_*.deb
sudo dpkg -i ../target/debs/bookworm/libnl-3-200_*.deb
sudo dpkg -i ../target/debs/bookworm/libnl-genl-3-200_*.deb
sudo dpkg -i ../target/debs/bookworm/libnl-route-3-200_*.deb
sudo dpkg -i ../target/debs/bookworm/libnl-nf-3-200_*.deb
displayName: "Install libswsscommon dependencies"

- script: |
set -ex
# Install .NET CORE
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/debian/11/prod
sudo apt-add-repository https://packages.microsoft.com/debian/12/prod
sudo apt-get update
sudo apt-get install -y dotnet-sdk-5.0
sudo apt-get install -y dotnet-sdk-7.0
displayName: "Install .NET CORE"

- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: Azure.sonic-swss-common
artifact: sonic-swss-common
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
displayName: "Download sonic-swss-common"

- script: |
set -ex
# LIBSWSSCOMMON
sudo dpkg -i libswsscommon_1.0.0_amd64.deb
sudo dpkg -i libswsscommon-dev_1.0.0_amd64.deb
sudo dpkg -i python3-swsscommon_1.0.0_amd64.deb
workingDirectory: $(Pipeline.Workspace)/
sudo dpkg -i ../target/debs/bookworm/libswsscommon_1.0.0_amd64.deb
sudo dpkg -i ../target/debs/bookworm/libswsscommon-dev_1.0.0_amd64.deb
sudo dpkg -i ../target/debs/bookworm/python3-swsscommon_1.0.0_amd64.deb
displayName: 'Install libswsscommon package'

- script: |
Expand Down
24 changes: 20 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/sonic-net/sonic-gnmi

go 1.15
go 1.19
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a concept of FIPS enabled build in sonic community and that build still uses go1.15. See https://github.com/sonic-net/sonic-buildimage/blob/master/sonic-slave-bookworm/Dockerfile.j2#L478. This change will break FIPS builds. I am not sure how to trigger one; but you can try setting INCLUDE_FIPS=y in rules/config file.

hi @qiluo-msft -- can you confirm whether INCLUDE_FIPS setting is being used by MSFT or someone? Bookworm slave docker installs go1.15 when INCLUDE_FIPS=y and go1.19 otherwise. This will break compilation of INCLUDE_FIPS =y builds if we use go1.19 specific libraries/syntax in the code -- and it won't be caught during PR sanity runs. The slave docker must always stick to one go version. I had brought it up in the UMF WG meeting earlier but looks like there was no further updates. It would be great if you can clarify why two versions are being used and confirm if it is okay to ignore go1.15.

Copy link
Contributor Author

@ranjinidn ranjinidn Apr 19, 2024

Choose a reason for hiding this comment

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

The go version for bookworm build is already upgraded to 1.19.
One of the most notable changes in Go 1.19 is the addition of support for FIPS 140-3.
Hence it makes sense to go ahead and use go 1.19 for FIPS as well.

@sachinholla We think we can keep the bookworm migration for sonic-gnmi apart from the FIPS migration to go1.19 separate. Support for FIPS is disabled in bookworm build currently. Hence we can go ahead with these changes.

@xumia, we see that the FIPS support was introduced by you in bullseye. (sonic-net/sonic-buildimage@8ec8900)
Can you please take care of upgrading the FIPS to go1.19 as part of bookworm migration?
We see some documentation about setting the environment variable GOEXPERIMENT=boringcrypto. This will cause the Go compiler to use BoringCrypto, a FIPS 140-3 validated cryptographic module.

Copy link
Contributor

Choose a reason for hiding this comment

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

We think we can keep the bookworm migration for sonic-gnmi apart from the FIPS migration to go1.19 separate. Support for FIPS is disabled in bookworm build currently

Ok.. hopefully FIPS team too will upgrade to go1.19 and not revert this PR :)

Copy link
Contributor

Choose a reason for hiding this comment

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

The SONiC FIPS support for Bookworm appears to be in sonic-net/sonic-buildimage#18088, this looks like it'll provide a FIPS-enabled go1.19 package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@saiarcot895 Since the FIPS build is disabled for bookworm by default, can we merge this without waiting for the PR #18088 to be merged ?
Merging this gnmi PR will also make sure the sonic-gnmi repo is already migrated to go1.19 before the #18088 merges.
Also this is a dependency for sonic-net/sonic-buildimage#18548.


require (
github.com/Azure/sonic-mgmt-common v0.0.0-00010101000000-000000000000
Expand All @@ -19,19 +19,35 @@ require (
github.com/jipanyang/gnxi v0.0.0-20181221084354-f0a90cca6fd0
github.com/kylelemons/godebug v1.1.0
github.com/msteinert/pam v0.0.0-20201130170657-e61372126161
github.com/onsi/ginkgo v1.10.3 // indirect
github.com/onsi/gomega v1.7.1 // indirect
github.com/openconfig/gnmi v0.0.0-20200617225440-d2b4e6a45802
github.com/openconfig/gnoi v0.0.0-20201210212451-209899112bb7
github.com/openconfig/ygot v0.7.1
github.com/stretchr/testify v1.4.0 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
google.golang.org/grpc v1.33.2
google.golang.org/protobuf v1.25.0
gopkg.in/yaml.v2 v2.2.8
)

require (
github.com/antchfx/jsonquery v1.1.4 // indirect
github.com/antchfx/xmlquery v1.3.1 // indirect
github.com/antchfx/xpath v1.1.10 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/cenkalti/backoff/v4 v4.0.0 // indirect
github.com/go-redis/redis/v7 v7.0.0-beta.3.0.20190824101152-d19aba07b476 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/google/go-cmp v0.5.0 // indirect
github.com/maruel/natural v1.1.1 // indirect
github.com/onsi/ginkgo v1.10.3 // indirect
github.com/onsi/gomega v1.7.1 // indirect
github.com/openconfig/goyang v0.0.0-20200309174518-a00bece872fc // indirect
github.com/philopon/go-toposort v0.0.0-20170620085441-9be86dbd762f // indirect
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac // indirect
golang.org/x/text v0.3.3 // indirect
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
)

replace github.com/Azure/sonic-mgmt-common => ../sonic-mgmt-common

replace github.com/openconfig/gnoi => github.com/openconfig/gnoi v0.0.0-20201210212451-209899112bb7
Loading
Loading