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

[WIP] Cache rocksdb dynamic library #1023

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
e9b7658
cache `rocksdb` dynamic library
pvdrz Jan 26, 2022
c4e41d6
set `rocksdb` version correctly
pvdrz Jan 26, 2022
605ba19
echo rocksdb version
pvdrz Jan 26, 2022
c000ec2
quote url
pvdrz Jan 26, 2022
286b11a
make curl verbose
pvdrz Jan 26, 2022
544c92b
follow redirects
pvdrz Jan 26, 2022
62fe942
add rocksdb version to directory
pvdrz Jan 26, 2022
f2cad0e
use sudo to install packages
pvdrz Jan 26, 2022
cd2bb55
restrict to linux for now
pvdrz Jan 26, 2022
42074ad
restrict absolutely to linux for now
pvdrz Jan 26, 2022
cbdc843
remove debug info
pvdrz Jan 26, 2022
e520f22
include macos
pvdrz Jan 26, 2022
57f83bf
ignore windows a bit more
pvdrz Jan 26, 2022
2fba5dc
use right extension for macos dynamic libraries
pvdrz Jan 26, 2022
bc4ea77
try to make windows work
pvdrz Jan 26, 2022
7157379
use correct syntax for GITHUB_ENV in windows
pvdrz Jan 26, 2022
07257e5
install rocksdb in the right path on windows
pvdrz Jan 26, 2022
d2fbff3
set `ROCKSDB_LIB_DIR` on windows
pvdrz Jan 26, 2022
ee0b081
remove ls from windows script
pvdrz Jan 26, 2022
ba857be
temporary hack while rocksdb reinstalls on windows
pvdrz Jan 26, 2022
b81ef95
remove typo
pvdrz Jan 26, 2022
29e4610
remove temporary hack
pvdrz Jan 27, 2022
a3ee7e6
try to move rocksdb caching to a composite action
pvdrz Jan 27, 2022
4783cc0
update directories
pvdrz Jan 27, 2022
6304fff
add shell
pvdrz Jan 27, 2022
4823246
always set ROCKSDB_LIB_DIR
pvdrz Jan 27, 2022
44d9cde
include rocksdb workflow when necessary
pvdrz Jan 27, 2022
5371f10
set local binaries path in rocksdb workflow
pvdrz Jan 27, 2022
9c29771
change rocksdb cache key
pvdrz Jan 27, 2022
7fc1bd6
debug
pvdrz Jan 27, 2022
50a3234
simplify workflow
pvdrz Jan 27, 2022
568ffd0
fix ROCKSDB_LIB_DIR
pvdrz Jan 27, 2022
f028fe7
debug
pvdrz Jan 27, 2022
b49710e
cache the whole folder
pvdrz Jan 27, 2022
eef7239
more fixes
pvdrz Jan 27, 2022
0637262
go back to single quotes
pvdrz Jan 28, 2022
eae4787
come on...
pvdrz Jan 28, 2022
4225874
here we go...
pvdrz Jan 28, 2022
c07cfa5
wip
pvdrz Jan 28, 2022
7a7c64d
wip
pvdrz Jan 28, 2022
042c056
wip
pvdrz Jan 28, 2022
dbe6fed
wip
pvdrz Jan 28, 2022
ff017b3
wip
pvdrz Jan 28, 2022
d7ab9a4
wip
pvdrz Jan 28, 2022
b31451a
wip
pvdrz Jan 28, 2022
125159c
wip
pvdrz Jan 28, 2022
7acf0c1
wip
pvdrz Jan 28, 2022
c7d137d
wip
pvdrz Jan 28, 2022
a44d79b
wip
pvdrz Jan 28, 2022
5ea8acb
wip
pvdrz Jan 28, 2022
1e69e7f
wip
pvdrz Jan 28, 2022
f958940
wip
pvdrz Jan 31, 2022
00bdb45
wip
pvdrz Jan 31, 2022
f0db313
wip
pvdrz Jan 31, 2022
0f4d25f
wip
pvdrz Jan 31, 2022
7b96011
wip
pvdrz Jan 31, 2022
3bfb147
wip
pvdrz Jan 31, 2022
6cea97a
wip
pvdrz Jan 31, 2022
993c5e0
wip
pvdrz Jan 31, 2022
d327d06
wip
pvdrz Jan 31, 2022
f8edffe
wip
pvdrz Jan 31, 2022
c4b4bd9
wip
pvdrz Jan 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ jobs:
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
if: matrix.os == 'windows-latest'

- name: Provide RocksDB
uses: ./.github/workflows/rocksdb
with:
os: ${{ matrix.os }}

- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
Expand Down Expand Up @@ -81,6 +86,10 @@ jobs:
${{ matrix.os }}-${{ matrix.rust }}-
${{ matrix.os }}-

- name: Set LD_LIBRARY_PATH (Linux)
if: matrix.os == 'ubuntu-latest'
run: sudo ln -vsf $ROCKSDB_LIB_DIR* /usr/lib/

- name: Build
uses: actions-rs/cargo@v1
with:
Expand Down Expand Up @@ -179,6 +188,9 @@ jobs:
override: true
components: clippy

- name: Provide RocksDB
uses: ./.github/workflows/rocksdb

- name: Cache cargo state
uses: actions/cache@v2
env:
Expand Down Expand Up @@ -212,6 +224,9 @@ jobs:
toolchain: nightly
override: true

- name: Provide RocksDB
uses: ./.github/workflows/rocksdb

