-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use prebuilt librocksdb in github actions (#2316)
- Loading branch information
Showing
11 changed files
with
152 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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,55 @@ | ||
--- | ||
# This action builds and caches librocksdb. If we find that this solution consumes too much time, we can consider | ||
# prebuilding librocksdb outside of the pipeline (eg. in the grovedb release process), publish as an artifact, and | ||
# download it in the pipeline. | ||
name: "librocksdb" | ||
description: "Build and install librocksdb" | ||
inputs: | ||
version: | ||
description: RocksDB version, eg. "8.10.2" | ||
required: false | ||
default: "8.10.2" | ||
bucket: | ||
description: S3 bucket to use for caching | ||
required: false | ||
default: multi-runner-cache-x1xibo9c | ||
force: | ||
description: Force rebuild | ||
required: false | ||
default: "false" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
# Cache librocksdb using s3 bucket | ||
- name: Restore cached librocksdb from S3 | ||
id: librocksdb-cache | ||
uses: strophy/actions-cache@opendal-update | ||
with: | ||
bucket: ${{ inputs.bucket }} | ||
path: /opt/rocksdb | ||
key: librocksdb/${{ inputs.version }}/${{ runner.os }}/${{ runner.arch }} | ||
|
||
- if: ${{ steps.librocksdb-cache.outputs.cache-hit != 'true' || inputs.force == 'true' }} | ||
shell: bash | ||
name: Build librocksdb | ||
run: | | ||
set -ex | ||
WORKDIR=/tmp/rocksdb-build | ||
mkdir -p ${WORKDIR}/rocksdb | ||
mkdir -p /opt/rocksdb/usr/local/lib/ | ||
pushd ${WORKDIR}/rocksdb | ||
# building rocksdb | ||
git clone https://github.com/facebook/rocksdb.git -b v${{ inputs.version }} --depth 1 . | ||
make -j$(nproc) static_lib | ||
make DESTDIR=/opt/rocksdb install-static | ||
set +x | ||
echo Done. | ||
echo Configuration: | ||
echo | ||
echo "ROCKSDB_STATIC='/opt/rocksdb/usr/local/lib/librocksdb.a'" | ||
echo "ROCKSDB_LIB_DIR='/opt/rocksdb/usr/local/lib'" | ||
popd |
This file contains 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,23 @@ | ||
--- | ||
name: Rebuild cached dependencies | ||
|
||
on: | ||
workflow_dispatch: | ||
jobs: | ||
build-rust-deps: | ||
name: Prebuild and cache some Rust dependencies | ||
runs-on: ubuntu-24.04 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_REGION: ${{ secrets.AWS_REGION }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Precompile librocksdb | ||
uses: ./.github/actions/librocksdb | ||
with: | ||
force: true |
This file contains 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 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 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 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 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 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 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 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 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