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

fix:fix CI #2924

Merged
merged 3 commits into from
Oct 17, 2024
Merged

fix:fix CI #2924

merged 3 commits into from
Oct 17, 2024

Conversation

chejinge
Copy link
Collaborator

@chejinge chejinge commented Oct 17, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a new job to build a Docker image for the Pika project.
  • Improvements

    • Updated build environments for various jobs to ensure compatibility with specific dependencies and platforms.
    • Enhanced the installation process for dependencies on different operating systems.
    • Improved clarity and consistency in naming conventions across the CI pipeline workflow.

Copy link

coderabbitai bot commented Oct 17, 2024

Walkthrough

The pull request modifies the GitHub Actions workflow for the Pika project, enhancing clarity and consistency in naming conventions and the build process across environments. The workflow name changes from "Pika" to "Pika CI Pipeline." The build_on_ubuntu job now uses ubuntu22, while build_on_rocky specifies rockylinux:9. The build_on_macos job has updated step names and commands. A new job, build_pika_image, is introduced to build a Docker image, consolidating various setup steps.

Changes

File Change Summary
.github/workflows/pika.yml - Workflow name changed to "Pika CI Pipeline."
- build_on_ubuntu: changed runs-on from ubuntu-latest to ubuntu22, updated step names.
- build_on_rocky: retains runs-on as ubuntu-latest, specifies container: rockylinux:9, updated step names.
- build_on_macos: updated step names and installation commands.
- Added build_pika_image job to build a Docker image with various setup steps.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHub Actions
    participant Docker

    User->>GitHub Actions: Trigger build
    GitHub Actions->>GitHub Actions: Run build_on_ubuntu
    GitHub Actions->>GitHub Actions: Run build_on_rocky
    GitHub Actions->>GitHub Actions: Run build_on_macos
    GitHub Actions->>GitHub Actions: Run build_pika_image
    GitHub Actions->>Docker: Build Docker image
    Docker-->>GitHub Actions: Image built successfully
    GitHub Actions-->>User: Build completed
Loading

🐇 In the meadow, a change took flight,
With builds on Ubuntu, all feels right.
Rocky Linux joins the fun,
MacOS shines with versions spun.
Docker images, oh what a sight!
Hopping forward, we build with delight! 🌼


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.

@github-actions github-actions bot added the ☢️ Bug Something isn't working label Oct 17, 2024
Copy link

@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: 1

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

Line range hint 206-238: LGTM: New Docker image build job

The new build_pika_image job is well-structured and follows best practices for building Docker images in GitHub Actions. It correctly depends on the build_on_ubuntu job and uses appropriate actions for Docker-related tasks.

Consider adding a step to verify the existence of the Dockerfile before building:

- name: Verify Dockerfile exists
  run: |
    if [ ! -f ./ci/Dockerfile ]; then
      echo "Error: Dockerfile not found at ./ci/Dockerfile"
      exit 1
    fi

This will provide a clearer error message if the Dockerfile is missing or misplaced.

🧰 Tools
🪛 actionlint

19-19: label "ubuntu22" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6d4c9ca and e80e535.

📒 Files selected for processing (1)
  • .github/workflows/pika.yml (1 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/pika.yml

19-19: label "ubuntu22" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

🔇 Additional comments (1)
.github/workflows/pika.yml (1)

Line range hint 1-238: Summary of changes to the Pika workflow

The changes to this workflow file aim to improve the build process by specifying a particular Ubuntu version and adding Docker image building capabilities. However, there's a critical issue with the Ubuntu runner label that needs to be addressed. The new Docker build job is well-implemented and will be beneficial for the project.

Key points:

  1. The build_on_ubuntu job needs to use a valid runner label.
  2. The new build_pika_image job is a good addition to the workflow.

Please address the invalid runner label issue, and consider the suggested improvement for the Docker build job. Once these changes are made, the workflow should be more robust and provide additional functionality with the Docker image build.

🧰 Tools
🪛 actionlint

19-19: label "ubuntu22" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

@@ -16,7 +16,7 @@ jobs:
# The CMake configure and build commands are platform-agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
runs-on: ubuntu22
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix invalid runner label for Ubuntu job

The runs-on attribute for the build_on_ubuntu job has been changed to ubuntu22, which is not a valid GitHub Actions runner label. This will cause the workflow to fail.

Please update the runner label to a valid Ubuntu version. For Ubuntu 22.04, use:

-    runs-on: ubuntu22
+    runs-on: ubuntu-22.04

Alternatively, if you want to use the latest Ubuntu version, you can keep using ubuntu-latest.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
runs-on: ubuntu22
runs-on: ubuntu-22.04
🧰 Tools
🪛 actionlint

19-19: label "ubuntu22" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)

Copy link

@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: 0

🧹 Outside diff range and nitpick comments (4)
.github/workflows/pika.yml (4)

Line range hint 25-73: Improvements in the build_on_ubuntu job

The changes in this job enhance readability and consistency:

  1. Step names are more descriptive and follow a consistent pattern.
  2. The dependency installation now includes an explicit apt-get update, which is a good practice to ensure up-to-date package information.
  3. The CMake configuration and build steps use multi-line commands for better readability.

These improvements make the workflow more maintainable and easier to understand.

However, there's a potential issue with shell scripting:

Consider quoting variables in shell commands

In several shell commands (lines 36, 44, 60), variables like $BUILD_TYPE are not quoted. This could lead to word splitting or globbing if the variable contains spaces or special characters. Consider updating these lines to use double quotes around the variables.

For example, change:

run: cmake --build build --config $BUILD_TYPE

to:

run: cmake --build build --config "$BUILD_TYPE"

This change should be applied to all similar occurrences in the file.

