Skip to content

Commit

Permalink
Merge branch 'master' into v6erspan
Browse files Browse the repository at this point in the history
  • Loading branch information
prsunny authored Oct 2, 2024
2 parents 05a5c98 + 3c230d2 commit e93819c
Show file tree
Hide file tree
Showing 467 changed files with 85,456 additions and 12,687 deletions.
3 changes: 3 additions & 0 deletions .artifactignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
**/*
!*.deb
!coverage.info
!coverage.xml
!build.info
118 changes: 100 additions & 18 deletions .azure-pipelines/build-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,55 @@ parameters:
- name: swss_artifact_name
type: string

- name: sairedis_artifact_name
- name: swss_common_artifact_name
type: string

- name: swss_common_artifact_name
- name: swss_common_branch
type: string
default: '$(BUILD_BRANCH)'

- name: artifact_name
type: string

- name: buildimage_artifact_name
type: string
default: 'sonic-buildimage.vs'

- name: buildimage_artifact_project
type: string
default: 'build'

- name: buildimage_artifact_pipeline
type: string
default: 'Azure.sonic-buildimage.official.vs'

- name: buildimage_artifact_branch
type: string
default: '$(BUILD_BRANCH)'

- name: sairedis_artifact_name
type: string

- name: sairedis_artifact_project
type: string
default: 'build'

- name: sairedis_artifact_pipeline
type: string
default: 'Azure.sonic-sairedis'

- name: sairedis_artifact_branch
type: string
default: '$(BUILD_BRANCH)'

- name: sairedis_artifact_pattern
type: string
default: '**'

- name: asan
type: boolean
default: false

jobs:
- job:
displayName: ${{ parameters.arch }}
Expand All @@ -36,50 +76,92 @@ 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/${{ parameters.swss_common_branch }}'
path: $(Build.ArtifactStagingDirectory)/download
displayName: "Download sonic swss common deb packages"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 12
project: ${{ parameters.sairedis_artifact_project }}
pipeline: ${{ parameters.sairedis_artifact_pipeline }}
artifact: ${{ parameters.sairedis_artifact_name }}
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
runBranch: 'refs/heads/${{ parameters.sairedis_artifact_branch }}'
allowPartiallySucceededBuilds: true
path: $(Build.ArtifactStagingDirectory)/download/sairedis
patterns: |
${{ parameters.sairedis_artifact_pattern }}/libsaivs_*.deb
${{ parameters.sairedis_artifact_pattern }}/libsaivs-dev_*.deb
${{ parameters.sairedis_artifact_pattern }}/libsairedis_*.deb
${{ parameters.sairedis_artifact_pattern }}/libsairedis-dev_*.deb
${{ parameters.sairedis_artifact_pattern }}/libsaimetadata_*.deb
${{ parameters.sairedis_artifact_pattern }}/libsaimetadata-dev_*.deb
${{ parameters.sairedis_artifact_pattern }}/syncd-vs_*.deb
displayName: "Download sonic sairedis deb packages"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: sonic-net.sonic-dash-api
${{ if eq(parameters.arch, 'amd64') }}:
artifact: sonic-dash-api
${{ else }}:
artifact: sonic-dash-api.${{ parameters.arch }}
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
patterns: |
libdashapi*.deb
displayName: "Download dash api"
- 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
artifact: sonic-buildimage.vs
project: ${{ parameters.buildimage_artifact_project }}
pipeline: ${{ parameters.buildimage_artifact_pipeline }}
artifact: ${{ parameters.buildimage_artifact_name }}
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic buildimage"
runBranch: 'refs/heads/${{ parameters.buildimage_artifact_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
find $(Build.ArtifactStagingDirectory)/download/sairedis -name '*.deb' -exec cp "{}" .azure-pipelines/docker-sonic-vs/debs \;
cp -v $(Build.ArtifactStagingDirectory)/download/*.deb .azure-pipelines/docker-sonic-vs/debs
if [ -f $(Build.ArtifactStagingDirectory)/download/coverage.info ]; then
cp -v $(Build.ArtifactStagingDirectory)/download/coverage.info $(Build.ArtifactStagingDirectory)/
cp -v $(Build.ArtifactStagingDirectory)/download/coverage.xml $(Build.ArtifactStagingDirectory)/
fi
pushd .azure-pipelines
docker build --no-cache -t docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) docker-sonic-vs
build_dir=$(grep BUILD_DIR $(Build.ArtifactStagingDirectory)/download/build.info | cut -d= -f2)
build_args="--build-arg build_dir=$build_dir"
if [ '${{ parameters.asan }}' == True ]; then
build_args="$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"
Loading

0 comments on commit e93819c

Please sign in to comment.