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

[Ci]: Support retryCountOnTaskFailure in job steps #10520

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions .azure-pipelines/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ jobs:
timeoutInMinutes: 2880
variables:
PLATFORM_ARCH: arm64
stepProperties:
retryCountOnTaskFailure: 2


- name: generic
variables:
Expand All @@ -83,6 +86,8 @@ jobs:
timeoutInMinutes: 2880
variables:
PLATFORM_ARCH: armhf
stepProperties:
retryCountOnTaskFailure: 2

- name: mellanox
variables:
Expand Down Expand Up @@ -131,5 +136,6 @@ jobs:
fi
make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).bin
fi
retryCountOnTaskFailure: 0
displayName: "Build sonic image"
- template: check-dirty-version.yml
2 changes: 2 additions & 0 deletions .azure-pipelines/azure-pipelines-image-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
displayName: "Set cache options"
- checkout: self
submodules: recursive
retryCountOnTaskFailure: 1
condition: eq(variables.SKIP_CHECKOUT, '')
displayName: 'Checkout code'
- script: |
Expand All @@ -46,6 +47,7 @@ jobs:
sudo apt-get install -y acl
sudo bash -c "echo 1 > /proc/sys/vm/compact_memory"
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure
retryCountOnTaskFailure: 0
displayName: 'Make configure'
postSteps:
- script: cp target -r $(Build.ArtifactStagingDirectory)/
Expand Down
31 changes: 18 additions & 13 deletions .azure-pipelines/azure-pipelines-job-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- ${{ if or(eq(parameters.jobFilters, ''), containsValue(parameters.jobFilters, jobGroup.name), endswith(variables['Build.DefinitionName'], format('.{0}{1}', jobGroup.name, jobGroup.extName))) }}:
- job: ${{ replace(format('{0}{1}', jobGroup.name, jobGroup.extName), '-', '_') }}
${{ each pair in jobGroup }}:
${{ if not(in(pair.key, 'job', 'name', 'extName', 'variables', 'steps', 'script', 'scriptEnv')) }}:
${{ if not(in(pair.key, 'job', 'name', 'extName', 'variables', 'steps', 'script', 'scriptEnv', 'stepProperties')) }}:
${{ pair.key }}: ${{ pair.value }}
${{ if eq(jobGroup.timeoutInMinutes, '') }}:
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
Expand All @@ -43,15 +43,20 @@ jobs:
${{ if eq(jobGroup.variables[para.key], '') }}:
${{ para.key }}: ${{ para.value }}
steps:
- ${{ parameters.preSteps }}
- ${{ if ne(jobGroup.script, '') }}:
- script: |
${{ jobGroup.script }}
env:
${{ if ne(parameters.scriptEnv, '') }}:
${{ parameters.scriptEnv }}
displayName: 'JobScript'
- ${{ if ne(jobGroup.steps, '') }}:
- ${{ jobGroup.steps }}
- ${{ parameters.buildSteps }}
- ${{ parameters.postSteps }}
- template: azure-pipelines-update-step-properties.yml
parameters:
${{ if ne(jobGroup.stepProperties, '') }}:
properties: ${{ jobGroup.stepProperties }}
steps:
- ${{ parameters.preSteps }}
- ${{ if ne(jobGroup.script, '') }}:
- script: |
${{ jobGroup.script }}
env:
${{ if ne(parameters.scriptEnv, '') }}:
${{ parameters.scriptEnv }}
displayName: 'JobScript'
- ${{ if ne(jobGroup.steps, '') }}:
- ${{ jobGroup.steps }}
- ${{ parameters.buildSteps }}
- ${{ parameters.postSteps }}
14 changes: 14 additions & 0 deletions .azure-pipelines/azure-pipelines-update-step-properties.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
parameters:
- name: 'properties'
type: object
default: {}
- name: 'steps'
type: stepList
default: []
steps:
- ${{ each step in parameters.steps }}:
- ${{ each pair in step }}:
${{ if ne(parameters.properties[pair.key], '') }}:
${{ pair.key }}: ${{ parameters.properties[pair.key] }}
${{ else }}:
${{ pair.key }}: ${{ pair.value }}
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ stages:
timeoutInMinutes: 1200
variables:
PLATFORM_ARCH: armhf
stepProperties:
retryCountOnTaskFailure: 2

- stage: Test
dependsOn: BuildVS
Expand Down