Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure DevOps build pipeline unreliable triggering by schedule

I run build pipelines in Azure DevOps to daily update a Dockerfile and rebuild a container image with updated dependencies. The purpose is to have an up-to-date version of a dependency for the project and release a new artifact in container registry.

In Azure DevOps I have three chained build pipelines. The first pipeline is triggered every day with scheduled trigger. The next two pipelines are triggered with CI trigger file path filters. This all works well, most of the times.

My problem is that sometimes the schedule is not triggered at all. This happens after the pipelines have been running normally for days (ranging from about 1 to 15 days). The checkbox "Only schedule builds if the source or pipeline has changed" is unchecked, so having no commits should not be the problem.

Strange thing after this problem situation is that when I login to Azure DevOps portal the scheduled event is immediately triggered and I can see that the latest daily build starts running. I don't need to start it manually, it starts automatically like it would be scheduled but at the time I logged in.

This project is running with the free version of Azure DevOps. The project and pipelines have been created when Azure DevOps was VSTS and the same triggering problem was also in VSTS. Sometimes I run out of free quota and then I get an error that the agent cannot be started. This is not the case when the scheduled trigger is not running.

What could cause the problem in triggering by the schedule? Have any of you encountered this same problem? How could I debug or resolve this and get my builds running reliably? I cannot find any debug information about the trigger events, only logs from agent after the trigger has already happened. I have not yet recreated the pipelines to find out if "rebooting" helps in this case. That's my next step if no better answers will come up.

like image 466
Veikko Avatar asked Oct 06 '18 09:10

Veikko


People also ask

Can we schedule a trigger for the release pipeline?

After you create your YAML build pipeline, you can use pipeline settings to specify a scheduled trigger. YAML isn't supported in TFS. You can view a preview of upcoming scheduled builds by choosing Scheduled runs from the context menu on the pipeline details page for your pipeline.

How do you trigger release pipeline from build pipeline Azure DevOps?

To trigger a pipeline upon the completion of another pipeline, configure a pipeline resource trigger. The following example configures a pipeline resource trigger so that a pipeline named app-ci runs after any run of the security-lib-ci pipeline completes. This example has the following two pipelines.

Are Azure DevOps release pipelines deprecated?

Draft releases are deprecated in Azure Pipelines because you can change variables while you're creating the release. Creating a draft release allows you to edit some settings for the release and tasks, depending on your role permissions before you start the deployment.

What are the two categories of triggers in Azure DevOps?

Continuous deployment triggers help you start classic releases after a classic build or YAML pipeline completes. Scheduled release triggers allow you to run a release pipeline according to a schedule. Pull request release triggers are used to deploy a pull request directly using classic releases.


1 Answers

Update 07/11/2019:
​We have since updated this logic to give 1 full month of scheduled builds to continue to run without any user activity. Nightly builds require someone to sign in daily.


From the docs:
My build didn't run. What happened?
Your Azure DevOps organization goes dormant five minutes after the last user signed out. After that, each of your build pipelines will run one more time. For example, while your organization is dormant:

  • A nightly build of code in your Azure DevOps organization will run only one night until someone signs in again.
  • CI builds of an external Git repo will stop running until someone signs in again.

https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=vsts&tabs=yaml

like image 59
Eichi Avatar answered Sep 23 '22 01:09

Eichi