From e25e92fe59cfab2e3bfb10a6610b4ac0abeddc28 Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Fri, 23 Sep 2022 18:37:55 +0800 Subject: [PATCH] Add pipeline yml for nvidia-bluefield (#90) Why I did it Setup a build pipeline to build the image on the daily basis, and PR will also trigger build pipeline. How I did it Add new pipeline.yml for nvidia-sonic repo. Build pipeline only supports sonic-nvidia-bluefield.bin for now, and I will add support for sonic-nvidia-bluefield.tar.gz and sonic-nvidia-bluefield.bfb. How to verify it I have verified with my private repo. And when this PR is merged, I will create azure pipeline to make it work. --- .azure-pipelines/azure-pipelines-build.yml | 7 +++ .../azure-pipelines-repd-build-variables.yml | 7 +-- .azure-pipelines/build-template.yml | 2 + azure-pipelines-bluefield.yml | 63 +++++++++++++++++++ 4 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 azure-pipelines-bluefield.yml diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml index e8e74e8d1882..2f7e3727c59c 100644 --- a/.azure-pipelines/azure-pipelines-build.yml +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -79,6 +79,13 @@ jobs: variables: PLATFORM_ARCH: arm64 + - name: nvidia-bluefield + ${{ if not(parameters.qemuOrCrossBuild) }}: + pool: sonicbld-arm64 + timeoutInMinutes: 2880 + variables: + PLATFORM_ARCH: arm64 + - name: generic variables: dbg_image: yes diff --git a/.azure-pipelines/azure-pipelines-repd-build-variables.yml b/.azure-pipelines/azure-pipelines-repd-build-variables.yml index af77e97e2ff0..63b963aaabd3 100644 --- a/.azure-pipelines/azure-pipelines-repd-build-variables.yml +++ b/.azure-pipelines/azure-pipelines-repd-build-variables.yml @@ -1,7 +1,2 @@ variables: - ${{ if eq(variables['Build.Reason'],'PullRequest') }}: - VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=$([[ "$(System.PullRequest.TargetBranch)" =~ ^20[2-9][0-9]{3}$ ]] && echo deb,py2,py3,web,git,docker)' - ${{ elseif ne(variables['Build.SourceBranchName'],'master') }}: - VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker' - ${{ else }}: - VERSION_CONTROL_OPTIONS: '' + VERSION_CONTROL_OPTIONS: '' diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index 2665f46452c7..02d5854f068c 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -4,6 +4,7 @@ parameters: values: - broadcom - centec-arm64 + - nvidia-bluefield - marvell-armhf - mellanox - vs @@ -21,6 +22,7 @@ parameters: values: - brcm - centec-arm64 + - nvidia-bluefield - marvell-armhf - mlnx - vs diff --git a/azure-pipelines-bluefield.yml b/azure-pipelines-bluefield.yml new file mode 100644 index 000000000000..dc866015b4db --- /dev/null +++ b/azure-pipelines-bluefield.yml @@ -0,0 +1,63 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +schedules: +- cron: "0 8 * * *" + displayName: Daily midnight build + branches: + include: + - bluefield + always: true + +trigger: none + +pr: + branches: + include: + - bluefield + paths: + exclude: + - .github + +name: $(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) + +resources: + repositories: + - repository: buildimage + type: github + name: nvidia-sonic/sonic-buildimage + endpoint: nvidia-sonic + ref: bluefield + +variables: +- template: .azure-pipelines/azure-pipelines-repd-build-variables.yml@buildimage +- template: .azure-pipelines/template-variables.yml@buildimage +- name: CACHE_MODE + value: rcache +- name: ENABLE_FIPS + value: y + +stages: +- stage: Build + dependsOn: [] + jobs: + - template: .azure-pipelines/azure-pipelines-build.yml + parameters: + buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}' + preSteps: + - task: InstallSSHKey@0 + displayName: 'Install an SSH key' + inputs: + knownHostsEntry: '$(myHostsEntry)' + sshPublicKey: '$(myPubKey)' + sshKeySecureFile: 'id_rsa' + jobGroups: + - name: nvidia-bluefield + pool: sonicbld-arm64 + timeoutInMinutes: 2880 + variables: + PLATFORM_ARCH: arm64 + +