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

feat: add rocky linux env in ci test (#2806) #2817

Closed
wants to merge 2 commits into from

Conversation

QlQlqiqi
Copy link
Contributor

@QlQlqiqi QlQlqiqi commented Jul 21, 2024

fix: #2806

Summary by CodeRabbit

  • New Features

    • Introduced a new CI/CD job for building and releasing artifacts specifically in a Rocky Linux environment.
    • Added support to identify Rocky Linux in the system version check, enhancing compatibility.
  • Bug Fixes

    • Improved build configuration by ensuring the correct libraries are linked for Rocky Linux.
  • Documentation

    • Updated workflow definitions to include new jobs and dependencies for streamlined CI/CD processes.

@github-actions github-actions bot added ✏️ Feature New feature or request 🧹 Updates This will not be worked on labels Jul 21, 2024
Copy link

coderabbitai bot commented Jul 21, 2024

Walkthrough

The recent changes enhance the CI/CD workflows by introducing support for Rocky Linux, replacing CentOS in GitHub Actions configurations. New jobs for building and releasing software specifically for Rocky Linux have been added, along with adjustments in related scripts and configuration files. This transition improves compatibility and stability within the build environment, ensuring that the software can be effectively tested and deployed on Rocky Linux systems.

Changes

Files Change Summary
.github/workflows/pika.yml Added build_on_rocky job for building on Rocky Linux, including setup and testing steps.
.github/workflows/release.yml Introduced rocky job for release processes on Rocky Linux; updated dependencies in the release job.
CMakeLists.txt Replaced "CentOS" with "Rocky" in library configuration; added GCC toolset link directory.
ci/release-build.sh Added conditional support for Rocky Linux with GCC toolset and AddressSanitizer flags.
utils/Get_OS_Version.sh Enhanced Get_Dist_Name() to identify Rocky Linux and assign proper package manager.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Build Job
    participant Release Job
    participant Rocky Linux

    GitHub Actions->>Build Job: Trigger build_on_rocky
    Build Job->>Rocky Linux: Setup environment
    Build Job->>Rocky Linux: Install dependencies
    Build Job->>Rocky Linux: Run tests
    Rocky Linux-->>Build Job: Return test results
    GitHub Actions->>Release Job: Trigger rocky
    Release Job->>Rocky Linux: Prepare release artifacts
    Release Job->>Rocky Linux: Upload artifacts
Loading

Assessment against linked issues

Objective Addressed Explanation
Use Rocky Linux instead of CentOS in CI workflow (#2806)
Ensure stable CI environment on Rocky Linux (#2806)
Build and release support for Rocky Linux (#2806)

Poem

🐇 In fields of code, where changes bloom,
A rabbit hops, dispelling gloom.
With Rocky Linux, we leap and cheer,
Our builds now strong, our path is clear!
No more CentOS, we've found our way,
Hopping forward, come what may! 🌼✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

@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, codebase verification and nitpick comments (3)
.github/workflows/pika.yml (1)

160-166: Ensure successful execution of integration tests.

The integration tests fail due to the missing pika binary. Ensure that the pika binary is built and available in the expected location before running the integration tests. Verify the setup steps to include building or installing pika.

  • Missing pika binary required for integration tests.
  • Ensure the pika binary is built and available in the expected location.
Analysis chain

Ensure successful execution of integration tests.

The integration tests include starting codis, pika master, and pika slave. Ensure that all integration tests execute successfully on Rocky Linux.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the execution of integration tests on Rocky Linux.

# Test: Check if integration tests execute successfully. Expect: No errors.
cd build && chmod +x ../tests/integration/start_master_and_slave.sh && ../tests/integration/start_master_and_slave.sh
chmod +x ../tests/integration/start_codis.sh && ../tests/integration/start_codis.sh

Length of output: 228


Script:

#!/bin/bash
# Description: Verify the existence of the build directory and the integration test scripts.

# Search for the build directory
fd build --type d

# Search for the start_master_and_slave.sh script
fd start_master_and_slave.sh

# Search for the start_codis.sh script
fd start_codis.sh

Length of output: 147


Script:

#!/bin/bash
# Description: Verify the execution of integration test scripts from their current location.

# Make the scripts executable and run them
chmod +x tests/integration/start_master_and_slave.sh && tests/integration/start_master_and_slave.sh
chmod +x tests/integration/start_codis.sh && tests/integration/start_codis.sh

Length of output: 3492


Script:

#!/bin/bash
# Description: Verify the existence of required configuration files and binaries for integration tests.

# Search for the pika.conf file
fd pika.conf

# Search for the pika binary
fd pika --type f

# Search for the codis directory
fd codis --type d

Length of output: 4830

CMakeLists.txt (2)

321-324: Issues found with Snappy library paths for Rocky Linux.

The libsnappy.a file does not exist at the expected path ${CMAKE_CURRENT_SOURCE_DIR}/deps/lib64/libsnappy.a. Please verify the library setup and ensure that the file is correctly placed.

  • CMakeLists.txt line 321-324
Analysis chain

Verify the library paths for Snappy on Rocky Linux.

The library paths for Snappy are conditionally set for Rocky Linux. Ensure that these paths are correct and the libraries are available at the specified locations.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the library paths for Snappy on Rocky Linux.

# Test: Check if the Snappy libraries exist at the specified paths. Expect: Files exist.
[ -f "${INSTALL_LIBDIR_64}/libsnappy.a" ]

Length of output: 25


Script:

#!/bin/bash
# Search for the definition of INSTALL_LIBDIR_64 in the codebase
rg 'INSTALL_LIBDIR_64'

Length of output: 756


Script:

#!/bin/bash
# Search for the definition of STAGED_INSTALL_PREFIX in the codebase
rg 'STAGED_INSTALL_PREFIX'

Length of output: 1873


Script:

#!/bin/bash
# Verify the existence of the libsnappy.a file at the constructed path
if [ -f "$(pwd)/deps/lib64/libsnappy.a" ]; then
  echo "libsnappy.a exists"
else
  echo "libsnappy.a does not exist"
fi

Length of output: 124


398-401: Fmt libraries not found at the specified paths.

The fmt libraries were not found at the expected paths (${STAGED_INSTALL_PREFIX}/lib64/libfmtd.a or ${STAGED_INSTALL_PREFIX}/lib64/libfmt.a). Please verify the library paths for Rocky Linux.

  • Ensure that the paths are correct and the libraries are available at the specified locations.
Analysis chain

Verify the library paths for fmt on Rocky Linux.

The library paths for fmt are conditionally set for Rocky Linux. Ensure that these paths are correct and the libraries are available at the specified locations.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the library paths for fmt on Rocky Linux.

# Test: Check if the fmt libraries exist at the specified paths. Expect: Files exist.
[ -f "${INSTALL_LIBDIR_64}/${LIB_FMT}" ]

Length of output: 14


Script:

#!/bin/bash
# Description: Find the definitions of INSTALL_LIBDIR_64 and LIB_FMT in the codebase.

# Search for the definition of INSTALL_LIBDIR_64
rg "set\(INSTALL_LIBDIR_64" -A 2

# Search for the definition of LIB_FMT
rg "set\(LIB_FMT" -A 2

Length of output: 368


Script:

#!/bin/bash
# Description: Verify the existence of fmt libraries at the specified paths on Rocky Linux.

# Search for the definition of STAGED_INSTALL_PREFIX
rg "set\(STAGED_INSTALL_PREFIX" -A 2

# Check if the fmt libraries exist at the specified paths
if [ -n "${STAGED_INSTALL_PREFIX}" ]; then
  [ -f "${STAGED_INSTALL_PREFIX}/lib64/libfmtd.a" ] || [ -f "${STAGED_INSTALL_PREFIX}/lib64/libfmt.a" ]
else
  echo "STAGED_INSTALL_PREFIX is not defined."
fi

Length of output: 356


Script:

#!/bin/bash
# Description: Verify the existence of fmt libraries at the specified paths on Rocky Linux.

# Manually set STAGED_INSTALL_PREFIX based on the definition in CMakeLists.txt
STAGED_INSTALL_PREFIX=$(pwd)/deps

# Check if the fmt libraries exist at the specified paths
if [ -n "${STAGED_INSTALL_PREFIX}" ]; then
  if [ -f "${STAGED_INSTALL_PREFIX}/lib64/libfmtd.a" ] || [ -f "${STAGED_INSTALL_PREFIX}/lib64/libfmt.a" ]; then
    echo "Fmt libraries found."
  else
    echo "Fmt libraries not found."
  fi
else
  echo "STAGED_INSTALL_PREFIX is not defined."
fi

Length of output: 255

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6c0e0d4 and 93ec9f5.

Files selected for processing (5)
  • .github/workflows/pika.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • CMakeLists.txt (8 hunks)
  • ci/release-build.sh (1 hunks)
  • utils/Get_OS_Version.sh (1 hunks)
Additional comments not posted (16)
utils/Get_OS_Version.sh (1)

11-13: Add Rocky Linux detection.

The new conditional check for Rocky Linux is correctly added and follows the existing pattern for other distributions.

ci/release-build.sh (1)

25-27: Add Rocky Linux configuration in CMake.

The new conditional branch for Rocky Linux correctly enables the GCC toolset version 13 and configures CMake with AddressSanitizer for debugging.

.github/workflows/release.yml (2)

50-90: Add Rocky Linux job in GitHub Actions workflow.

The new job for Rocky Linux is correctly added with steps for installing dependencies, checking out the source code, executing the release build script, calculating checksums, and uploading artifacts.


93-93: Update release job dependencies.

The release job dependencies are correctly updated to include the new rocky job.

.github/workflows/pika.yml (7)

116-122: Check the installation of dependencies.

The dependencies are installed using DNF. Ensure that all required packages are available in the Rocky Linux repositories and the installation commands execute successfully.


134-137: Ensure correct CMake configuration.

The CMake configuration step sets various build options. Ensure that the configuration is correct and compatible with Rocky Linux.

Verification successful

CMake configuration appears correct and compatible with Rocky Linux.

The CMake configuration options in the CMakeLists.txt file align with the settings specified in the script. The CMAKE_BUILD_TYPE, USE_PIKA_TOOLS, and CMAKE_CXX_FLAGS_DEBUG options are correctly set or available for configuration.

  • CMAKE_BUILD_TYPE is set to RELEASE by default.
  • USE_PIKA_TOOLS is an available option.
  • CMAKE_CXX_FLAGS_DEBUG includes the -fsanitize=address flag but is commented out.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the CMake configuration for Rocky Linux.

# Test: Check if CMake configuration executes successfully. Expect: No errors.
cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address .

Length of output: 188


Script:

#!/bin/bash
# Searching for CMake configuration options in the codebase
rg -A 5 'set\(CMAKE_BUILD_TYPE' .
rg -A 5 'option\(USE_PIKA_TOOLS' .
rg -A 5 'set\(CMAKE_CXX_FLAGS_DEBUG' .

Length of output: 2250


87-109: Verify the mirror setup for Rocky Linux.

The mirror setup for Rocky Linux is configured to use Aliyun mirrors. Ensure that these mirrors are reliable and accessible from the CI environment.


152-158: Ensure successful execution of tests.

The test steps include running CTest and unit tests. Ensure that all tests execute successfully on Rocky Linux.


168-175: Ensure successful execution of Go E2E tests.

The Go E2E tests include running tests for pika keys analysis and integration tests. Ensure that all Go E2E tests execute successfully on Rocky Linux.


111-114: Ensure the GPG key import and DNF cache setup.

The GPG key is imported and the DNF cache is cleaned and rebuilt. Ensure that the key import URL is correct and the DNF commands execute successfully.


148-150: Ensure successful build execution.

The build step uses CMake to build the project. Ensure that the build executes successfully on Rocky Linux.

CMakeLists.txt (5)

25-25: Verify the link directory for GCC toolset.

The link directory for the GCC toolset is added. Ensure that this directory is correct and necessary for the build process.


359-362: Verify the library paths for Zstandard on Rocky Linux.

The library paths for Zstandard are conditionally set for Rocky Linux. Ensure that these paths are correct and the libraries are available at the specified locations.


723-726: Verify the library paths for RocksDB on Rocky Linux.

The library paths for RocksDB are conditionally set for Rocky Linux. Ensure that these paths are correct and the libraries are available at the specified locations.


286-289: Verify the library paths for Glog on Rocky Linux.

The library paths for Glog are conditionally set for Rocky Linux. Ensure that these paths are correct and the libraries are available at the specified locations.


Line range hint 163-169: Verify the library paths for Google Test on Rocky Linux.

The library paths for Google Test are conditionally set for Rocky Linux. Ensure that these paths are correct and the libraries are available at the specified locations.

@QlQlqiqi
Copy link
Contributor Author

there are some error

@QlQlqiqi QlQlqiqi closed this Jul 21, 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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 93ec9f5 and 1983b7f.

Files selected for processing (1)
  • utils/Get_OS_Version.sh (1 hunks)

Comment on lines +11 to +13
elif grep -Eqii "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
DISTRO='Rocky'
PM='nfs'
Copy link

Choose a reason for hiding this comment

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

Correctly identify Rocky Linux but verify the package manager.

The logic correctly identifies "Rocky" Linux. However, the package manager is set to 'nfs', which seems incorrect. The appropriate package manager for Rocky Linux should be 'yum' or 'dnf'.

-        PM='nfs'
+        PM='yum'
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
elif grep -Eqii "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
DISTRO='Rocky'
PM='nfs'
elif grep -Eqii "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
DISTRO='Rocky'
PM='yum'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Feature New feature or request 🧹 Updates This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

using rocky linux instead of centos in github ci workflow
1 participant