- name: Cache cargo state
uses: actions/cache@v2
env:
Expand Down Expand Up @@ -301,6 +316,9 @@ jobs:
toolchain: nightly
override: true

- name: Provide RocksDB
uses: ./.github/workflows/rocksdb

- name: Cache cargo state
uses: actions/cache@v2
env:
Expand Down Expand Up @@ -329,5 +347,5 @@ jobs:

- name: Run missing files check
run: >
bash .github/workflows/scripts/missing_files.sh
bash .github/workflows/scripts/missing_files.sh
bee-message/fuzz
2 changes: 2 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
with:
crate: rustfilt
version: 0.2.1
- name: Provide RocksDB
uses: ./.github/workflows/rocksdb
- name: Run test coverage
run: bash .github/workflows/scripts/coverage.sh
- uses: coverallsapp/[email protected]
Expand Down
97 changes: 97 additions & 0 deletions .github/workflows/rocksdb/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: 'Compile and cache RocksDB'
inputs:
os:
description: 'Which OS to use'
required: true
default: 'ubuntu-latest'
runs:
using: 'composite'
steps:
- name: Set RocksDB version and build path (Unix)
shell: bash
if: inputs.os != 'windows-latest'
run: |
echo "ROCKSDB_VERSION=6.22.1" >> $GITHUB_ENV
echo "ROCKSDB_BUILD_PATH=$(pwd)/rocksdb_build" >> $GITHUB_ENV

- name: Set RocksDB version and build path (Windows)
shell: pwsh
if: inputs.os == 'windows-latest'
run: |
echo "ROCKSDB_VERSION=6.22.1" >> $env:GITHUB_ENV
echo "ROCKSDB_BUILD_PATH=$(Get-Location)\rocksdb_build" >> $env:GITHUB_ENV

- name: Set RocksDB path (Linux)
shell: bash
if: inputs.os == 'ubuntu-latest'
run: echo "ROCKSDB_LIB_DIR=$ROCKSDB_BUILD_PATH/rocksdb-$ROCKSDB_VERSION/librocksdb.so" >> $GITHUB_ENV

- name: Set RocksDB path (MacOS)
shell: bash
if: inputs.os == 'macos-latest'
run: echo "ROCKSDB_LIB_DIR=$ROCKSDB_BUILD_PATH/rocksdb-$ROCKSDB_VERSION/librocksdb.dylib" >> $GITHUB_ENV

- name: Set RocksDB path (Windows)
shell: pwsh
if: inputs.os == 'windows-latest'
run: |
echo "ROCKSDB_LIB_DIR=$env:ROCKSDB_BUILD_PATH\rocksdb\build\Release\rocksdb.lib" >> $env:GITHUB_ENV
echo "$env:ROCKSDB_BUILD_PATH\rocksdb\build\Release" >> $env:GITHUB_PATH

- name: Cache RocksDB
uses: actions/cache@v2
id: cache-rocksdb
with:
path: ${{ env.ROCKSDB_BUILD_PATH }}
key: rocksdb-build-${{ env.ROCKSDB_VERSION }}-${{ inputs.os }}

- name: Compile RocksDB (Linux)
shell: bash
if: steps.cache-rocksdb.outputs.cache-hit != 'true' && inputs.os == 'ubuntu-latest'
run: |
mkdir -p $ROCKSDB_BUILD_PATH
cd $ROCKSDB_BUILD_PATH
curl -L -O https://github.com/facebook/rocksdb/archive/refs/tags/v$ROCKSDB_VERSION.tar.gz
tar -xzf v$ROCKSDB_VERSION.tar.gz
rm -r v$ROCKSDB_VERSION.tar.gz
cd rocksdb-$ROCKSDB_VERSION
make shared_lib

- name: Compile RocksDB (MacOS)
shell: bash
if: steps.cache-rocksdb.outputs.cache-hit != 'true' && inputs.os == 'macos-latest'
run: |
mkdir -p $ROCKSDB_BUILD_PATH
cd $ROCKSDB_BUILD_PATH
curl -L -O https://github.com/facebook/rocksdb/archive/refs/tags/v$ROCKSDB_VERSION.tar.gz
tar -xzf v$ROCKSDB_VERSION.tar.gz
rm -r v$ROCKSDB_VERSION.tar.gz
cd rocksdb-$ROCKSDB_VERSION
make shared_lib

- name: Add msbuild to PATH (Windows)
if: steps.cache-rocksdb.outputs.cache-hit != 'true' && inputs.os == 'windows-latest'
uses: microsoft/[email protected]

- name: Install RocksDB (Windows)
shell: pwsh
if: steps.cache-rocksdb.outputs.cache-hit != 'true' && inputs.os == 'windows-latest'
run: |
New-Item $env:ROCKSDB_BUILD_PATH -itemtype directory -Force
Set-Location $env:ROCKSDB_BUILD_PATH
vcpkg install lz4
git clone https://github.com/facebook/rocksdb
Set-Location rocksdb
git checkout -q tags/v$env:ROCKSDB_VERSION
New-Item build -itemtype directory -Force
Set-Location build
cmake -G "Visual Studio 16 2019" ..
msbuild rocksdb.sln /p:Configuration=Release
Get-ChildItem -Force -Recurse

- name: DBG (Windows)
shell: pwsh
if: inputs.os == 'windows-latest'
run: |
Get-ChildItem -Force -Recurse "$env:ROCKSDB_BUILD_PATH\rocksdb\build\Release"
Copy-Item "$env:ROCKSDB_LIB_DIR" -Destination "$env:ROCKSDB_BUILD_PATH\.."