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

ci: pin ubuntu to 22.04 #4213

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Oct 14, 2024

It seems that GitHub starts to point ubuntu-latest to ubuntu-24.04 (xref: actions/runner-images#10636), which brings some breaking changes. For example, cuda 11.8 doesn't support the default compiler in ubuntu-24.04.

Summary by CodeRabbit

  • New Features

    • Updated build, test, and analysis workflows to run on Ubuntu 22.04, enhancing compatibility and performance for C++ projects.
  • Bug Fixes

    • Corrected indentation in the permissions section of the CodeQL workflow.
  • Chores

    • Adjusted timeout settings for the CodeQL analysis job based on the programming language.

It seems that GitHub starts to point ubuntu-latest to ubuntu-24.04 (xref: actions/runner-images#10636), which brings some breaking changes. For example, cuda 11.8 doesn't support the default compiler in ubuntu-24.04.
Copy link
Contributor

coderabbitai bot commented Oct 14, 2024

📝 Walkthrough

Walkthrough

The pull request introduces updates to several GitHub Actions workflow files, specifically for building, testing, and analyzing C++ projects. The primary change is the modification of the operating system environment from ubuntu-latest to ubuntu-22.04 across the buildcc, analyze, and testcc jobs. Additional adjustments include updates to installation commands for CUDA and ROCm in the build workflow, a timeout adjustment for the CodeQL analysis job, and corrections in the indentation of the permissions section in the CodeQL workflow.

Changes

File Path Change Summary
.github/workflows/build_cc.yml Updated runs-on to ubuntu-22.04; modified installation commands for CUDA and ROCm; retained job structure with conditional statements.
.github/workflows/codeql.yml Updated runs-on to ubuntu-22.04 for non-Swift languages; adjusted job timeout; corrected indentation in permissions; added CUDA setup for c-cpp.
.github/workflows/test_cc.yml Updated runs-on to ubuntu-22.04; retained job structure and concurrency settings; unchanged steps for testing.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHubActions
    participant BuildJob
    participant AnalyzeJob
    participant TestJob

    User->>GitHubActions: Trigger workflow
    GitHubActions->>BuildJob: Execute buildcc job on ubuntu-22.04
    BuildJob->>BuildJob: Install dependencies (CUDA, ROCm)
    BuildJob-->>GitHubActions: Build completed

    GitHubActions->>AnalyzeJob: Execute analyze job on ubuntu-22.04
    AnalyzeJob->>AnalyzeJob: Run CodeQL analysis
    AnalyzeJob-->>GitHubActions: Analysis completed

    GitHubActions->>TestJob: Execute testcc job on ubuntu-22.04
    TestJob->>TestJob: Run tests
    TestJob-->>GitHubActions: Tests completed
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (5)
.github/workflows/codeql.yml (1)

CUDA Version Mismatch Detected

The workflow uses CUDA 12.2, while the project documentation references CUDA 11.8. Please confirm the intended CUDA version and ensure consistency across the codebase.

🔗 Analysis chain

Line range hint 35-46: Verify CUDA version and approve CUDA setup step.

The addition of the CUDA setup step is appropriate for C++ analysis. However, please verify if CUDA 12.2 is the intended version, as the PR objectives mentioned CUDA 11.8.

Let's check if CUDA 11.8 is mentioned elsewhere in the project:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for mentions of CUDA 11.8 in the project

# Test: Search for 'CUDA 11.8' or 'cuda-11.8' in the project files
rg -i 'cuda(-|\s)11\.8' --type-add 'script:*.{sh,bash,zsh}' --type script --type yaml --type markdown

Length of output: 264

.github/workflows/test_cc.yml (1)

Line range hint 31-34: Consider caching libtorch to speed up workflow

To optimize the workflow execution time, consider caching the downloaded libtorch. This can significantly reduce the time spent on repeatedly downloading the same file in subsequent runs.

Here's a suggested implementation using GitHub Actions cache:

- name: Cache libtorch
  uses: actions/cache@v3
  with:
    path: libtorch
    key: ${{ runner.os }}-libtorch-2.1.2-cpu
    restore-keys: |
      ${{ runner.os }}-libtorch-

- name: Download libtorch
  if: steps.cache-libtorch.outputs.cache-hit != 'true'
  run: |
    wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.1.2%2Bcpu.zip -O libtorch.zip
    unzip libtorch.zip

This change will cache the libtorch directory and only download it if it's not found in the cache.

.github/workflows/build_cc.yml (3)

Line range hint 41-51: Approved: CUDA installation updates are correct and flexible

The CUDA installation commands have been correctly updated to target Ubuntu 22.04 (ubuntu2204). The separation of CUDA 11.8 and 12.2 installations provides flexibility for testing with different CUDA versions. The use of conditional statements ensures that the correct CUDA version is installed based on the matrix variant.

For consistency, consider adding the DEBIAN_FRONTEND: noninteractive environment variable to the CUDA 11.8 installation step as well, similar to the CUDA 12.2 step. This can help prevent any interactive prompts during the installation process.


Line range hint 54-59: Approved: ROCm installation updated for Ubuntu 22.04

The ROCm installation commands have been correctly updated to use the jammy repository, which is appropriate for Ubuntu 22.04. This change ensures compatibility with the new Ubuntu version while maintaining the overall installation process.

For improved clarity and maintainability, consider adding a comment explaining that jammy corresponds to Ubuntu 22.04. This can help future maintainers understand the reasoning behind the specific repository choice.


Line range hint 1-105: Summary: Successful update to Ubuntu 22.04 with appropriate adjustments

The changes in this file successfully address the PR objectives by pinning the CI environment to Ubuntu 22.04. This update:

  1. Ensures compatibility with CUDA 11.8 and other required software versions.
  2. Maintains the flexibility of the workflow by preserving different build variants.
  3. Updates installation commands for CUDA and ROCm to work correctly with Ubuntu 22.04.

These changes will help maintain stability in the CI process and prevent issues arising from unexpected OS updates. The overall structure and logic of the workflow remain intact, which is a positive aspect of this update.

To further improve the maintainability of this workflow:

  1. Consider using variables for Ubuntu and CUDA versions to make future updates easier.
  2. Document the reasoning behind version choices in comments within the workflow file.
  3. Regularly review and update the pinned versions to ensure they remain current with security updates and new features.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between a1f8672 and 5a688b5.

📒 Files selected for processing (3)
  • .github/workflows/build_cc.yml (1 hunks)
  • .github/workflows/codeql.yml (1 hunks)
  • .github/workflows/test_cc.yml (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
.github/workflows/codeql.yml (1)

Line range hint 1-71: Summary: Changes align with PR objectives, minor verification needed.

The updates to the CodeQL workflow file align well with the PR objectives. The runner has been pinned to Ubuntu 22.04, addressing the compatibility issues with CUDA. The addition of the CUDA setup step for C++ analysis is appropriate.

However, please verify the use of CUDA 12.2 in the setup step, as the PR objectives mentioned CUDA 11.8. If 12.2 is intentional, consider updating the PR description for clarity.

.github/workflows/build_cc.yml (1)

14-14: Approved: Pinning to Ubuntu 22.04 ensures CI stability

This change from ubuntu-latest to ubuntu-22.04 aligns perfectly with the PR objectives. It addresses the potential breaking changes introduced by GitHub's transition to Ubuntu 24.04 and ensures compatibility with CUDA 11.8. This pinning strategy will maintain stability in the CI process and prevent unexpected issues arising from OS updates.

.github/workflows/codeql.yml Show resolved Hide resolved
.github/workflows/test_cc.yml Show resolved Hide resolved
@njzjz njzjz requested a review from wanghan-iapcm October 14, 2024 20:38
Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.49%. Comparing base (a1f8672) to head (5a688b5).
Report is 1 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #4213      +/-   ##
==========================================
- Coverage   83.50%   83.49%   -0.01%     
==========================================
  Files         541      541              
  Lines       52459    52459              
  Branches     3047     3047              
==========================================
- Hits        43804    43801       -3     
  Misses       7710     7710              
- Partials      945      948       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Oct 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 15, 2024
@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Oct 15, 2024
Merged via the queue into deepmodeling:devel with commit 6fe8dde Oct 15, 2024
60 checks passed
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.

2 participants