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 a new test env (rocky linux) in github ci. (#2806) #2823

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

QlQlqiqi
Copy link
Contributor

@QlQlqiqi QlQlqiqi commented Jul 23, 2024

fix: #2806

Summary by CodeRabbit

  • New Features

    • Introduced CI/CD jobs to support builds and releases specifically for the Rocky Linux environment.
    • Enhanced compatibility by adding checks and configurations for Rocky Linux in various scripts and build processes.
  • Bug Fixes

    • Resolved compatibility issues related to library configurations by updating conditional statements for operating system detection.
  • Chores

    • Updated scripts to streamline dependency installation and configuration for Rocky Linux.

Copy link

coderabbitai bot commented Jul 23, 2024

Walkthrough

The recent updates enhance the CI/CD workflows by integrating support for Rocky Linux, replacing CentOS. This transition is facilitated through the addition of new jobs in GitHub Actions, updated dependency management, and modifications in scripts and configuration files to ensure compatibility with the Rocky environment. These changes improve the reliability and performance of builds and tests on the Rocky Linux platform.

Changes

Files Change Summary
.github/workflows/pika.yml, .github/workflows/release.yml Introduced new jobs for Rocky Linux, added dependency installation steps, and updated the workflow to include Rocky-specific build processes.
CMakeLists.txt, ci/release-build.sh Modified conditional statements for OS detection, added support for Rocky Linux, and updated installation/configuration functions to accommodate the new environment.
codis/Makefile Added -buildvcs=false flag to go build commands to exclude version control info from builds, standardizing the approach across multiple targets.
utils/Get_OS_Version.sh Enhanced Get_Dist_Name function to include detection logic for Rocky Linux, expanding OS identification capabilities within the script.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Build Environment
    participant CMake
    participant Tests

    GitHub Actions->>Build Environment: Start Rocky Linux job
    Build Environment->>CMake: Configure build with dependencies
    CMake->>Build Environment: Build project
    Build Environment->>Tests: Run unit and integration tests
    Tests-->>Build Environment: Return test results
    Build Environment-->>GitHub Actions: Complete job
Loading

Assessment against linked issues

Objective Addressed Explanation
Transition CI workflow to Rocky Linux (#2806)
Ensure compatibility for builds and tests
Maintain existing functionality while adapting

Poem

🐇 In fields of code, we hop with glee,
Rocky’s our home, as sturdy as a tree.
Builds now flourish, no more dismay,
In our new haven, we’ll play all day!
With every test, we bound and leap,
In this bright world, our dreams run deep! 🌼


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.

@github-actions github-actions bot added ✏️ Feature New feature or request 🧹 Updates This will not be worked on labels Jul 23, 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: 2

Outside diff range, codebase verification and nitpick comments (4)
CMakeLists.txt (4)

321-324: The specified Snappy library paths do not exist.

The paths "/path/to/install/lib64/libsnappy.a" and "/path/to/install/lib/libsnappy.a" are placeholders. Please verify and update the correct paths for the Snappy library in the project.

Analysis chain

Verify the Snappy library paths.

Ensure that the specified paths for Snappy libraries are correct and necessary for the project.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the Snappy library paths are correct and exist.

# Test: Check if the libraries exist. Expect: Libraries exist.
if [ -f "/path/to/install/lib64/libsnappy.a" ] || [ -f "/path/to/install/lib/libsnappy.a" ]; then
  echo "libsnappy.a exists."
else
  echo "libsnappy.a does not exist."
fi

Length of output: 158


25-25: The specified link directory path does not exist.

The directory /opt/rh/gcc-toolset-13/root/lib/gcc/x86_64-redhat-linux/13 specified in the link_directories directive does not exist. Please verify the path or ensure that the necessary toolset is installed.

  • Line 25 in CMakeLists.txt: link_directories("/opt/rh/gcc-toolset-13/root/lib/gcc/x86_64-redhat-linux/13")
Analysis chain

Verify the link directory path.

Ensure that the specified path /opt/rh/gcc-toolset-13/root/lib/gcc/x86_64-redhat-linux/13 is correct and necessary for the project.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the link directory path is correct and exists.

# Test: Check if the directory exists. Expect: Directory exists.
if [ -d "/opt/rh/gcc-toolset-13/root/lib/gcc/x86_64-redhat-linux/13" ]; then
  echo "Directory exists."
else
  echo "Directory does not exist."
fi

Length of output: 132


723-726: Verify the RocksDB library paths.

The specified paths for the RocksDB library, ${INSTALL_LIBDIR_64}/librocksdb.a and ${INSTALL_LIBDIR}/librocksdb.a, do not exist. Please verify and correct the paths to ensure the libraries are correctly referenced.

  • Paths checked: /home/jailuser/git/deps/lib/librocksdb.a and /home/jailuser/git/deps/lib64/librocksdb.a
Analysis chain

Verify the RocksDB library paths.

Ensure that the specified paths for RocksDB libraries are correct and necessary for the project.


To verify the correct paths for the RocksDB library, we need to search the codebase for the actual installation paths used. Let's look for occurrences of librocksdb.a within the CMakeLists.txt and other relevant files to identify the correct paths.


To determine the actual values of the placeholders ${INSTALL_LIBDIR_64} and ${INSTALL_LIBDIR}, we need to search for their definitions or assignments in the codebase.


To verify the actual paths for the RocksDB library, we need to determine the value of STAGED_INSTALL_PREFIX. Let's search for the definition or assignment of STAGED_INSTALL_PREFIX in the codebase.


To verify the existence of the actual paths for the RocksDB library, we need to check if ${CMAKE_CURRENT_SOURCE_DIR}/deps/lib/librocksdb.a and ${CMAKE_CURRENT_SOURCE_DIR}/deps/lib64/librocksdb.a exist in the repository.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the RocksDB library paths are correct and exist.

# Test: Check if the libraries exist. Expect: Libraries exist.
if [ -f "/path/to/install/lib64/librocksdb.a" ] || [ -f "/path/to/install/lib/librocksdb.a" ]; then
  echo "librocksdb.a exists."
else
  echo "librocksdb.a does not exist."
fi

Length of output: 162


Script:

#!/bin/bash
# Search for occurrences of 'librocksdb.a' in the codebase to find the actual installation paths.
rg 'librocksdb.a' -A 3

Length of output: 411


Script:

#!/bin/bash
# Search for definitions or assignments of INSTALL_LIBDIR_64 and INSTALL_LIBDIR in the codebase.
rg 'INSTALL_LIBDIR_64|INSTALL_LIBDIR' -A 3

Length of output: 4426


Script:

#!/bin/bash
# Search for definitions or assignments of STAGED_INSTALL_PREFIX in the codebase.
rg 'STAGED_INSTALL_PREFIX' -A 3

Length of output: 4487


Script:

#!/bin/bash
# Verify the existence of the actual paths for the RocksDB library.
if [ -f "$(pwd)/deps/lib/librocksdb.a" ] || [ -f "$(pwd)/deps/lib64/librocksdb.a" ]; then
  echo "librocksdb.a exists."
else
  echo "librocksdb.a does not exist."
fi

Length of output: 190


286-289: Issues found with GLog library paths.

The specified paths for libglog.a do not exist in the expected directories. Please verify the correct paths for the GLog libraries and update the CMakeLists.txt file accordingly.

  • CMakeLists.txt: Lines 286-289
Analysis chain

Verify the GLog library paths.

Ensure that the specified paths for GLog libraries are correct and necessary for the project.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the GLog library paths are correct and exist.

# Test: Check if the libraries exist. Expect: Libraries exist.
if [ -f "/path/to/install/lib64/libglog.a" ] || [ -f "/path/to/install/lib/libglog.a" ]; then
  echo "libglog.a exists."
else
  echo "libglog.a does not exist."
fi

Length of output: 150


Script:

#!/bin/bash
# Description: Search for the libglog.a file in the project directory to identify the correct paths.

# Find all instances of libglog.a in the project directory
fd -H -I -t f -i 'libglog.a'

Length of output: 28


Script:

#!/bin/bash
# Description: Search for all library paths set in the CMakeLists.txt to identify any potential issues.

# Find all lines setting library paths in the CMakeLists.txt
rg 'set\(.*_LIBRARY' -A 2

Length of output: 3089


Script:

#!/bin/bash
# Description: Search for the definitions of INSTALL_LIBDIR and INSTALL_LIBDIR_64 in the CMakeLists.txt file.

# Find all lines defining INSTALL_LIBDIR and INSTALL_LIBDIR_64 in the CMakeLists.txt
rg 'set\(INSTALL_LIBDIR' -A 2
rg 'set\(INSTALL_LIBDIR_64' -A 2

Length of output: 468


Script:

#!/bin/bash
# Description: Search for the definition of STAGED_INSTALL_PREFIX in the CMakeLists.txt file.

# Find all lines defining STAGED_INSTALL_PREFIX in the CMakeLists.txt
rg 'set\(STAGED_INSTALL_PREFIX' -A 2

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 a428088 and 4839da4.

Files selected for processing (6)
  • .github/workflows/pika.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • CMakeLists.txt (8 hunks)
  • ci/release-build.sh (2 hunks)
  • codis/Makefile (1 hunks)
  • utils/Get_OS_Version.sh (1 hunks)
Files skipped from review due to trivial changes (1)
  • codis/Makefile
Additional comments not posted (21)
utils/Get_OS_Version.sh (1)

11-13: Verify the package manager setting for Rocky Linux.

The package manager (PM) is set to 'nfs', which seems unusual. It might be a typo and should likely be 'dnf'.

- PM='nfs'
+ PM='dnf'
ci/release-build.sh (2)

12-17: LGTM!

The added support for Rocky Linux in the install_deps function looks good. The necessary dependencies are appropriately installed using dnf.


31-33: LGTM!

The added support for Rocky Linux in the configure_cmake function looks good. The GCC toolset environment is appropriately sourced, and CMake is configured with address sanitization for debugging.

.github/workflows/release.yml (4)

50-90: LGTM!

The addition of the rocky job in the GitHub Actions workflow looks good. The job is well-configured to run on ubuntu-latest within a Rocky Linux 9 container and performs all necessary steps for the build and release process.


59-63: LGTM!

The installation of dependencies in the rocky job looks good. The necessary packages are appropriately installed using dnf.


65-69: LGTM!

The checkout of source code in the rocky job looks good. The actions/checkout@v3 action is used with a fetch depth of 0, which is appropriate for the build process.


70-89: LGTM!

The build and checksum steps in the rocky job look good. The ci/release-build.sh script is appropriately used to perform the installation, build, and checksum calculation.

.github/workflows/pika.yml (11)

124-128: Set up Go environment.

The Go environment setup looks good. Ensure that the specified Go version is compatible with the project requirements.


129-133: Checkout repository.

The repository checkout step looks good. Ensure that the fetch-depth: 0 is necessary for the project's requirements.


134-138: Ensure CMake configuration compatibility.

The CMake configuration step looks good. Ensure that the specified options and flags are compatible with the Rocky Linux environment.


139-148: Utilize caching effectively.

The caching steps look good. Ensure that the cache keys are unique and effective in reducing build times.


149-153: Build project.

The build step looks good. Ensure that the source /opt/rh/gcc-toolset-13/enable command is necessary and correctly enables the required toolset.


154-157: Run tests.

The test step looks good. Ensure that the tests are comprehensive and cover all critical functionality.


158-160: Run unit tests.

The unit test step looks good. Ensure that the ./pikatests.sh all script is correctly configured and covers all unit tests.


162-168: Start services for integration tests.

The step to start services for integration tests looks good. Ensure that the scripts start_master_and_slave.sh and start_codis.sh are correctly configured and start the necessary services.


170-177: Run Go E2E tests.

The Go E2E test step looks good. Ensure that the tests are comprehensive and cover all critical functionality.


111-114: Verify the GPG key URL.

Ensure that the GPG key URL is correct and accessible. Consider using a more reliable source if necessary.

Verification successful

The GPG key URL is correct and accessible.

The URL https://mirrors.jlu.edu.cn/rocky/RPM-GPG-KEY-Rocky-9 returned an HTTP/2 200 status, confirming its validity.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the GPG key URL is correct and accessible.

# Test: Fetch the GPG key. Expect: Successful fetch.
curl -I https://mirrors.jlu.edu.cn/rocky/RPM-GPG-KEY-Rocky-9

Length of output: 683


81-85: Ensure the container image is up-to-date.

The job is configured to use the rockylinux:9 container image. Ensure that this image is up-to-date and includes the latest security patches.

CMakeLists.txt (3)

359-362: Verify the Zstd library paths.

Ensure that the specified paths for Zstd libraries are correct and necessary for the project.


398-401: Verify the Fmt library paths.

Ensure that the specified paths for Fmt libraries are correct and necessary for the project.

Verification successful

Verify the Fmt library paths.

The paths for the Fmt libraries are correctly set based on the OS version and build type in the CMakeLists.txt file. Ensure that the actual files exist in the specified paths in the correct environment.

  • Definitions:
    • INSTALL_LIBDIR_64 is set to ${STAGED_INSTALL_PREFIX}/lib64
    • INSTALL_LIBDIR is set to ${STAGED_INSTALL_PREFIX}/lib
    • LIB_FMT is conditionally set to either libfmtd.a or libfmt.a based on the LIB_BUILD_TYPE.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the Fmt library paths are correct and exist.

# Test: Check if the libraries exist. Expect: Libraries exist.
if [ -f "/path/to/install/lib64/libfmt.a" ] || [ -f "/path/to/install/lib/libfmt.a" ]; then
  echo "libfmt.a exists."
else
  echo "libfmt.a does not exist."
fi

Length of output: 146


Script:

#!/bin/bash
# Description: Search for the definitions of INSTALL_LIBDIR_64, INSTALL_LIBDIR, and LIB_FMT in the CMakeLists.txt and related files.

# Find the definition of INSTALL_LIBDIR_64
echo "Searching for INSTALL_LIBDIR_64 definition:"
rg --context 5 'INSTALL_LIBDIR_64' CMakeLists.txt

# Find the definition of INSTALL_LIBDIR
echo "Searching for INSTALL_LIBDIR definition:"
rg --context 5 'INSTALL_LIBDIR' CMakeLists.txt

# Find the definition of LIB_FMT
echo "Searching for LIB_FMT definition:"
rg --context 5 'LIB_FMT' CMakeLists.txt

Length of output: 9145


Line range hint 163-168:
Verify the GTest library paths.

Ensure that the specified paths for GTest libraries are correct and necessary for the project.

.github/workflows/pika.yml Outdated Show resolved Hide resolved
.github/workflows/pika.yml Outdated Show resolved Hide resolved
@AlexStocks
Copy link
Collaborator

please handle the rabbit AI review comment.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4839da4 and 4401a39.

Files selected for processing (2)
  • .github/workflows/pika.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/pika.yml
  • .github/workflows/release.yml

@AlexStocks AlexStocks merged commit bd1d7af into OpenAtomFoundation:unstable Jul 29, 2024
13 checks passed
chejinge pushed a commit that referenced this pull request Jul 31, 2024
* add a new test env (rocky linux) in github ci.
cheniujh pushed a commit to cheniujh/pika that referenced this pull request Sep 24, 2024
cheniujh pushed a commit to cheniujh/pika that referenced this pull request Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.5.5 4.0.1 ✏️ 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
4 participants