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

Pin ubuntu runner version in CI for stability #1311

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Pin ubuntu runner version in CI for stability #1311

merged 1 commit into from
Oct 16, 2024

Conversation

rajeee
Copy link
Contributor

@rajeee rajeee commented Oct 15, 2024

Pull Request Description

Our CI is failing due to ubunut-latest being recently updated to Ubuntu 24.04. This PR pins ubuntu version to 22.04 - a version that has been working for us so far.

Related Pull Requests

[related PRs from different repositories]

Related Issues

CI is failing when trying to install buildstockbatch on system python.
Error:

Run pip install git+https://github.com/NREL/buildstockbatch.git@develop
  pip install git+https://github.com/NREL/buildstockbatch.git@develop
  
  buildstock_local project_national/national_baseline.yml
  buildstock_local project_testing/testing_baseline.yml
  
  buildstock_local project_national/national_upgrades.yml
  buildstock_local project_testing/testing_upgrades.yml
  shell: /usr/bin/bash -e {0}
  env:
    OPENSTUDIO_VER: 3.8.0
    OPENSTUDIO_SHA: f953b6fcaf
    OPENSTUDIO_PLATFORM: Ubuntu-[2](https://github.com/NREL/resstock/actions/runs/11335475928/job/31524166324?pr=929#step:5:2)0.04-x86_64
    OPENSTUDIO_EXT: deb
    OPENSTUDIO_URL: https://github.com/NREL/OpenStudio/releases/download/v[3](https://github.com/NREL/resstock/actions/runs/11335475928/job/31524166324?pr=929#step:5:3).8.0
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP [6](https://github.com/NREL/resstock/actions/runs/11335475928/job/31524166324?pr=929#step:5:6)68 for the detailed specification.
Error: Process completed with exit code 1.

Checklist

Required:

Optional (not all items may apply):

@rajeee rajeee changed the title Pin ubuntu version for predictability Pin ubuntu image in CI for stability Oct 15, 2024
@rajeee rajeee changed the title Pin ubuntu image in CI for stability Pin ubuntu runner version in CI for stability Oct 15, 2024
@rajeee rajeee requested a review from afontani October 15, 2024 19:00
Copy link
Contributor

@afontani afontani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now to make sure development can continue for everyone else. We need to figure out why our workflow is broken on ubuntu 24.04. Maybe it won't matter with some upcoming CI changes.

@afontani afontani merged commit 0081eb7 into develop Oct 16, 2024
8 checks passed
@afontani afontani deleted the ci_fix branch October 16, 2024 15:03
@rajeee
Copy link
Contributor Author

rajeee commented Oct 16, 2024

I think ubuntu 24.04 runner comes with more python packages and that conflicts with the packages we are trying to install. This could be resolved by using containers or virtual environment. Or, if we migrate to different CI environment with different runners, this is no longer relevant.

@joseph-robertson
Copy link
Contributor

FYI, this is the approach that OS-HPXML took to get around this issue.

Based on the "comes with more python packages" comment above, could we also try not pip installing?

@shorowit
Copy link
Contributor

It doesn’t necessarily come with more python packages, it’s just that Ubuntu 24.04 comes with a newer version of python that tries to prevent the possibility of breaking things if you have both system packages and pip-installed packages. That was true before this python upgrade too. But now they force you to either acknowledge you might break something when you pip install, or use a virtual environment.

@shorowit
Copy link
Contributor

FYI, GitHub just reverted ubuntu-latest to 22.04 because it broke so many things. So it looks like @rajeee's solution was smart and avoids the ping-ponging that is currently going on.

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

Successfully merging this pull request may close these issues.

4 participants