Skip to content

Commit

Permalink
Disable the TLS by default (#911)
Browse files Browse the repository at this point in the history
  • Loading branch information
git-hulk authored Sep 24, 2022
1 parent 231d48d commit 91cebf2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/kvrocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,55 +72,65 @@ jobs:
- name: Darwin Clang
os: macos-11
compiler: auto
with_openssl: -DENABLE_OPENSSL=ON
- name: Darwin Clang without Jemalloc
os: macos-11
compiler: auto
without_jemalloc: -DDISABLE_JEMALLOC=ON
with_openssl: -DENABLE_OPENSSL=ON
- name: Ubuntu GCC
os: ubuntu-18.04
compiler: gcc
with_openssl: -DENABLE_OPENSSL=ON
- name: Ubuntu Clang
os: ubuntu-18.04
compiler: clang
with_openssl: -DENABLE_OPENSSL=ON
- name: Ubuntu GCC ASan
os: ubuntu-18.04
without_jemalloc: -DDISABLE_JEMALLOC=ON
with_sanitizer: -DENABLE_ASAN=ON
with_openssl: -DENABLE_OPENSSL=ON
compiler: gcc
- name: Ubuntu GCC TSan
os: ubuntu-18.04
without_jemalloc: -DDISABLE_JEMALLOC=ON
with_openssl: -DENABLE_OPENSSL=ON
with_sanitizer: -DENABLE_TSAN=ON
compiler: gcc
runtime_env_vars: TSAN_OPTIONS="suppressions=$(realpath ./tests/tsan-suppressions)"
- name: Ubuntu Clang ASan
os: ubuntu-18.04
with_sanitizer: -DENABLE_ASAN=ON
without_jemalloc: -DDISABLE_JEMALLOC=ON
with_openssl: -DENABLE_OPENSSL=ON
compiler: clang
- name: Ubuntu Clang TSan
os: ubuntu-18.04
with_sanitizer: -DENABLE_TSAN=ON
without_jemalloc: -DDISABLE_JEMALLOC=ON
with_openssl: -DENABLE_OPENSSL=ON
compiler: clang
runtime_env_vars: TSAN_OPTIONS="suppressions=$(realpath ./tests/tsan-suppressions)"
- name: Ubuntu GCC Ninja
os: ubuntu-18.04
with_ninja: --ninja
with_openssl: -DENABLE_OPENSSL=ON
compiler: gcc
- name: Ubuntu GCC Ninja without Jemalloc
os: ubuntu-18.04
with_ninja: --ninja
without_jemalloc: -DDISABLE_JEMALLOC=ON
with_openssl: -DENABLE_OPENSSL=ON
compiler: gcc
- name: Ubuntu GCC without luajit
os: ubuntu-18.04
without_luajit: -DUSE_LUAJIT=OFF
with_openssl: -DENABLE_OPENSSL=ON
compiler: gcc
- name: Ubuntu GCC without OpenSSL
os: ubuntu-18.04
compiler: gcc
without_openssl: -DENABLE_OPENSSL=OFF

runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -164,10 +174,8 @@ jobs:

- name: Build Kvrocks
run: |
./x.py build -j$NPROC --unittest --compiler \
${{ matrix.compiler }} ${{ matrix.with_ninja }} ${{ matrix.with_sanitizer }} \
${{ matrix.without_jemalloc }} ${{ matrix.without_openssl }} ${{ matrix.without_luajit }} \
${{ env.CMAKE_EXTRA_DEFS }}
./x.py build -j$NPROC --unittest --compiler ${{ matrix.compiler }} ${{ matrix.without_jemalloc }} ${{ matrix.without_luajit }} \
${{ matrix.with_ninja }} ${{ matrix.with_sanitizer }} ${{ matrix.with_openssl }} ${{ env.CMAKE_EXTRA_DEFS }}
- name: Run Unit Test
run: |
Expand Down Expand Up @@ -196,7 +204,7 @@ jobs:
run: |
export ${{ matrix.runtime_env_vars }}
./x.py test tcl build --cli-path $HOME/local/bin/redis-cli --dont-clean
if [[ -z "${{ matrix.without_openssl }}" ]] && [[ "${{ matrix.os }}" == ubuntu* ]]; then
if [[ -n "${{ matrix.with_openssl }}" ]] && [[ "${{ matrix.os }}" == ubuntu* ]]; then
git clone https://github.com/jsha/minica
cd minica && go build && cd ..
./minica/minica --domains localhost
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ option(ENABLE_TSAN "enable thread santinizer" OFF)
option(ASAN_WITH_LSAN "enable leak santinizer while address santinizer is enabled" ON)
option(ENABLE_STATIC_LIBSTDCXX "link kvrocks with static library of libstd++ instead of shared library" ON)
option(USE_LUAJIT "use luaJIT instead of lua" ON)
option(ENABLE_OPENSSL "enable openssl to support tls connection" ON)
option(ENABLE_OPENSSL "enable openssl to support tls connection" OFF)

if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN apt install -y git gcc g++ make cmake autoconf automake libtool python3 libs
WORKDIR /kvrocks

COPY . .
RUN ./x.py build
RUN ./x.py build -DENABLE_OPENSSL=ON

FROM ubuntu:focal

Expand All @@ -38,5 +38,5 @@ COPY ./kvrocks.conf ./conf/
RUN sed -i -e 's%dir /tmp/kvrocks%dir /var/lib/kvrocks%g' ./conf/kvrocks.conf
VOLUME /var/lib/kvrocks

EXPOSE 6666:6666
EXPOSE 6666:6666
ENTRYPOINT ["./bin/kvrocks", "-c", "./conf/kvrocks.conf"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ $ ./x.py build # `./x.py build -h` to check more options;
# especially, `./x.py build --ghproxy` will fetch dependencies via ghproxy.com.
```

To build with TLS support, you'll need OpenSSL development libraries (e.g. libssl-dev on Debian/Ubuntu) and run:

```shell
$ ./x.py build -DENABLE_OPENSSL=ON
```


### Running kvrocks

```shell
Expand Down

0 comments on commit 91cebf2

Please sign in to comment.