{"id":30743530,"url":"https://github.com/ukho/vm-agent-aib","last_synced_at":"2026-02-26T07:03:50.502Z","repository":{"id":42642126,"uuid":"236593833","full_name":"UKHO/vm-agent-aib","owner":"UKHO","description":"Azure Image Builder template for building a VM image for Pipeline Agents","archived":false,"fork":false,"pushed_at":"2025-02-18T12:23:53.000Z","size":221,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-18T12:34:18.946Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UKHO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-27T21:00:32.000Z","updated_at":"2025-02-18T12:23:57.000Z","dependencies_parsed_at":"2024-07-17T11:15:22.084Z","dependency_job_id":"1fb9c893-41fc-4248-a798-d248c88062b6","html_url":"https://github.com/UKHO/vm-agent-aib","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/UKHO/vm-agent-aib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UKHO%2Fvm-agent-aib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UKHO%2Fvm-agent-aib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UKHO%2Fvm-agent-aib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UKHO%2Fvm-agent-aib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UKHO","download_url":"https://codeload.github.com/UKHO/vm-agent-aib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UKHO%2Fvm-agent-aib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273539317,"owners_count":25123499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-04T02:07:47.878Z","updated_at":"2026-02-26T07:03:45.465Z","avatar_url":"https://github.com/UKHO.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ubuntu Agent VM image [![Build Status](https://ukhogov.visualstudio.com/Digital%20Operations/_apis/build/status/UKHO.vm-agent-aib?branchName=master)](https://ukhogov.visualstudio.com/Digital%20Operations/_build/latest?definitionId=180\u0026branchName=master)\n\nUses the [Azure Image Builder](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/image-builder-overview) to create an image for the UKHO flavour Ubuntu Agents which is  distributed to a [shared image gallery](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/shared-image-galleries).\n\nThe finished image contains the following:\n\n- Base dependencies (docker, maven etc.)\n- A version of the Azure Pipelines agent\n- The latest version of the [VM Drainer](https://github.com/UKHO/AzDoAgentDrainer)\n- UKHO esa-snap7-snappy \n- UKHO Terraform\n\n\u003e **N.B.** [Azure Image Builder](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/image-builder-overview) is in preview and restricted to certain regions. This means the image is built in the UK West and then replicated to UK South.\n\n## Creating the image\n\nThe build associated with this repo \"orchestrates\" the creation of the image. It adds the json configuration to Azure as a resource, ensures it runs and deletes the configuration afterwards. It additionally replaces variables within the json configuration.\n\nThe build is also triggered by the completion of the [drainer](https://github.com/UKHO/AzDoAgentDrainer) build.\n\n## Editing the image\n\n### Add a new resource\n\n\u003e These instructions only refer to the shell script customizer. [Other customizers are available](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/image-builder-json#properties-customize)\n\n- Add a new shell script in [ubuntu-agent-vm/scripts](ubuntu-agent-vm/scripts) that installs the resource\n  - Give the script a descriptive name\n  - Ensure you ONLY affect one resource. Do not create a script that adds multiple resources.\n- Add the script to the `customize` array of  [ubuntu-agent-vm-aib.json](ubuntu-agent-vm/ubuntu-agent-vm-aib.json) following the same pattern as the other shell scripts\n  - These scripts are executed in order. If you have a dependency on a earlier resource, your script must be after that resource\n- Push changes as a PR\n- On merge to master, a new image is built and distributed. This takes approximently 45 minutes\n- DDC will then update the agents to use the new image, this will take up to half an hour.\n\n### Edit an exisiting resource\n\n- Find and update the relevant shell script under [ubuntu-agent-vm/scripts](ubuntu-agent-vm/scripts)\n- Make changes and push as a PR\n- On merge to master, a new image is built and distributed. This takes approximently 45 minutes\n- DDC will then update the agents to use the new image, this will take up to half an hour.\n\n## Deploying/Moving the Image Builder in a subscription\n\n\u003e These instructions are borrowed liberally from the [Image Builder Overview](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/image-builder-overview).\n\nFor AIB to create images, configuration is required. This should only need to be done if the images need to be built in a new subscription or the images added to a different resource group.\n\n### Enable AIB for the subscription\n\n\u003e Needs to be done whilst AIB is in preview\n\n```powershell\n# Add the feature to the subscription\naz account set --subscription $subscriptionID\naz feature register --namespace Microsoft.VirtualMachineImages --name VirtualMachineTemplatePreview\n\n# Wait for the feature state to show as registered. This can take 10 mins.\naz feature show --namespace Microsoft.VirtualMachineImages --name VirtualMachineTemplatePreview\n\n# Check if VMI is registered and if not, register it\naz provider show -n Microsoft.VirtualMachineImages\naz provider register -n Microsoft.VirtualMachineImages\n\n# Check if Storage is registered and if not, register it.\naz provider register -n Microsoft.Storage\naz provider register -n Microsoft.Storage\n```\n\n### Add the Image Builder application to a resource group\n\nAIB requires contributor rights for the resource group where the image will **end up**. If AIB does not have these permissions, then it will be unable to add the completed image to the resource group. The GUID below is the ID of the Image Builder application.\n\n```powershell\naz role assignment create \\\n    --assignee cf32a0cc-373c-47c9-9156-0db11f6a6dfc \\\n    --role Contributor \\\n    --scope /subscriptions/$subscriptionID/resourceGroups/$imageResourceGroup\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fukho%2Fvm-agent-aib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fukho%2Fvm-agent-aib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fukho%2Fvm-agent-aib/lists"}