runner-images icon indicating copy to clipboard operation
runner-images copied to clipboard

(Ubuntu 22.04) pip version discrepancy

Open melange396 opened this issue 1 year ago • 2 comments

Description

Recent ubuntu-latest (22.04) runner image changed to include pip version 24.x instead of 22.0.2 as claimed.

This seems unintended. If not, consider updating the image's release notes and readme.

See explanation and workaround here: https://github.com/cmu-delphi/delphi-epidata/pull/1503

Platforms affected

  • [ ] Azure DevOps
  • [X] GitHub Actions - Standard Runners
  • [ ] GitHub Actions - Larger Runners

Runner images affected

  • [ ] Ubuntu 20.04
  • [X] Ubuntu 22.04
  • [ ] Ubuntu 24.04
  • [ ] macOS 12
  • [ ] macOS 13
  • [ ] macOS 13 Arm64
  • [ ] macOS 14
  • [ ] macOS 14 Arm64
  • [ ] Windows Server 2019
  • [ ] Windows Server 2022

Image version and build link

20240721.1.0 failed: https://github.com/cmu-delphi/delphi-epidata/actions/runs/10095233705/job/27915622079#step:1:10

Is it regression?

yes; most recent run with 20240526.1.0 succeeded: https://github.com/cmu-delphi/delphi-epidata/actions/runs/9290024871/job/25565314861#step:1:9

Expected behavior

i expect pip version 22.0.2 as noted here: https://github.com/actions/runner-images/blob/ubuntu22/20240721.1/images/ubuntu/Ubuntu2204-Readme.md?plain=1#L39

Actual behavior

we get pip version 24.1.2 as seen here: https://github.com/cmu-delphi/delphi-epidata/actions/runs/10096915539/job/27920539469#step:5:10

Repro steps

  1. run a GH action with runs-on: ubuntu-latest
  2. execute a step with run: pip -V
  3. observe version mismatch

melange396 avatar Jul 25 '24 17:07 melange396

@melange396 Thank you for bringing this issue to us. We are looking into this issue and will update you on this issue after investigating.

RaviAkshintala avatar Jul 25 '24 18:07 RaviAkshintala

Same issue in Ubuntu20.04. Pip is declared to be 20.0.2 but some cmds that are legal with pip < 22 are reporting errors.

xchen218 avatar Jul 26 '24 00:07 xchen218

Hi @melange396 We have followed your repro steps for ubuntu-latest. Kindly confirm.

name: Check pip Version

on: [push, pull_request]

jobs:
  check-pip-version:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Check pip version
      run: pip -V

image

RaviAkshintala avatar Aug 02 '24 12:08 RaviAkshintala

looks like you may also need:

    - name: Set up Python 3.8
      uses: actions/setup-python@v2
      with:
        python-version: 3.8

just as we use, to get this output: image

melange396 avatar Aug 02 '24 13:08 melange396

Hi @melange396 We have followed your repro steps for ubuntu-latest. Kindly confirm.


name: Check pip Version
on: [push, pull_request]

jobs:
  check-pip-version:
    runs-on: ubuntu-22.04
    steps:
    - name: Checkout repository
      uses: actions/checkout@v4
    
    - name: Set up Python 3.8
      uses: actions/setup-python@v2
      with:
        python-version: 3.8
    
    - name: Install pip version 22
      run: |
        python -m pip install --upgrade pip==22.0.0
        
    
    - name: Check pip version
      run: pip -V
image

RaviAkshintala avatar Aug 27 '24 05:08 RaviAkshintala

i think thats almost it, except that if you remove this section

    - name: Install pip version 22
      run: |
        python -m pip install --upgrade pip==22.0.0

it will show that you get pip version 24.1.2 instead of the promised 22.0.2

melange396 avatar Aug 27 '24 14:08 melange396

@melange396 Scenario 1: With actions/setup-python When you use actions/setup-python@v2 to set up Python 3.8, it installs a specific version of Python and its associated pip. By default, this setup installs the latest version of pip that is compatible with Python 3.8. This is why you're seeing pip version 24. Scenario 2: Without actions/setup-python When you do not use actions/setup-python, the workflow uses the system-installed Python and pip, which may be an older version. In this case, it defaults to pip version 22.

RaviAkshintala avatar Aug 27 '24 15:08 RaviAkshintala

Fair enough! Apologies, i guess i should have filed a bug with https://github.com/actions/setup-python (https://github.com/actions/setup-python/issues/901 seems related). It looks like we will need to either keep the step that downgrades pip, or do something else to sort out our dependencies to avoid the error.

melange396 avatar Aug 27 '24 16:08 melange396