#2739 - Updated azure-benchmark-pipeline.yaml to allow it to run for unlimited time on the Imaginary Yak Pool

This commit is contained in:
Chris McCarthy
2024-07-05 16:56:07 +01:00
parent 20e5e40d0d
commit 7173c329b0

View File

@@ -11,19 +11,22 @@ schedules:
branches: branches:
include: include:
- 'refs/heads/dev' - 'refs/heads/dev'
pool:
vmImage: ubuntu-latest
variables: variables:
VERSION: '' VERSION: ''
MAJOR_VERSION: '' MAJOR_VERSION: ''
steps: jobs:
- checkout: self - job: PrimAITE Benchmark
timeoutInMinutes: 0 # Set to unlimited timeout
pool:
name: 'Imaginary Yak Pool'
workspace:
clean: all
steps:
- checkout: self
persistCredentials: true persistCredentials: true
- script: | - script: |
VERSION=$(cat src/primaite/VERSION | tr -d '\n') VERSION=$(cat src/primaite/VERSION | tr -d '\n')
if [[ "$(Build.SourceBranch)" == "refs/heads/dev" ]]; then if [[ "$(Build.SourceBranch)" == "refs/heads/dev" ]]; then
DATE=$(date +%Y%m%d) DATE=$(date +%Y%m%d)
@@ -31,38 +34,38 @@ steps:
fi fi
displayName: 'Update VERSION file for Dev Benchmark' displayName: 'Update VERSION file for Dev Benchmark'
- script: | - script: |
VERSION=$(cat src/primaite/VERSION | tr -d '\n') VERSION=$(cat src/primaite/VERSION | tr -d '\n')
MAJOR_VERSION=$(echo $VERSION | cut -d. -f1) MAJOR_VERSION=$(echo $VERSION | cut -d. -f1)
echo "##vso[task.setvariable variable=VERSION]$VERSION" echo "##vso[task.setvariable variable=VERSION]$VERSION"
echo "##vso[task.setvariable variable=MAJOR_VERSION]$MAJOR_VERSION" echo "##vso[task.setvariable variable=MAJOR_VERSION]$MAJOR_VERSION"
displayName: 'Set Version Variables' displayName: 'Set Version Variables'
- task: UsePythonVersion@0 - task: UsePythonVersion@0
inputs: inputs:
versionSpec: '3.11' versionSpec: '3.11'
addToPath: true addToPath: true
- script: | - script: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -e .[dev,rl] pip install -e .[dev,rl]
primaite setup primaite setup
displayName: 'Install Dependencies' displayName: 'Install Dependencies'
- script: | - script: |
cd benchmark cd benchmark
python3 primaite_benchmark.py python3 primaite_benchmark.py
cd .. cd ..
displayName: 'Run Benchmarking Script' displayName: 'Run Benchmarking Script'
- script: | - script: |
git config --global user.email "oss@dstl.gov.uk" git config --global user.email "oss@dstl.gov.uk"
git config --global user.name "Defence Science and Technology Laboratory UK" git config --global user.name "Defence Science and Technology Laboratory UK"
workingDirectory: $(System.DefaultWorkingDirectory) workingDirectory: $(System.DefaultWorkingDirectory)
displayName: 'Configure Git' displayName: 'Configure Git'
condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release')) condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release'))
- script: | - script: |
git add benchmark/results/v$(MAJOR_VERSION)/v$(VERSION)/* git add benchmark/results/v$(MAJOR_VERSION)/v$(VERSION)/*
git commit -m "Automated benchmark output commit for version $(VERSION)" git commit -m "Automated benchmark output commit for version $(VERSION)"
git push origin HEAD:refs/heads/$(Build.SourceBranchName) git push origin HEAD:refs/heads/$(Build.SourceBranchName)
@@ -72,11 +75,11 @@ steps:
GIT_CREDENTIALS: $(System.AccessToken) GIT_CREDENTIALS: $(System.AccessToken)
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/heads/release')) condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/heads/release'))
- script: | - script: |
tar czf primaite_v$(VERSION)_benchmark.tar.gz benchmark/results/v$(MAJOR_VERSION)/v$(VERSION) tar czf primaite_v$(VERSION)_benchmark.tar.gz benchmark/results/v$(MAJOR_VERSION)/v$(VERSION)
displayName: 'Prepare Artifacts for Publishing' displayName: 'Prepare Artifacts for Publishing'
- task: PublishPipelineArtifact@1 - task: PublishPipelineArtifact@1
inputs: inputs:
targetPath: primaite_v$(VERSION)_benchmark.tar.gz targetPath: primaite_v$(VERSION)_benchmark.tar.gz
artifactName: 'benchmark-output' artifactName: 'benchmark-output'