Skip to content

Commit 8b75a79

Browse files
authored
Merge branch 'facebook:main' into main
2 parents d5cdb9c + 10478b9 commit 8b75a79

480 files changed

Lines changed: 45964 additions & 11534 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
name: build-folly
2+
description: Build folly and dependencies (skipped if cache hit)
3+
inputs:
4+
cache-hit:
5+
description: Whether the folly cache was hit
6+
required: true
27
runs:
38
using: composite
49
steps:
510
- name: Build folly and dependencies
11+
if: ${{ inputs.cache-hit != 'true' }}
612
run: make build_folly
713
shell: bash
14+
- name: Skip folly build (using cached version)
15+
if: ${{ inputs.cache-hit == 'true' }}
16+
run: echo "Folly build skipped - using cached version"
17+
shell: bash
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: cache-folly
2+
description: Cache folly build to speed up CI
3+
outputs:
4+
cache-hit:
5+
description: Whether the cache was hit
6+
value: ${{ steps.cache-folly-build.outputs.cache-hit }}
7+
runs:
8+
using: composite
9+
steps:
10+
- name: Extract FOLLY_COMMIT_HASH from Makefile
11+
id: extract-folly-hash
12+
shell: bash
13+
run: |
14+
FOLLY_COMMIT_HASH=$(grep '^FOLLY_COMMIT_HASH' Makefile | awk '{print $3}')
15+
echo "hash=$FOLLY_COMMIT_HASH" >> $GITHUB_OUTPUT
16+
- name: Cache folly build
17+
id: cache-folly-build
18+
uses: actions/cache@v4
19+
with:
20+
# Cache the folly build directory
21+
path: /tmp/fbcode_builder_getdeps-Z__wZrocksdbZrocksdbZthird-partyZfollyZbuildZfbcode_builder-root/installed
22+
# Key is based on:
23+
# - OS and architecture
24+
# - The specific folly commit hash from Makefile
25+
# - The container image version to account for different compiler/library versions
26+
key: folly-build-${{ runner.os }}-${{ runner.arch }}-${{ steps.extract-folly-hash.outputs.hash }}-ubuntu22.1-v1

.github/actions/install-maven/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ runs:
44
steps:
55
- name: Install Maven
66
run: |
7-
wget --no-check-certificate https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz
8-
tar zxf apache-maven-3.9.6-bin.tar.gz
9-
echo "export M2_HOME=$(pwd)/apache-maven-3.9.6" >> $GITHUB_ENV
10-
echo "$(pwd)/apache-maven-3.9.6/bin" >> $GITHUB_PATH
7+
wget --no-check-certificate https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.tar.gz
8+
tar zxf apache-maven-3.9.11-bin.tar.gz
9+
echo "export M2_HOME=$(pwd)/apache-maven-3.9.11" >> $GITHUB_ENV
10+
echo "$(pwd)/apache-maven-3.9.11/bin" >> $GITHUB_PATH
1111
shell: bash

.github/actions/setup-folly/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ runs:
33
using: composite
44
steps:
55
- name: Checkout folly sources
6-
run: make checkout_folly
6+
run: |
7+
make checkout_folly
8+
echo "GETDEPS_USE_WGET=1" >> "$GITHUB_ENV"
79
shell: bash

