-
Notifications
You must be signed in to change notification settings - Fork 902
chore: add cmds for rocks and pebble builds #2007
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
6180f5a
add support for rocks and pebble in dockerfile
GAtom22 c7d9dbf
add changelog
GAtom22 3f1bbe6
Merge branch 'main' into GAtom22/dockerfile-rocks
GAtom22 3c99d73
wip - add script to build rocksdb
GAtom22 dcf7ac2
add librocks installation script
GAtom22 ba19564
Merge branch 'GAtom22/dockerfile-rocks' of https://github.com/evmos/e…
GAtom22 7ca1019
Merge branch 'main' into GAtom22/dockerfile-rocks
GAtom22 c0239fe
update changelog msg
GAtom22 eaf30e7
fix lint issues
GAtom22 5284d4e
fix lint issue
GAtom22 3ef1ac8
refactor
GAtom22 851963f
refactor
GAtom22 d5c8602
add comment
GAtom22 927b5ec
Merge branch 'main' into GAtom22/dockerfile-rocks
Vvaradinov eeaf4bb
update docker dep
GAtom22 3aafb26
Merge branch 'main' into GAtom22/dockerfile-rocks
GAtom22 7c05b37
add dockerfile for build with librocksdb
GAtom22 5a76cc5
update chlog
GAtom22 2916b0f
add rocks v as arg
GAtom22 e692dbd
fix lint issues
GAtom22 968db18
fix script
GAtom22 62e5f33
refactor dockerfile
GAtom22 d3a614e
Merge branch 'main' into GAtom22/dockerfile-rocks
GAtom22 fdbf4cf
update docker dep
GAtom22 df356c0
Merge branch 'GAtom22/dockerfile-rocks' of https://github.com/evmos/e…
GAtom22 726f06e
Merge branch 'main' into GAtom22/dockerfile-rocks
GAtom22 8f79709
Merge branch 'main' into GAtom22/dockerfile-rocks
fedekunze File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/bin/bash | ||
|
||
ROCKSDB_VERSION=${1:-"8.5.3"} | ||
|
||
# Check if RocksDB is already installed | ||
if [[ $(find /usr/lib -name "librocksdb.so.${ROCKSDB_VERSION}" -print -quit) ]]; then | ||
read -r -p "RocksDB version ${ROCKSDB_VERSION} is already installed. Do you want to reinstall it? (yes/no): " choice | ||
case "$choice" in | ||
y | yes | Yes | YES) | ||
echo "Reinstalling RocksDB..." | ||
rm -rf /usr/lib/librocksdb* | ||
;; | ||
n | no | No | NO) | ||
echo "Skipping RocksDB installation." | ||
exit 0 | ||
;; | ||
*) | ||
echo "Invalid choice. Please enter 'yes' or 'no'." | ||
exit 1 | ||
;; | ||
esac | ||
else | ||
# RocksDB is not installed, proceed with installation | ||
echo "RocksDB is not installed. Proceeding with installation..." | ||
fi | ||
|
||
# Check the OS type and perform different actions | ||
if [[ $(uname) == "Linux" ]]; then | ||
# Check Linux distribution | ||
if [[ -f /etc/os-release ]]; then | ||
source /etc/os-release | ||
|
||
if [[ "$ID" == "ubuntu" ]]; then | ||
# Ubuntu specific dep installation | ||
echo "Installing RocksDB dependencies..." | ||
apt-get install libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev build-essential clang | ||
|
||
elif [[ "$ID" == "alpine" ]]; then | ||
# Alpine specific dep installation | ||
echo "Installing RocksDB dependencies..." | ||
# 1. Install dependencies | ||
echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >>/etc/apk/repositories | ||
apk add --update --no-cache cmake bash perl g++ | ||
apk add --update --no-cache zlib zlib-dev bzip2 bzip2-dev snappy snappy-dev lz4 lz4-dev zstd@testing zstd-dev@testing libtbb-dev@testing libtbb@testing | ||
# 2. Install latest gflags | ||
cd /tmp && | ||
git clone https://github.com/gflags/gflags.git && | ||
cd gflags && | ||
mkdir build && | ||
cd build && | ||
cmake -DBUILD_SHARED_LIBS=1 -DGFLAGS_INSTALL_SHARED_LIBS=1 .. && | ||
make install && | ||
rm -rf /tmp/gflags | ||
else | ||
echo "Linux distribution not supported" | ||
exit 1 | ||
fi | ||
|
||
# 3. Install Rocksdb (same for any linux distribution) | ||
Aminechakr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cd /tmp && | ||
git clone -b v"${ROCKSDB_VERSION}" --single-branch https://github.com/facebook/rocksdb.git && | ||
cd rocksdb && | ||
PORTABLE=1 WITH_JNI=0 WITH_BENCHMARK_TOOLS=0 WITH_TESTS=1 WITH_TOOLS=0 WITH_CORE_TOOLS=1 WITH_BZ2=1 WITH_LZ4=1 WITH_SNAPPY=1 WITH_ZLIB=1 WITH_ZSTD=1 WITH_GFLAGS=0 USE_RTTI=1 \ | ||
make shared_lib && | ||
cp librocksdb.so* /usr/lib/ && | ||
cp -r include/* /usr/include/ && | ||
rm -rf /tmp/rocksdb | ||
else | ||
echo "Cannot determine Linux distribution." | ||
exit 1 | ||
fi | ||
|
||
elif [[ $(uname) == "Darwin" ]]; then | ||
# macOS-specific actions | ||
xcode-select --install | ||
brew tap homebrew/versions | ||
brew install gcc7 --use-llvm | ||
brew install rocksdb | ||
else | ||
echo "Unsupported OS." | ||
exit 1 | ||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.