actions / runner-images

GitHub Actions runner images
MIT License
9.37k stars 2.9k forks source link

ubuntu-latest is setting ubuntu20.04 instead of ubuntu22.04 #10133

Open feliasson opened 3 days ago

feliasson commented 3 days ago

Description

    pool:
      vmImage: ubuntu-latest

When using MS-hosted images and the vmImage ubuntu-latest for pool in Azure DevOps pipeline the following is seen during a pipeline run:

image

image

According to documentation the ubuntu-latest YAML-label should be Ubuntu 22.04, therefor I consider this a bug.

Platforms affected

Runner images affected

Image version and build link

Operating System
Ubuntu
20.04.6
LTS
Runner Image
Image: ubuntu-20.04
Version: 20240624.2.0
Included Software: https://github.com/actions/runner-images/blob/ubuntu20/20240624.2/images/ubuntu/Ubuntu2004-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu20%2F20240624.2
Runner Image Provisioner
2.0.370.1

Is it regression?

No

Expected behavior

The ubuntu-latest YAML-label to reflect Ubuntu 22.04 image and not Ubuntu 20.04 image.

Actual behavior

The ubuntu-latest YAML-label is using Ubuntu 20.04 image and not the expected Ubuntu 22.04 image.

Repro steps

  1. In Azure DevOps and in an Azure Pipeline, define a pool from stage level and use vmImage: ubuntu-latest
RaviAkshintala commented 3 days ago

Hi @feliasson,

We have tested it from our side, and it is showing ubuntu-22.04.


# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- dependabot/npm_and_yarn/result/express-4.19.2

pool:
  vmImage: ubuntu-latest

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script' 

Result:
2024-06-27T12:17:50.1772189Z ##[section]Starting: Job
2024-06-27T12:17:50.3935320Z ##[section]Starting: Initialize job
2024-06-27T12:17:50.3938278Z Agent name: 'Hosted Agent'
2024-06-27T12:17:50.3938592Z Agent machine name: 'fv-az462-900'
2024-06-27T12:17:50.3938748Z Current agent version: '3.241.0'
2024-06-27T12:17:50.3979906Z ##[group]Operating System
2024-06-27T12:17:50.3980083Z Ubuntu
2024-06-27T12:17:50.3980169Z 22.04.4
2024-06-27T12:17:50.3980247Z LTS
2024-06-27T12:17:50.3980363Z ##[endgroup]
2024-06-27T12:17:50.3981167Z ##[group]Runner Image
2024-06-27T12:17:50.3981333Z Image: ubuntu-22.04
2024-06-27T12:17:50.3981451Z Version: 20240624.1.0
feliasson commented 3 days ago

Hi @RaviAkshintala, then maybe the behavior occurs when pool is set from stage level when using the extends definition .

To give you an example how it looks like:

# pipeline yaml

resources:
  repositories:
  - repository: template
    type: git
    name: tooling
    ref: refs/heads/main

extends:
  template: pipeline-template/<template-name>-pipeline-template.yml@template
  parameters:
   <parameters>
# <template-name>-pipeline-template.yml@template

parameters:
  <parameters>

stages:

- stage: stage1
  pool:
    vmImage: ubuntu-latest

  jobs:
   <jobs>

I hope this can help to reproduce the behavior.

RaviAkshintala commented 2 days ago

@feliasson As per your repro steps we have ran the pipeline and it is taking only ubuntu-22.04.Please find the below logs.


2024-06-28T07:05:19.5094686Z ##[section]Starting: Build
2024-06-28T07:05:19.6526690Z ##[section]Starting: Initialize job
2024-06-28T07:05:19.6529088Z Agent name: 'Hosted Agent'
2024-06-28T07:05:19.6529407Z Agent machine name: 'fv-az369-114'
2024-06-28T07:05:19.6529555Z Current agent version: '3.241.0'
2024-06-28T07:05:19.6560917Z ##[group]Operating System
2024-06-28T07:05:19.6561092Z Ubuntu
2024-06-28T07:05:19.6561187Z 22.04.4
2024-06-28T07:05:19.6561269Z LTS
2024-06-28T07:05:19.6561364Z ##[endgroup]
2024-06-28T07:05:19.6561483Z ##[group]Runner Image
2024-06-28T07:05:19.6561609Z Image: ubuntu-22.04
2024-06-28T07:05:19.6561722Z Version: 20240624.1.0
2024-06-28T07:05:19.6561953Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20240624.1/images/ubuntu/Ubuntu2204-Readme.md
2024-06-28T07:05:19.6562242Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20240624.1 ```

stages:
- stage: Build
  displayName: Build stage
  jobs:
  - job: Build
    displayName: Build
    pool:
     vmImage: 'ubuntu-latest'
    steps:
    - task: Docker@2
      displayName: Build and push an image to container registry 
      inputs:
        command: buildAndPush
        repository: $(imageRepository)
        dockerfile: $(dockerfilePath)
        containerRegistry: $(dockerRegistryServiceConnection) `
feliasson commented 2 days ago

@RaviAkshintala but your example here is not using extend and calling another template where the pool value is set?