.github/actions/windows-build-steps/action.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@ runs:
44
steps:
55
- name: Add msbuild to PATH
66
uses: microsoft/setup-msbuild@v1.3.1
7+
- name: Cache ccache directory
8+
id: ccache-cache
9+
uses: actions/cache@v4
10+
with:
11+
path: C:\a\rocksdb\rocksdb\.ccache
12+
key: rocksdb-build-${{ runner.os }}-${{ runner.arch }}-ccache-${{ hashFiles('CMakeLists.txt', 'cmake/**/*.cmake') }}-v1
13+
- name: ccache
14+
uses: hendrikmuhs/ccache-action@v1.2
15+
with:
16+
max-size: "10GB"
717
- name: Custom steps
818
env:
919
THIRDPARTY_HOME: ${{ github.workspace }}/thirdparty
1020
CMAKE_HOME: C:/Program Files/CMake
1121
CMAKE_BIN: C:/Program Files/CMake/bin/cmake.exe
1222
CTEST_BIN: C:/Program Files/CMake/bin/ctest.exe
1323
JAVA_HOME: C:/Program Files/BellSoft/LibericaJDK-8
14-
SNAPPY_HOME: ${{ github.workspace }}/thirdparty/snappy-1.1.8
15-
SNAPPY_INCLUDE: ${{ github.workspace }}/thirdparty/snappy-1.1.8;${{ github.workspace }}/thirdparty/snappy-1.1.8/build
16-
SNAPPY_LIB_DEBUG: ${{ github.workspace }}/thirdparty/snappy-1.1.8/build/Debug/snappy.lib
24+
SNAPPY_HOME: ${{ github.workspace }}/thirdparty/snappy-1.2.2
25+
SNAPPY_INCLUDE: ${{ github.workspace }}/thirdparty/snappy-1.2.2;${{ github.workspace }}/thirdparty/snappy-1.2.2/build
26+
SNAPPY_LIB_DEBUG: ${{ github.workspace }}/thirdparty/snappy-1.2.2/build/Debug/snappy.lib
1727
run: |-
1828
# NOTE: if ... Exit $LASTEXITCODE lines needed to exit and report failure
1929
echo ===================== Install Dependencies =====================
@@ -22,14 +32,14 @@ runs:
2232
mkdir $Env:THIRDPARTY_HOME
2333
cd $Env:THIRDPARTY_HOME
2434
echo "Building Snappy dependency..."
25-
curl -Lo snappy-1.1.8.zip https://github.com/google/snappy/archive/refs/tags/1.1.8.zip
35+
curl -Lo snappy-1.2.2.zip https://github.com/google/snappy/archive/refs/tags/1.2.2.zip
2636
if(!$?) { Exit $LASTEXITCODE }
27-
unzip -q snappy-1.1.8.zip
37+
unzip -q snappy-1.2.2.zip
2838
if(!$?) { Exit $LASTEXITCODE }
29-
cd snappy-1.1.8
39+
cd snappy-1.2.2
3040
mkdir build
3141
cd build
32-
& cmake -G "$Env:CMAKE_GENERATOR" ..
42+
& cmake -G "$Env:CMAKE_GENERATOR" .. -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF
3343
if(!$?) { Exit $LASTEXITCODE }
3444
msbuild Snappy.sln -maxCpuCount -property:Configuration=Debug -property:Platform=x64
3545
if(!$?) { Exit $LASTEXITCODE }
@@ -38,11 +48,12 @@ runs:
3848
$env:Path = $env:JAVA_HOME + ";" + $env:Path
3949
mkdir build
4050
cd build
41-
& cmake -G "$Env:CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=Debug -DOPTDBG=1 -DPORTABLE="$Env:CMAKE_PORTABLE" -DSNAPPY=1 -DJNI=1 ..
51+
& cmake -G "$Env:CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=Debug -DWIN_CI=1 -DPORTABLE="$Env:CMAKE_PORTABLE" -DSNAPPY=1 -DXPRESS=1 -DJNI=1 ..
4252
if(!$?) { Exit $LASTEXITCODE }
4353
cd ..
4454
echo "Building with VS version: $Env:CMAKE_GENERATOR"
45-
msbuild build/rocksdb.sln -maxCpuCount -property:Configuration=Debug -property:Platform=x64
55+
# use more parallel processes than the number of processes available, as most of the compile command would be cache hit
56+
msbuild build/rocksdb.sln /m:32 /p:LinkIncremental=false -property:Configuration=Debug -property:Platform=x64
4657
if(!$?) { Exit $LASTEXITCODE }
4758
echo ========================= Test RocksDB =========================
4859
build_tools\run_ci_db_test.ps1 -SuiteRun arena_test,db_basic_test,db_test,db_test2,db_merge_operand_test,bloom_test,c_test,coding_test,crc32c_test,dynamic_bloom_test,env_basic_test,env_test,hash_test,random_test -Concurrency 16
@@ -52,3 +63,7 @@ runs:
5263
& ctest -C Debug -j 16
5364
if(!$?) { Exit $LASTEXITCODE }
5465
shell: pwsh
66+
- name: Show ccache stats
67+
shell: pwsh
68+
run: |
69+
ccache --show-stats -v