🧰 Tools
🪛 actionlint

36-36: shellcheck reported issue in this script: SC2086:info:1:35: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting

(shellcheck)


60-60: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting

(shellcheck)


Line range hint 90-133: Improvements in the build_on_rocky job

The changes in this job mirror the improvements made in the build_on_ubuntu job:

  1. Step names are more descriptive and consistent.
  2. The dependency installation uses dnf, which is appropriate for Rocky Linux 9.
  3. The CMake configuration and build steps use multi-line commands for better readability.

These changes enhance the maintainability and clarity of the workflow.

Reminder: Quote variables in shell commands

As mentioned in the build_on_ubuntu job, remember to quote variables in shell commands (e.g., lines 108, 112, 121) to prevent potential issues with word splitting or globbing.

🧰 Tools
🪛 actionlint

107-107: shellcheck reported issue in this script: SC2086:info:1:35: Double quote to prevent globbing and word splitting

(shellcheck)


111-111: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting

(shellcheck)


121-121: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting

(shellcheck)


Line range hint 155-193: Improvements in the build_on_macos job

The changes in this job are consistent with the improvements in the other jobs:

  1. Step names are more descriptive and follow a consistent pattern.
  2. The dependency installation now includes brew update, ensuring up-to-date package information.
  3. The CMake configuration and build steps use multi-line commands for better readability.
  4. The C compiler is explicitly set to gcc-10, which provides better control over the build environment.

These changes enhance the maintainability and clarity of the workflow.

Reminder: Quote variables in shell commands

As mentioned in previous jobs, remember to quote variables in shell commands (e.g., lines 166, 171, 181) to prevent potential issues with word splitting or globbing.

🧰 Tools
🪛 actionlint

166-166: shellcheck reported issue in this script: SC2086:info:2:78: Double quote to prevent globbing and word splitting

(shellcheck)


171-171: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting

(shellcheck)


181-181: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting

(shellcheck)


Line range hint 205-238: New build_pika_image job adds valuable functionality

The addition of the build_pika_image job is a great improvement to the CI pipeline:

  1. It ensures that a Docker image can be built successfully after the Ubuntu build.
  2. It uses standard Docker GitHub Actions, following best practices.
  3. The image is built but not pushed, which is appropriate for PR checks.
  4. It downloads the artifact from the build_on_ubuntu job, ensuring consistency between the built binary and the Docker image.

This new job will help catch any issues with Docker image creation early in the development process.

Suggestion: Consider adding a comment explaining the purpose of this job

To improve maintainability, consider adding a comment before the job definition explaining its purpose and its relationship to the other jobs in the workflow. For example:

  # This job builds a Docker image for Pika using the artifact from the Ubuntu build.
  # It ensures that the Docker image can be created successfully but does not push it.
  build_pika_image:
    name: Build Pika Docker Image
    runs-on: ubuntu-latest
    needs: build_on_ubuntu

This comment would help future maintainers understand the job's role in the CI pipeline more quickly.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e80e535 and 9e1480d.

📒 Files selected for processing (1)
  • .github/workflows/pika.yml (7 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/pika.yml

36-36: shellcheck reported issue in this script: SC2086:info:1:35: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting

(shellcheck)


60-60: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting

(shellcheck)


107-107: shellcheck reported issue in this script: SC2086:info:1:35: Double quote to prevent globbing and word splitting

(shellcheck)


111-111: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting

(shellcheck)


121-121: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting

(shellcheck)


166-166: shellcheck reported issue in this script: SC2086:info:2:78: Double quote to prevent globbing and word splitting

(shellcheck)


171-171: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting

(shellcheck)


181-181: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting

(shellcheck)

🔇 Additional comments (3)
.github/workflows/pika.yml (3)

1-1: Workflow name change improves clarity

The change from "Pika" to "Pika CI Pipeline" provides a more descriptive name for the workflow, clearly indicating its purpose as a CI pipeline. This is a good improvement for maintainability.


5-7: Formatting improvement in the on section

The removal of extra spaces in the on section improves the consistency of the YAML formatting. This change enhances readability without affecting the workflow's functionality.


Line range hint 1-238: Overall improvements to the Pika CI Pipeline

The changes made to this workflow file significantly enhance the Pika CI Pipeline:

  1. Consistent naming conventions and formatting across all jobs improve readability and maintainability.
  2. Step descriptions are more detailed and accurate, making it easier to understand the purpose of each step.
  3. The addition of the build_pika_image job extends the CI pipeline to include Docker image creation, which is valuable for catching potential issues early.
  4. The use of multi-line commands for complex operations (like CMake configuration) improves readability.
  5. Updates to package management commands (e.g., including apt-get update and brew update) ensure more reliable builds.

These improvements will make the CI pipeline more robust and easier to maintain. However, remember to address the shell scripting issue by quoting variables in commands throughout the file.

Great work on enhancing this CI pipeline!

🧰 Tools
🪛 actionlint

36-36: shellcheck reported issue in this script: SC2086:info:1:35: Double quote to prevent globbing and word splitting

(shellcheck)


44-44: shellcheck reported issue in this script: SC2086:info:1:30: Double quote to prevent globbing and word splitting

(shellcheck)


60-60: shellcheck reported issue in this script: SC2086:info:1:10: Double quote to prevent globbing and word splitting

(shellcheck)

@chejinge chejinge merged commit 218b68b into OpenAtomFoundation:unstable Oct 17, 2024
12 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Oct 18, 2024
@chejinge chejinge deleted the FIXCI branch November 4, 2024 07:56
chejinge added a commit that referenced this pull request Dec 25, 2024
* fix:fix CI

---------

Co-authored-by: chejinge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☢️ Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants