Skip to content

Commit

Permalink
ci: prebuilt librocksdb in docker image (#2318)
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek authored Nov 13, 2024
1 parent 14bf85d commit 4b0316c
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 76 deletions.
1 change: 1 addition & 0 deletions .github/actions/docker/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ runs:
SCCACHE_S3_KEY_PREFIX=${{ runner.os }}/sccache
AWS_ACCESS_KEY_ID=${{ inputs.aws_access_key_id }}
AWS_SECRET_ACCESS_KEY=${{ inputs.aws_secret_access_key }}
AWS_REGION=${{ inputs.region }}
cache-from: ${{ steps.layer_cache_settings.outputs.cache_from }}
cache-to: ${{ steps.layer_cache_settings.outputs.cache_to }}
outputs: type=image,name=${{ inputs.image_org }}/${{ inputs.image_name }},push-by-digest=${{ inputs.push_tags != 'true' }},name-canonical=true,push=true
Expand Down
7 changes: 4 additions & 3 deletions .github/actions/rust/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ runs:
export PATH="${PATH}:${HOME}/.local/bin"
- name: Run sccache-cache
uses: mozilla-actions/[email protected].3
uses: mozilla-actions/[email protected].6
with:
version: "v0.7.1" # Must be the same as in Dockerfile
version: "v0.8.2" # Must be the same as in Dockerfile
if: inputs.cache == 'true'

- name: Hash ref_name
Expand Down Expand Up @@ -121,5 +121,6 @@ runs:
if: runner.os == 'Linux'
run: |
sudo apt update -qq
sudo apt install -qq --yes clang llvm
# snappy is required by rust rocksdb
sudo apt install -qq --yes clang llvm libsnappy-dev
sudo update-alternatives --set cc /usr/bin/clang
10 changes: 8 additions & 2 deletions .github/workflows/tests-rs-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/${{ runner.arch }}/linux-gnu
ROCKSDB_STATIC: "/opt/rocksdb/usr/local/lib/librocksdb.a"
ROCKSDB_LIB_DIR: "/opt/rocksdb/usr/local/lib"

SNAPPY_STATIC: "/usr/lib/x86_64-linux-gnu/libsnappy.a"
SNAPPY_LIB_DIR: "/usr/lib/x86_64-linux-gnu"
formatting:
name: Formatting
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -119,6 +120,8 @@ jobs:
SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/${{ runner.arch }}/linux-gnu
ROCKSDB_STATIC: "/opt/rocksdb/usr/local/lib/librocksdb.a"
ROCKSDB_LIB_DIR: "/opt/rocksdb/usr/local/lib"
SNAPPY_STATIC: "/usr/lib/x86_64-linux-gnu/libsnappy.a"
SNAPPY_LIB_DIR: "/usr/lib/x86_64-linux-gnu"
with:
args: ${{ steps.crate_info.outputs.cargo_manifest_dir }}

Expand Down Expand Up @@ -213,7 +216,8 @@ jobs:
SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/${{ runner.arch }}/linux-gnu
ROCKSDB_STATIC: "/opt/rocksdb/usr/local/lib/librocksdb.a"
ROCKSDB_LIB_DIR: "/opt/rocksdb/usr/local/lib"

SNAPPY_STATIC: "/usr/lib/x86_64-linux-gnu/libsnappy.a"
SNAPPY_LIB_DIR: "/usr/lib/x86_64-linux-gnu"
check_each_feature:
name: Check each feature
runs-on: ${{ fromJSON(inputs.test-runner) }}
Expand Down Expand Up @@ -250,6 +254,8 @@ jobs:
SCCACHE_S3_KEY_PREFIX: ${{ runner.os }}/sccache/${{ runner.arch }}/linux-gnu
ROCKSDB_STATIC: "/opt/rocksdb/usr/local/lib/librocksdb.a"
ROCKSDB_LIB_DIR: "/opt/rocksdb/usr/local/lib"
SNAPPY_STATIC: "/usr/lib/x86_64-linux-gnu/libsnappy.a"
SNAPPY_LIB_DIR: "/usr/lib/x86_64-linux-gnu"
run: |
echo Verify all features disabled
set -ex
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: Tests

on:
workflow_dispatch:
inputs:
rebuild-deps:
description: "Rebuild cached Rust dependencies"
required: false
default: "false"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
Expand Down Expand Up @@ -44,11 +39,14 @@ jobs:
build-rust-deps:
name: Prebuild and cache some Rust dependencies
runs-on: ubuntu-24.04
needs:
- changes
# run only if any changes were detected, eg. changes job returned non-empty list
if: ${{ needs.changes.outputs.rs-packages != '[]' }}
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
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4b0316c

Please sign in to comment.