From 3d6cea14f4e61f6dd48a4fd4e2dc3acb424cbbe9 Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Fri, 20 Jan 2023 13:37:15 +0800 Subject: [PATCH] Remove intermedia obj files once build finished (#14361) ### Description Remove intermedia obj files and reenable cache ### Motivation and Context Recently, training_debug_x64 pipeline often failed due to not enough space. It could free nearly 8G space by deleting obj files. So, the compilation cache can be reenabled --- .../azure-pipelines/templates/win-ci-vs-2019.yml | 14 ++++++++++++++ .../github/azure-pipelines/win-ci-pipeline.yml | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/win-ci-vs-2019.yml b/tools/ci_build/github/azure-pipelines/templates/win-ci-vs-2019.yml index d479323d7a..7eb100f47d 100644 --- a/tools/ci_build/github/azure-pipelines/templates/win-ci-vs-2019.yml +++ b/tools/ci_build/github/azure-pipelines/templates/win-ci-vs-2019.yml @@ -209,6 +209,20 @@ jobs: displayName: cache stat condition: eq(${{ parameters.WITH_CACHE }}, true) + - powershell: | + Get-Volume D + displayName: check disk size + + - task: DeleteFiles@1 + displayName: 'Delete intermedia files from $(Build.BinariesDirectory)\${{ parameters.BuildConfig }}' + inputs: + SourceFolder: '$(Build.BinariesDirectory)\${{ parameters.BuildConfig }}' + Contents: | + **/*.obj + + - powershell: | + Get-Volume D + displayName: check disk size - ${{ if eq(parameters.EnablePython, true) }}: - task: PythonScript@0 diff --git a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml index a2a067bfc2..77ec91824d 100644 --- a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml @@ -146,7 +146,7 @@ stages: isTraining: true ORT_EP_NAME: CPU GenerateDocumentation: false - WITH_CACHE: false + WITH_CACHE: true MachinePool: 'onnxruntime-Win2019-CPU-training' - stage: training_x64_release