最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

performance of the checkout step in an Azure DevOps YAML pipeline - Stack Overflow

programmeradmin1浏览0评论

We have a couple YAML pipelines in Azure DevOps (cloud hosted). We've recently ported them from classic pipelines to YAML. The pipelines checkout code on a specified branch (main by default or the selected branch). The code is in a Git repo hosted in Azure DevOps.

We use locally hosted agents which run the listener. So though we are initiating the pipelines in the Azure DevOps cloud, they run on our local build agent machines at the office.

With the classic pipelines, the code checkout step was very quick. Since the code was already in the local agent's folder, it would only require updating to the desired branch. This step would, many times, take 5-10 seconds.

When we switched to YAML, now we see it taking 5-10 minutes. The issue appears to be the checkout step. It looks like it's downloading everything each time.

After some initial online searching, we tried the below in the pipeline.

steps:
- checkout: self
  displayName: 'checkout code'
  clean: false
  fetchDepth: 1
  fetchFilter: tree:0
  fetchTags: false

With the above in place it's taking 5-10 minutes, without this it would take far longer as it is a large repository with lots of history.

It's not clear to me what the classic pipeline was doing differently than the YAML. Its as though it was not re-downloading everything each time.

Any idea how we get that same functionality with YAML?

We have a couple YAML pipelines in Azure DevOps (cloud hosted). We've recently ported them from classic pipelines to YAML. The pipelines checkout code on a specified branch (main by default or the selected branch). The code is in a Git repo hosted in Azure DevOps.

We use locally hosted agents which run the listener. So though we are initiating the pipelines in the Azure DevOps cloud, they run on our local build agent machines at the office.

With the classic pipelines, the code checkout step was very quick. Since the code was already in the local agent's folder, it would only require updating to the desired branch. This step would, many times, take 5-10 seconds.

When we switched to YAML, now we see it taking 5-10 minutes. The issue appears to be the checkout step. It looks like it's downloading everything each time.

After some initial online searching, we tried the below in the pipeline.

steps:
- checkout: self
  displayName: 'checkout code'
  clean: false
  fetchDepth: 1
  fetchFilter: tree:0
  fetchTags: false

With the above in place it's taking 5-10 minutes, without this it would take far longer as it is a large repository with lots of history.

It's not clear to me what the classic pipeline was doing differently than the YAML. Its as though it was not re-downloading everything each time.

Any idea how we get that same functionality with YAML?

Share asked Mar 7 at 19:48 NerdtronNerdtron 1,5261 gold badge21 silver badges33 bronze badges 1
  • your YAML builds are executing on the same local build agents? Conceptually, a classic build and a YAML build both run on the agent using the same tasks -- the only thing that is different is the data-source that defines the steps to take. – bryanbcook Commented Mar 7 at 19:59
Add a comment  | 

1 Answer 1

Reset to default 0

The YAML pipeline is the same as the Classic pipeline, they both use the same `checkout` task. For your current different performances,

  1. Ensure your YAML pipeline always runs on the same self-hosted agent and the local directories are not deleted.

  2. Ensure there isn't any clean option enabled for your YAML pipeline. For example, workspace clean and Clean setting in the pipeline UI.

发布评论

评论列表(0)

  1. 暂无评论