Skip to content

Commit

Permalink
Merge branch 'master' into sag-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
superchild authored Feb 13, 2023
2 parents b708ae4 + 4df5cab commit 4d092b2
Show file tree
Hide file tree
Showing 317 changed files with 39,768 additions and 6,758 deletions.
42 changes: 29 additions & 13 deletions .azure-pipelines/build-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ parameters:
- name: artifact_name
type: string

- name: asan
type: boolean
default: false

jobs:
- job:
displayName: ${{ parameters.arch }}
Expand All @@ -36,50 +40,62 @@ jobs:
inputs:
source: specific
project: build
pipeline: 9
pipeline: Azure.sonic-swss-common
artifact: ${{ parameters.swss_common_artifact_name }}
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
displayName: "Download sonic swss common deb packages"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 12
pipeline: Azure.sonic-sairedis
artifact: ${{ parameters.sairedis_artifact_name }}
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
displayName: "Download sonic sairedis deb packages"
- task: DownloadPipelineArtifact@2
inputs:
artifact: ${{ parameters.swss_artifact_name }}
displayName: "Download sonic swss artifact"
path: $(Build.ArtifactStagingDirectory)/download
displayName: "Download pre-stage built ${{ parameters.swss_artifact_name }}"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 1
pipeline: Azure.sonic-buildimage.official.vs
artifact: sonic-buildimage.vs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic buildimage"
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
patterns: '**/target/${{ parameters.artifact_name }}.gz'
displayName: "Download sonic-buildimage ${{ parameters.artifact_name }}"
- script: |
set -ex
echo $(Build.DefinitionName).$(Build.BuildNumber)
docker load < ../target/docker-sonic-vs.gz
docker load < $(Build.ArtifactStagingDirectory)/download/target/${{ parameters.artifact_name }}.gz
mkdir -p .azure-pipelines/docker-sonic-vs/debs
cp -v ../*.deb .azure-pipelines/docker-sonic-vs/debs
cp -v $(Build.ArtifactStagingDirectory)/download/*.deb .azure-pipelines/docker-sonic-vs/debs
pushd .azure-pipelines
docker build --no-cache -t docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) docker-sonic-vs
build_args=""
if [ '${{ parameters.asan }}' == True ]; then
build_args="--build-arg need_dbg=y"
fi
popd
docker build $build_args --no-cache -t docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber).asan-${{ parameters.asan }} docker-sonic-vs
docker save docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) | gzip -c > $(Build.ArtifactStagingDirectory)/docker-sonic-vs.gz
popd
docker save docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber).asan-${{ parameters.asan }} | gzip -c > $(Build.ArtifactStagingDirectory)/docker-sonic-vs.gz
rm -rf $(Build.ArtifactStagingDirectory)/download
displayName: "Build ${{ parameters.artifact_name }}"
- publish: $(Build.ArtifactStagingDirectory)/
artifact: ${{ parameters.artifact_name }}
displayName: "Archive sonic docker vs image"
111 changes: 51 additions & 60 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ parameters:
- name: sonic_slave
type: string

- name: buildimage_artifact_name
type: string

- name: buildimage_pipeline
type: number

- name: sairedis_artifact_name
type: string

Expand All @@ -46,6 +40,13 @@ parameters:
type: boolean
default: false

- name: common_lib_artifact_name
type: string

- name: asan
type: boolean
default: false

jobs:
- job:
displayName: ${{ parameters.arch }}
Expand All @@ -54,7 +55,7 @@ jobs:
pool:
${{ if ne(parameters.pool, 'default') }}:
name: ${{ parameters.pool }}
${{ if eq(parameters.pool, 'default') }}:
${{ else }}:
vmImage: 'ubuntu-20.04'

container:
Expand All @@ -79,82 +80,72 @@ jobs:
inputs:
source: specific
project: build
pipeline: 9
pipeline: Azure.sonic-swss-common
artifact: ${{ parameters.swss_common_artifact_name }}
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
path: '$(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }}'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
patterns: |
libswsscommon_1.0.0_${{ parameters.arch }}.deb
libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb
displayName: "Download sonic swss common deb packages"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 12
pipeline: Azure.sonic-sairedis
artifact: ${{ parameters.sairedis_artifact_name }}
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
path: '$(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }}'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
patterns: |
libsaivs_*.deb
libsaivs-dev_*.deb
libsairedis_*.deb
libsairedis-dev_*.deb
libsaimetadata_*.deb
libsaimetadata-dev_*.deb
syncd-vs_*.deb
displayName: "Download sonic sairedis deb packages"
- task: DownloadPipelineArtifact@2
${{ if eq(parameters.buildimage_pipeline, 141) }}:
continueOnError: True
inputs:
source: specific
project: build
pipeline: ${{ parameters.buildimage_pipeline }}
artifact: ${{ parameters.buildimage_artifact_name }}
pipeline: Azure.sonic-buildimage.common_libs
artifact: ${{ parameters.common_lib_artifact_name }}
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
path: '$(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}'
displayName: "Download sonic buildimage deb packages"
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
patterns: |
target/debs/buster/libnl-3-200_*.deb
target/debs/buster/libnl-3-dev_*.deb
target/debs/buster/libnl-genl-3-200_*.deb
target/debs/buster/libnl-genl-3-dev_*.deb
target/debs/buster/libnl-route-3-200_*.deb
target/debs/buster/libnl-route-3-dev_*.deb
target/debs/buster/libnl-nf-3-200_*.deb
target/debs/buster/libnl-nf-3-dev_*.deb
target/debs/buster/libyang_*.deb
displayName: "Download common libs"
- script: |
buildimage_artifact_downloaded=n
[ -d "$(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}/target" ] && buildimage_artifact_downloaded=y
echo "buildimage_artifact_downloaded=$buildimage_artifact_downloaded"
echo "##vso[task.setvariable variable=buildimage_artifact_downloaded]$buildimage_artifact_downloaded"
condition: eq(${{ parameters.buildimage_pipeline }}, 141)
displayName: "Check if sonic buildimage deb packages downloaded"
- task: DownloadPipelineArtifact@2
condition: and(eq(variables.buildimage_artifact_downloaded, 'n'), eq(${{ parameters.buildimage_pipeline }}, 141))
inputs:
source: specific
project: build
pipeline: ${{ parameters.buildimage_pipeline }}
artifact: 'sonic-buildimage.marvell-armhf1'
runVersion: specific
runId: 80637
path: '$(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}'
displayName: "Download sonic buildimage deb packages from 80637"
- script: |
cd $(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}
sudo dpkg -i target/debs/buster/libnl-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-3-dev_*.deb
sudo dpkg -i target/debs/buster/libnl-genl-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-genl-3-dev_*.deb
sudo dpkg -i target/debs/buster/libnl-route-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-route-3-dev_*.deb
sudo dpkg -i target/debs/buster/libnl-nf-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-nf-3-dev_*.deb
cd $(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }}
sudo dpkg -i libswsscommon_1.0.0_${{ parameters.arch }}.deb
sudo dpkg -i libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb
cd $(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }}
sudo dpkg -i libsaivs_*.deb
sudo dpkg -i libsaivs-dev_*.deb
sudo dpkg -i libsairedis_*.deb
sudo dpkg -i libsairedis-dev_*.deb
sudo dpkg -i libsaimetadata_*.deb
sudo dpkg -i libsaimetadata-dev_*.deb
sudo dpkg -i syncd-vs_*.deb
workingDirectory: $(Pipeline.Workspace)
set -ex
cd download
sudo dpkg -i $(find target/debs/buster -type f)
sudo dpkg -i $(ls *.deb)
cd ..
rm -rf download
workingDirectory: $(Build.ArtifactStagingDirectory)
displayName: "Install libnl3, sonic swss common and sairedis"
- script: |
set -x
set -ex
tar czf pytest.tgz tests
cp -r pytest.tgz $(Build.ArtifactStagingDirectory)/
if [ '${{ parameters.archive_gcov }}' == True ]; then
export ENABLE_GCOV=y
fi
if [ '${{ parameters.asan }}' == True ]; then
export ENABLE_ASAN=y
fi
./autogen.sh
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
displayName: "Compile sonic swss"
Expand Down
12 changes: 4 additions & 8 deletions .azure-pipelines/docker-sonic-vs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
FROM docker-sonic-vs

ARG docker_container_name
ARG need_dbg

ADD ["debs", "/debs"]

RUN dpkg --purge python-swsscommon
RUN dpkg --purge python3-swsscommon
RUN dpkg --purge swss
RUN dpkg --purge libsairedis
RUN dpkg --purge libswsscommon
RUN dpkg --purge libsaimetadata
RUN dpkg --purge libsaivs
RUN dpkg --purge syncd-vs
RUN dpkg --purge python-swsscommon python3-swsscommon swss libsairedis sonic-db-cli libswsscommon libsaimetadata libsaivs syncd-vs

RUN dpkg -i /debs/libswsscommon_1.0.0_amd64.deb
RUN dpkg -i /debs/python-swsscommon_1.0.0_amd64.deb
RUN dpkg -i /debs/python3-swsscommon_1.0.0_amd64.deb
RUN dpkg -i /debs/sonic-db-cli_1.0.0_amd64.deb

RUN dpkg -i /debs/libsaimetadata_1.0.0_amd64.deb
RUN dpkg -i /debs/libsairedis_1.0.0_amd64.deb
Expand All @@ -24,6 +19,7 @@ RUN dpkg -i /debs/syncd-vs_1.0.0_amd64.deb

RUN dpkg --purge swss
RUN dpkg -i /debs/swss_1.0.0_amd64.deb
RUN if [ "$need_dbg" = "y" ] ; then dpkg -i /debs/swss-dbg_1.0.0_amd64.deb ; fi

RUN apt-get update

Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/gcov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ parameters:

- name: timeout
type: number
default: 180
default: 240

- name: sonic_slave
type: string
Expand Down
Loading

0 comments on commit 4d092b2

Please sign in to comment.