YannickRe / azuredevops-buildagents

Generate self-hosted build agents for Azure DevOps, just like Microsoft does.
MIT License
151 stars 90 forks source link

Hosted pipeline agent #8

Closed McAdamz closed 3 years ago

McAdamz commented 3 years ago

Hello, the documentation mentioned the initial run could be run on the Hosted Pipeline, and then switched to the custom image, but this isn't the case, as the Hosted Pipelines have a 6 hour maximum run time.

https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml

image

YannickRe commented 3 years ago

I never noticed that limitation, and I ran my first image on a paid Microsoft hosted agent with success. Have you tried it and did it fail?

sagoo33 commented 3 years ago

Hi @YannickRe, yes, I tried it twice using the MS Hosted Agent, both times failed at 6 hours 15minutes.

image

I got the scripts to work by creating a self hosted agent with a temporary VM, and then manually installing chocolaty, packer and the latest Powershell. It took a number of failed attempts before I found the required packages needed to run the scripts fully.

Thank you for your time in putting this together, but I thought it would be useful to update your readme to mention the Hosted Agent has timeout of 6hours and would not be able to create a windows image using it.

YannickRe commented 3 years ago

Thank you for informing me! Feel free to submit the PR, but otherwise I'll keep this open until I get to adjusting the readme myself.

Probably this would work too: Hosted Agent to build a Linux Agent, and then use the Linux Agent to build your Windows Agent. Not sure what would be quicker: this extra step with the Linux agent or you trying to create a minimal image to create the full image 😀

Glad you made it work, and again: thank you!

CurlyBytes commented 3 years ago

image

yes this is a bummer, im trying to create a vmss with Linux first then will run the CICD scripts using the vmss agent to create windows image

spoelstraethan commented 3 years ago

Microsoft is looking to change their scripts to only install the LATEST of each .NET runtime, which should drop the end to end runtime a huge amount, this change is going to take place September 6 I believe.

The crazy thing is running the same scripts on our own hosted agent only took 5 hours, but depending on when you try to run it in the public pipelines you might run into "noisy neighbors" where all the other people using public pipelines slow down the build due to I/O or network contention.

Marcus-James-Adams commented 3 years ago

Have you got the URL that explains what MS are going to change in September. That would be really helpful.

On Mon, 9 Aug 2021, 19:37 spoelstraethan, @.***> wrote:

Microsoft is looking to change their scripts to only install the LATEST of each .NET runtime, which should drop the end to end runtime a huge amount, this change is going to take place September 6 I believe.

The crazy thing is running the same scripts on our own hosted agent only took 5 hours, but depending on when you try to run it in the public pipelines you might run into "noisy neighbors" where all the other people using public pipelines slow down the build due to I/O or network contention.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/YannickRe/azuredevops-buildagents/issues/8#issuecomment-895448497, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH7GYFYEJ5O4VIYJCE6MAS3T4AN6TANCNFSM5AKDZCSQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

YannickRe commented 3 years ago

@CurlyBytes thank you for the PR, I merged it and made some other README updates too @spoelstraethan thank you for the heads up, that would help a lot for sure @Marcus-James-Adams they mention the change here: https://github.com/actions/virtual-environments/issues/3809

Given that the README is updated regarding the original issue, I will now close this issue.