microsoft / azure-container-apps

Roadmap and issues for Azure Container Apps
MIT License
355 stars 27 forks source link

Azure Pipeline Agent - Placeholder job being removed #1122

Closed ager0sa closed 2 weeks ago

ager0sa commented 3 months ago

Please provide us with the following information:

This issue is a: (mark with an x)

Issue description

I'm following the tutorial so that I can use azure devops agent on Azure Container Apps Jobs : https://learn.microsoft.com/en-us/azure/container-apps/tutorial-ci-cd-runners-jobs?tabs=bash&pivots=container-apps-jobs-self-hosted-ci-cd-azure-pipelines

Everything works as expected until I'm re-running a second pipelines and that the pipeline does not find the agent within the pool. It seems that after the agent runs in it's container, the agent is removing the placeholder agent from ADO.

Steps to reproduce

  1. Follow the tutorial here: https://learn.microsoft.com/en-us/azure/container-apps/tutorial-ci-cd-runners-jobs?tabs=bash&pivots=container-apps-jobs-self-hosted-ci-cd-azure-pipelines
  2. Run 2 pipelines

Expected behavior [What you expected to happen.] I'm expecting the placeholder agent to stay in Azure Devops after completion of a pipeline

Actual behavior [What actually happened.] The placeholder agent is being removed.

Thank you for your help

vinisoto commented 3 months ago

Hi - are there any logs in Azure DevOps that indicate who/what is deleting the agent?

Have you tried asking this question in an Azure DevOps-specific forum? This behavior seems to be unrelated to Container Apps Jobs

dsczltch commented 3 months ago

We had this issue, we didn't take the time to search for the root cause, because when using the tutorial docker image, the placeholder stayed in the AzDo Agent pool.

ager0sa commented 3 months ago

Hello, sorry for the late response, I can confirm that using the default image the agent is being removed after job completion. I have the following logs from the container agent :

2024-04-02 09:08:53Z: Job Job completed with result: Succeeded
[1;36mCleanup. Removing Azure Pipelines agent...[0m
Removing agent from the server
Connecting to server ...
Succeeded: Removing agent from the server
Removing .credentials
Succeeded: Removing .credentials

I confirm I'm using the "--once" flag on the run.sh

My client is looking to use such tools to replace our self-hosted agent, but it doesn't seems mature enough as-is. Currently we moved away from containers jobs and using ACA with 1 container always running.

Let me know if you would have any news on this issue