Skip to content

Commit

Permalink
Install libyang in azure pipeline. (sonic-net#1124)
Browse files Browse the repository at this point in the history
#### Why I did it
sonic-swss-common lib will add depency to libyang soon, so need install libyang lib to prevent build and UT break.

#### How I did it
Modify azure pipeline to install libyang in azure pipeline steps.

#### How to verify it
Pass all UT.

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

#### Description for the changelog
Modify azure pipeline to install libyang in azure pipeline steps.

#### Link to config_db schema for YANG module changes

#### A picture of a cute animal (not mandatory but encouraged)
  • Loading branch information
liuh-80 authored Sep 13, 2022
1 parent 660a920 commit ce1bf08
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .azure-pipelines/build-swss-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ jobs:
target/debs/${{ parameters.debian_version }}/libnl-genl*.deb
target/debs/${{ parameters.debian_version }}/libnl-route*.deb
target/debs/${{ parameters.debian_version }}/libnl-nf*.deb
target/debs/${{ parameters.debian_version }}/libyang_*.deb
displayName: "Download common libs"

- script: |
set -ex
# install libyang before install libswsscommon
sudo dpkg -i $(find ./download -name libyang_*.deb)
sudo dpkg -i $(find ./download -name *.deb)
rm -rf download || true
workingDirectory: $(Build.ArtifactStagingDirectory)
Expand Down
35 changes: 35 additions & 0 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ parameters:
type: boolean
default: false

- name: debian_version
type: string

jobs:
- job:
displayName: ${{ parameters.arch }}
Expand Down Expand Up @@ -94,6 +97,38 @@ jobs:
sudo service rsyslog start
displayName: "Install dependencies"
- task: DownloadPipelineArtifact@2
# amd64 artifact name does not has arch suffix
condition: eq('${{ parameters.arch }}', 'amd64')
inputs:
source: specific
project: build
pipeline: Azure.sonic-buildimage.common_libs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
artifact: common-lib
patterns: |
target/debs/${{ parameters.debian_version }}/libyang_*.deb
displayName: "Download libyang from amd64 common lib"
- task: DownloadPipelineArtifact@2
condition: ne('${{ parameters.arch }}', 'amd64')
inputs:
source: specific
project: build
pipeline: Azure.sonic-buildimage.common_libs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
artifact: common-lib.${{ parameters.arch }}
patterns: |
target/debs/${{ parameters.debian_version }}/libyang_*.deb
displayName: "Download libyang from common lib"
- script: |
set -ex
sudo dpkg -i $(find ./download -name *.deb)
workingDirectory: $(Build.ArtifactStagingDirectory)
displayName: "Install libyang from common lib"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/test-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
set -ex
sudo sonic-sairedis/.azure-pipelines/build_and_install_module.sh
sudo apt-get install -y libhiredis0.14
sudo apt-get install -y libhiredis0.14 libyang0.16
sudo dpkg -i --force-confask,confnew $(Build.ArtifactStagingDirectory)/download/libswsscommon_1.0.0_amd64.deb || apt-get install -f
sudo dpkg -i $(Build.ArtifactStagingDirectory)/download/python3-swsscommon_1.0.0_amd64.deb
Expand Down
3 changes: 3 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ stages:
syslog_artifact_name: sonic-sairedis.syslog
run_unit_test: true
archive_gcov: true
debian_version: ${{ parameters.debian_version }}

- stage: BuildArm
dependsOn: Build
Expand All @@ -72,6 +73,7 @@ stages:
swss_common_artifact_name: sonic-swss-common.armhf
artifact_name: sonic-sairedis.armhf
syslog_artifact_name: sonic-sairedis.syslog.armhf
debian_version: ${{ parameters.debian_version }}

- template: .azure-pipelines/build-template.yml
parameters:
Expand All @@ -82,6 +84,7 @@ stages:
swss_common_artifact_name: sonic-swss-common.arm64
artifact_name: sonic-sairedis.arm64
syslog_artifact_name: sonic-sairedis.syslog.arm64
debian_version: ${{ parameters.debian_version }}

- stage: BuildSwss
dependsOn: Build
Expand Down

0 comments on commit ce1bf08

Please sign in to comment.