.github/workflows/nightly.yml

Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on:
1111
labels: 16-core-ubuntu
1212
container:
13-
image: zjay437/rocksdb:0.6
13+
image: ghcr.io/facebook/rocksdb_ubuntu:22.1
1414
options: --shm-size=16gb
1515
steps:
1616
- uses: actions/checkout@v4.1.0
@@ -27,24 +27,12 @@ jobs:
2727
git config --global --add safe.directory /__w/rocksdb/rocksdb
2828
tools/check_format_compatible.sh
2929
- uses: "./.github/actions/post-steps"
30-
build-linux-run-microbench:
31-
if: ${{ github.repository_owner == 'facebook' }}
32-
runs-on:
33-
labels: 16-core-ubuntu
34-
container:
35-
image: zjay437/rocksdb:0.6
36-
options: --shm-size=16gb
37-
steps:
38-
- uses: actions/checkout@v4.1.0
39-
- uses: "./.github/actions/pre-steps"
40-
- run: DEBUG_LEVEL=0 make -j32 run_microbench
41-
- uses: "./.github/actions/post-steps"
4230
build-linux-non-shm:
4331
if: ${{ github.repository_owner == 'facebook' }}
4432
runs-on:
4533
labels: 16-core-ubuntu
4634
container:
47-
image: zjay437/rocksdb:0.6
35+
image: ghcr.io/facebook/rocksdb_ubuntu:22.1
4836
options: --shm-size=16gb
4937
env:
5038
TEST_TMPDIR: "/tmp/rocksdb_test_tmp"
@@ -53,16 +41,16 @@ jobs:
5341
- uses: "./.github/actions/pre-steps"
5442
- run: make V=1 -j32 check
5543
- uses: "./.github/actions/post-steps"
56-
build-linux-clang-13-asan-ubsan-with-folly:
44+
build-linux-clang-18-asan-ubsan-with-folly:
5745
if: ${{ github.repository_owner == 'facebook' }}
5846
runs-on:
5947
labels: 16-core-ubuntu
6048
container:
61-
image: zjay437/rocksdb:0.6
49+
image: ghcr.io/facebook/rocksdb_ubuntu:24.0
6250
options: --shm-size=16gb
6351
env:
64-
CC: clang-13
65-
CXX: clang++-13
52+
CC: clang-18
53+
CXX: clang++-18
6654
steps:
6755
- uses: actions/checkout@v4.1.0
6856
- uses: "./.github/actions/pre-steps"
@@ -75,7 +63,7 @@ jobs:
7563
runs-on:
7664
labels: 16-core-ubuntu
7765
container:
78-
image: zjay437/rocksdb:0.6
66+
image: ghcr.io/facebook/rocksdb_ubuntu:22.1
7967
options: --shm-size=16gb
8068
steps:
8169
- uses: actions/checkout@v4.1.0
@@ -91,15 +79,6 @@ jobs:
9179
steps:
9280
- uses: actions/checkout@v4.1.0
9381
- uses: "./.github/actions/windows-build-steps"
94-
build-windows-vs2022:
95-
if: ${{ github.repository_owner == 'facebook' }}
96-
runs-on: windows-2022
97-
env:
98-
CMAKE_GENERATOR: Visual Studio 17 2022
99-
CMAKE_PORTABLE: 1
100-
steps:
101-
- uses: actions/checkout@v4.1.0
102-
- uses: "./.github/actions/windows-build-steps"
10382
build-linux-arm-test-full:
10483
if: ${{ github.repository_owner == 'facebook' }}
10584
runs-on:
@@ -110,3 +89,44 @@ jobs:
11089
- run: sudo apt-get update && sudo apt-get install -y build-essential libgflags-dev
11190
- run: make V=1 J=4 -j4 check
11291
- uses: "./.github/actions/post-steps"
92+
build-examples:
93+
if: ${{ github.repository_owner == 'facebook' }}
94+
runs-on:
95+
labels: 4-core-ubuntu
96+
container:
97+
image: ghcr.io/facebook/rocksdb_ubuntu:22.1
98+
options: --shm-size=16gb
99+
steps:
100+
- uses: actions/checkout@v4.1.0
101+
- uses: "./.github/actions/pre-steps"
102+
- name: Build examples
103+
run: make V=1 -j4 static_lib && cd examples && make V=1 -j4
104+
- uses: "./.github/actions/post-steps"
105+
build-fuzzers:
106+
if: ${{ github.repository_owner == 'facebook' }}
107+
runs-on:
108+
labels: 4-core-ubuntu
109+
container:
110+
image: ghcr.io/facebook/rocksdb_ubuntu:24.0
111+
options: --shm-size=16gb
112+
steps:
113+
- uses: actions/checkout@v4.1.0
114+
- uses: "./.github/actions/pre-steps"
115+
- name: Build rocksdb lib
116+
run: CC=clang-18 CXX=clang++-18 USE_CLANG=1 make -j4 static_lib
117+
- name: Build fuzzers
118+
run: cd fuzz && make sst_file_writer_fuzzer db_fuzzer db_map_fuzzer
119+
- uses: "./.github/actions/post-steps"
120+
build-linux-cmake-with-folly-lite-no-test:
121+
if: ${{ github.repository_owner == 'facebook' }}
122+
runs-on:
123+
labels: 16-core-ubuntu
124+
container:
125+
image: ghcr.io/facebook/rocksdb_ubuntu:22.1
126+
options: --shm-size=16gb
127+
steps:
128+
- uses: actions/checkout@v4.1.0
129+
- uses: "./.github/actions/pre-steps"
130+
- uses: "./.github/actions/setup-folly"
131+
- run: "(mkdir build && cd build && cmake -DUSE_FOLLY_LITE=1 -DWITH_GFLAGS=1 -DCMAKE_CXX_FLAGS=-DGLOG_USE_GLOG_EXPORT .. && make V=1 -j20)"
132+
- uses: "./.github/actions/post-steps"

0 commit comments

Comments
 (0)