Skip to content

Commit 2467d38

Browse files
committed
Package rocksdb deb
1 parent cb68b46 commit 2467d38

File tree

11 files changed

+71
-12
lines changed

11 files changed

+71
-12
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Data Node Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'rocksdb-v[0-9]+.[0-9]+.[0-9]+b[0-9]+'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
package:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-20.04]
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Build
20+
working-directory: ./dist
21+
run: |
22+
./build.sh
23+
- name: Release
24+
uses: softprops/action-gh-release@v1
25+
with:
26+
generate_release_notes: true
27+
files: ./dist/rocksdb.deb

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ buckifier/*.pyc
8787
buckifier/__pycache__
8888

8989
compile_commands.json
90+
compile_commands.events.json
9091
clang-format-diff.py
9192
.py3/
9293

dist/build.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
BASEDIR=$(dirname "$0")
3+
cd "$BASEDIR/.." || exit 1
4+
PORTABLE=1 make shared_lib -j $(nproc) || exit 1
5+
cp --no-dereference --preserve=links librocksdb.so* dist/rocksdb/usr/local/lib/
6+
cp -r include/rocksdb dist/rocksdb/usr/local/include/
7+
cd dist
8+
strip -g rocksdb/usr/local/lib/librocksdb.so
9+
rm rocksdb/usr/local/lib/.gitignore
10+
rm rocksdb/usr/local/include/.gitignore
11+
arch=$(uname -m)
12+
if [ "$arch" == "aarch64" ]; then
13+
echo "Change architecture in control file"
14+
sed -i 's/amd64/arm64/g' rocksdb/DEBIAN/control
15+
fi
16+
dpkg-deb -Zxz -b rocksdb

dist/rocksdb/DEBIAN/control

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Package: rocksdb
2+
Version: 8.1.1
3+
Maintainer: Li Zhanhui
4+
Architecture: amd64
5+
Description: Pre-built RocksDB

dist/rocksdb/DEBIAN/postinst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
ldconfig
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except this file
4+
!.gitignore

dist/rocksdb/usr/local/lib/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except this file
4+
!.gitignore

env/env_posix.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
#include <cassert>
1717

18-
1918
#include "port/lang.h"
2019
#if !defined(OS_WIN)
2120

@@ -370,9 +369,9 @@ class PosixEnv : public CompositeEnv {
370369
return Status::OK();
371370
}
372371
void SetCpuSet(std::vector<int> cpu_set) override {
373-
printf("env_posix.cc: SetCpuSet, size = %d\n", cpu_set.size());
374-
for(int i = 0; i < cpu_set.size(); i++) {
375-
printf("env_posix.cc: cpu_set[%d]: %d\n", i, cpu_set[i]);
372+
printf("env_posix.cc: SetCpuSet, size = %ld\n", cpu_set.size());
373+
for (std::vector<int>::size_type i = 0; i < cpu_set.size(); i++) {
374+
printf("env_posix.cc: cpu_set[%ld]: %d\n", i, cpu_set[i]);
376375
}
377376
#ifdef _GNU_SOURCE
378377
for (int processor_id : cpu_set) {

include/rocksdb/c.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,8 +2089,9 @@ extern ROCKSDB_LIBRARY_API void rocksdb_envoptions_destroy(
20892089
extern ROCKSDB_LIBRARY_API void rocksdb_create_dir_if_missing(
20902090
rocksdb_env_t* env, const char* path, char** errptr);
20912091

2092-
extern ROCKSDB_LIBRARY_API void rocksdb_env_set_cpu_set(
2093-
rocksdb_env_t* env, const int* cpu_set, size_t n);
2092+
extern ROCKSDB_LIBRARY_API void rocksdb_env_set_cpu_set(rocksdb_env_t* env,
2093+
const int* cpu_set,
2094+
size_t n);
20942095

20952096
/* SstFile */
20962097

@@ -2238,7 +2239,8 @@ extern ROCKSDB_LIBRARY_API rocksdb_fifo_compaction_options_t*
22382239
rocksdb_fifo_compaction_options_create(void);
22392240
extern ROCKSDB_LIBRARY_API void
22402241
rocksdb_fifo_compaction_options_set_allow_compaction(
2241-
rocksdb_fifo_compaction_options_t* fifo_opts, unsigned char allow_compaction);
2242+
rocksdb_fifo_compaction_options_t* fifo_opts,
2243+
unsigned char allow_compaction);
22422244
extern ROCKSDB_LIBRARY_API unsigned char
22432245
rocksdb_fifo_compaction_options_get_allow_compaction(
22442246
rocksdb_fifo_compaction_options_t* fifo_opts);

include/rocksdb/env.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,6 @@ class Env : public Customizable {
664664
this->cpu_set_.swap(cpu_set);
665665
}
666666

667-
668667
protected:
669668
// The pointer to an internal structure that will update the
670669
// status of each thread.
@@ -675,7 +674,7 @@ class Env : public Customizable {
675674

676675
// Pointer to the underlying SystemClock implementation
677676
std::shared_ptr<SystemClock> system_clock_;
678-
677+
679678
std::vector<int> cpu_set_;
680679

681680
private:

0 commit comments

Comments
 (0)