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: enable Open CAS Framework #311

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

liyimeng
Copy link

Enable OCF https://github.com/Open-CAS, prepare to add caching to V2 data engine

partially fix longhorn/longhorn#10292

Which issue(s) this PR fixes:

Issue #10292

What this PR does / why we need it:

Prepare for OCF support

Special notes for your reviewer:

This is a minor change, unlikely adding too much into the finally binary. So even we are not able to implement caching right now, this won't add too much negative impact, I guess.

Additional documentation or context

Copy link

coderabbitai bot commented Jan 24, 2025

Walkthrough

The pull request modifies the Dockerfile.dapper to update the SPDK (Storage Performance Development Kit) build configuration. The key change involves adding the --with-ocf option to the ./configure command for both amd64 and arm64 architectures. This modification potentially enables support for the Open Caching Framework (OCF) during the SPDK build process. Additionally, a minor correction was made to ensure ldconfig is properly executed with a correct newline character.

Changes

File Change Summary
Dockerfile.dapper Added --with-ocf to ./configure command for both amd64 and arm64 architectures; corrected newline for ldconfig execution.

Suggested reviewers

  • innobead
  • shuo-wu

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7325023 and aaa7634.

📒 Files selected for processing (1)
  • Dockerfile.dapper (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Dockerfile.dapper
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Summary

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

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

🧹 Nitpick comments (2)
Dockerfile.dapper (2)

53-59: Consider adding build-time verification for OCF.

While the OCF configuration is added, it would be beneficial to verify that OCF was successfully enabled during the build process.

Consider adding these verification steps after the make commands:

         ./configure --target-arch=nehalem --disable-tests --disable-unit-tests --disable-examples --without-nvme-cuse --with-ocf && \
         make -j$(nproc) && \
-        make install; \
+        make install && \
+        # Verify OCF was properly enabled
+        ldd /usr/local/lib/libspdk.so | grep -i ocf; \
         elif [ ${ARCH} = "arm64" ]; then \
         ./configure --target-arch=native --disable-tests --disable-unit-tests --disable-examples --without-nvme-cuse --with-ocf && \
         DPDKBUILD_FLAGS="-Dplatform=generic" make -j$(nproc) && \
-        make install; \
+        make install && \
+        # Verify OCF was properly enabled
+        ldd /usr/local/lib/libspdk.so | grep -i ocf;

53-59: Document OCF configuration impact.

Since this is preparatory work for V2 data engine caching capabilities:

  1. Consider documenting the OCF configuration in the project's documentation
  2. Add a comment in the Dockerfile explaining why OCF is enabled
  3. Consider creating a feature flag or build argument to conditionally enable OCF support

This will help future maintainers understand the purpose and impact of these changes.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44753b5 and c222bc3.

📒 Files selected for processing (1)
  • Dockerfile.dapper (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Summary
🔇 Additional comments (3)
Dockerfile.dapper (3)

Line range hint 1-1: Verify golang version compatibility.

The base image registry.suse.com/bci/golang:1.23 specifies Go version 1.23, which doesn't exist yet (current stable is 1.21.x as of January 2025).

Please verify if this is a typo or if there's a specific reason for using this version. Consider using a stable version like 1.21.


94-94: LGTM! Good addition of ldconfig.

The addition of ldconfig is necessary after installing new shared libraries to update the shared library cache. This is a good practice.


53-53: Verify OCF dependencies and compatibility.

The addition of --with-ocf flag enables OCF support in SPDK. However, we should ensure all necessary OCF dependencies are properly installed.

Run this script to check if OCF dependencies are available in the base image:

Also applies to: 57-57

✅ Verification successful

OCF dependencies are properly handled via git submodule

The --with-ocf flag is correctly configured to use OCF's git submodule by default, which ensures all necessary OCF dependencies are built from source during SPDK compilation. No additional system packages are required.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for OCF dependencies in the base image

# Check if OCF related packages are available in the repositories
zypper search -s ocf
zypper search -s libocf

# Verify if SPDK's OCF documentation mentions additional dependencies
curl -s https://raw.githubusercontent.com/spdk/spdk/master/doc/ocf.md | grep -i "requirement\|depend\|install"

Length of output: 355


Script:

#!/bin/bash
# Check Dockerfile base image and OCF setup
fd Dockerfile --exec cat {} \;

# Check SPDK's configure script for OCF requirements
curl -s https://raw.githubusercontent.com/spdk/spdk/master/configure | grep -A 5 -B 5 "with-ocf"

# Look for any OCF setup files
fd -t f -e sh -e mk | xargs grep -l "ocf"

Length of output: 1309

@liyimeng liyimeng changed the title Enable OpenCache Framework Enable Open CAS Framework Jan 24, 2025
@liyimeng liyimeng force-pushed the main branch 4 times, most recently from cec88ac to e0a241c Compare February 10, 2025 18:21
@liyimeng liyimeng changed the title Enable Open CAS Framework feat: enable Open CAS Framework Feb 10, 2025
longhorn 10292

Enable OCF https://github.com/Open-CAS, prepare to add caching to V2 data engine
partially fix longhorn/longhorn#10292

Signed-off-by: Liyi Meng <[email protected]>
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.

[FEATURE] V2 Engine Supports Cache by OpenCAS
2 participants