actions / runner-images

GitHub Actions runner images
MIT License
10.15k stars 3.06k forks source link

Ubuntu 2204 build doesn't become Azure Image #6914

Closed agentq15 closed 1 year ago

agentq15 commented 1 year ago

Description

We have no issue building Ubuntu 2004 image. But now when we changed to Ubuntu 2204 the build works fine but no Image ends up in the resource group. I can see a vhd file inside the storage account but it is not converted to an Image image

What am I doing wrong?

Platforms affected

Runner images affected

Image version and build link

Current agent version: '2.214.1'

Is it regression?

No

Expected behavior

We will get an Azure Image inside the resource group Previous build log ended with this message which the new one doesn't image

Actual behavior

Build is working but just ends up as a VHD file inside the storage account image

Repro steps

Run build pipeline

mikhailkoliada commented 1 year ago

hello, which way are you building (which script are you running) exactly to build the image?

agentq15 commented 1 year ago

hello, which way are you building (which script are you running) exactly to build the image?

We just run this one https://github.com/actions/runner-images/blob/main/images.CI/linux-and-win/azure-pipelines/ubuntu2204.yml

Before we ran this one and it still works https://github.com/actions/runner-images/blob/main/images.CI/linux-and-win/azure-pipelines/ubuntu2004.yml

They both use the same template and it is just the image_type that changes.

erik-bershel commented 1 year ago

Hey @agentq15! Please take a look on that part of our guide. I suppose here you missing moment with difference betwen image generation that just generate vhd and json files and real VM creation that described in guide. Maybe previously you used selfwriten pipeline or script which contain both those generation and deploying steps.

agentq15 commented 1 year ago

Hey @agentq15! Please take a look on that part of our guide. I suppose here you missing moment with difference betwen image generation that just generate vhd and json files and real VM creation that described in guide. Maybe previously you used selfwriten pipeline or script which contain both those generation and deploying steps.

But as I said the only difference is the change of image_type variable. We haven't changed anything else. At the Build VM stage we got an Azure Image before as you can see on the screen shot under Exptected behavior. The new on just says build finished.

They guide you linked seems to be for creating VM's which I don't want. I just want the image file like these we used to get: image

erik-bershel commented 1 year ago

@agentq15 you can use that helper function to prepare Azure Image. Our CI pipelines you have mentioned here never prepared Image but only VHDs. Please, check what code you really used for creating Ubuntu20 because screenshot you posted doesn't looks like a result of our base pipeline.

agentq15 commented 1 year ago

Found what we had changed in the other config.

Need to add this

variable "managed_image_resource_group_name" { type = string default = "${env("MANAGED_IMAGE_RESOURCE_GROUP_NAME")}" } variable "managed_image_name" { type = string default = "${env("MANAGED_IMAGE_NAME")}" }

And add this under build_vhd

managed_image_resource_group_name = "${var.managed_image_resource_group_name}" managed_image_name = "${var.managed_image_name}"

And remove this:

capture_container_name = "images" capture_name_prefix = "${var.capture_name_prefix}" resource_group_name = "${var.resource_group}" storage_account = "${var.storage_account}"

Started getting this now instead /imagegeneration/SoftwareReport/SoftwareReport.Generator.ps1 : Exception setting "Version": "The argument is null or empty. Provide an argument that is not null or empty, and then try the command again." Any ideas on why?

erik-bershel commented 1 year ago

Hi @agentq15, You got that error message because you didn't update your fork. Issue you mentioned covered by that PR merged. More info here: https://github.com/actions/runner-images/issues/6922

I'll close that issue because it isn't connected with any current issues. Feel free to ping me here if you have another questions about topic. Or you may open issue in case you have new concerns.

agentq15 commented 1 year ago

Perfect, thank you!