0
votes

Im working on a simple deployment pipeline with azure devops. I created a deployment pipeline running on a self hosted ubuntu deployment group. The pipeline looks like this:

  • Download artifacts from CI pipeline (created with dotnet publish)
  • Stop running deployment
  • Unzip the ASP.NET Core Web API to the deployment directory
  • Run new deployment with dotnet MyApp.dll

The first two steps work as expected. However, when the dotnet My App.dll command is run, the process runs for 10 seconds with following "error" message being printed at the end:

The STDIO streams did not close within 10 seconds of the exit event from process '/usr/bin/bash'. This may indicate a child process inherited the STDIO streams and has not yet exited.

The deployment task is successful despite the message and the app not running. I tried to work around this feature by using nohup & and relocating the command output. After some research I found that all processes started by a pipeline agent are stopped after the agent's work is done - meaning this behaviour is intended and my understanding of azure deployments/agents is wrong. How do I deploy and run my app in an automated way on my own ubuntu machine using azure devops pipelines?

1
Have you tried run the dotnet MyApp.dll directly on the self hosted agent? stackoverflow.com/questions/59053614/…Leo Liu-MSFT
Thank you for your answer. Yes, running the app directly works fine. Running it through the pipeline works too but the process is killed after 10 seconds - the agent performs a cleanup and stops every process it started during the pipeline after all jobs are completed. I managed to work around it by setting the Process.clean variable to false but its kinda dirty and certainly not what the developers intended.Matthias Lassnig
Thanks for your explanation, I think you are already in the correct way. Setting Process.clean variable to false is the solution to stop agent to clean up the processes. You could check the similar thread developercommunity.visualstudio.com/t/…Leo Liu-MSFT
How about the issue? Does the answer below resolved your question, If not, would you please let me know the latest information about this issue?Leo Liu-MSFT
Well... it solves the problem but it doesn't seem to be a "clean" way of doing it. Regardless, thank you for your answer. I guess this solution is as good as it gets.Matthias Lassnig

1 Answers

0
votes

How do I deploy and run my app in an automated way on my own ubuntu machine using azure devops pipelines?

You are already on the right way.

All the process launched in the pipeline will be finished/clean up in “Finalize Job” step when the pipeline is over.

If you don't want the process to be closed, please try set variable Process.clean= false to stops the "finalize job" step from killing all processes.

But when you create a new pipeline next time, you need to close the app before starting it.