Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 of 14 tasks
feliasson opened this issue Jun 27, 2024 · 9 comments
Open
3 of 14 tasks

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

feliasson opened this issue Jun 27, 2024 · 9 comments

Comments

@feliasson
Copy link

feliasson commented Jun 27, 2024

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

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • Ubuntu 24.04
  • macOS 11
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • Windows Server 2019
  • Windows Server 2022

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 in a template that has been called by extends from another repository and use vmImage: ubuntu-latest
@RaviAkshintala
Copy link

RaviAkshintala commented Jun 27, 2024

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
Copy link
Author

feliasson commented Jun 27, 2024

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
Copy link

@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
Copy link
Author

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

@kishorekumar-anchala
Copy link
Contributor

Hi @feliasson ,

No, I have used only hosted agents on Azure pipelines and also not set any other template to use pool .

@feliasson
Copy link
Author

Hi @feliasson ,

No, I have used only hosted agents on Azure pipelines and also not set any other template to use pool .

What kind of answer is that? How are we supposed to report bugs if you are not willing to take similar steps to try to reproduce the behavior? I don't understand.

@kishorekumar-anchala
Copy link
Contributor

Hey @feliasson ,

Kindly look into my investigation below ,

  1. I have tried with basic sample yaml pipeline as per your workaround.(Azure-pipelines.yaml)

stages:
- stage: BuildAndTest
  jobs:
  - template: templates/build-test.yml  
    parameters:
      vmImage: 'ubuntu-latest' 

  1. this is build-test.yaml file
   parameters:
- name: vmImage
  type: string
  default: 'ubuntu-latest'

jobs:
- job: BuildAndTest
  displayName: 'Build and Test Job'
  pool:
    vmImage: ${{ parameters.vmImage }}
  steps:
  - script: |
      echo "Starting build and test on ${{ parameters.vmImage }}"

You can find below logs , it is taking 22.04 as ubuntu-latest . I hope the above workaround will clarify your issue .

https://github.com/actions/runner-images/blob/ubuntu22/20240624.1/images/ubuntu/Ubuntu2204-Readme.md
2024-07-02T07:17:29.9344371Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20240624.1

Thankyou !

@feliasson
Copy link
Author

You are still not using the extends definition to call the template:
https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/extends?view=azure-pipelines

@kishorekumar-anchala
Copy link
Contributor

Hi @feliasson , I don't think so, there is no difference. I tried the same but i am unable to reproduce the issue .

extends:
  template: templates/build-test.yml
    vmImage: 'ubuntu-latest'

2024-07-02T08:35:40.3792834Z Image: ubuntu-22.04
2024-07-02T08:35:40.3792953Z Version: 20240624.1.0
2024-07-02T08:35:40.3793228Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20240624.1/images/ubuntu/Ubuntu2204-Readme.md
2024-07-02T08:35:40.3793559Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20240624.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants