Skip to content

Commit d3018c9

Browse files
author
Sam Partee
authored
SmartRedis Release v0.3.0
SmartRedis Release v0.3.0 See www.craylabs.org/docs/changelog.html for details
2 parents b8d1ecf + e14ecef commit d3018c9

250 files changed

Lines changed: 19179 additions & 8241 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.

.github/workflows/build_wheels.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ jobs:
3131
- name: Install cibuildwheel
3232
run: python -m pip install cibuildwheel==1.10.0
3333

34-
- name: Set up common
35-
run: python -m pip install --upgrade cmake
36-
3734
- name: Install GFortran Linux
3835
if: contains(matrix.os, 'ubuntu')
3936
run: |
@@ -44,6 +41,10 @@ jobs:
4441
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V}
4542
sudo apt-get install -y libtool automake
4643
44+
- name: Install Cmake Linux
45+
if: contains(matrix.os, 'ubuntu')
46+
run: sudo apt-get install cmake
47+
4748
- name: Install GFortran macOS
4849
if: contains(matrix.os, 'macos')
4950
run: brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true
@@ -52,6 +53,10 @@ jobs:
5253
if: contains(matrix.os, 'macos')
5354
run: brew install automake || true
5455

56+
- name: Install cmake macOS
57+
if: contains(matrix.os, 'macos')
58+
run: brew install cmake || true
59+
5560
- name: Build wheels
5661
run: python -m cibuildwheel --output-dir wheelhouse
5762

.github/workflows/docker.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#
2+
# BSD 2-Clause License
3+
#
4+
# Copyright (c) 2021, Hewlett Packard Enterprise
5+
# All rights reserved.
6+
#
7+
# Redistribution and use in source and binary forms, with or without
8+
# modification, are permitted provided that the following conditions are met:
9+
#
10+
# 1. Redistributions of source code must retain the above copyright notice, this
11+
# list of conditions and the following disclaimer.
12+
#
13+
# 2. Redistributions in binary form must reproduce the above copyright notice,
14+
# this list of conditions and the following disclaimer in the documentation
15+
# and/or other materials provided with the distribution.
16+
#
17+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
#
28+
29+
name: 'build_docker'
30+
31+
on: [push, pull_request]
32+
33+
jobs:
34+
run_docker_build:
35+
name: Build docker image on ${{ matrix.os }}, RedisAI ${{ matrix.rai_v }}
36+
runs-on: ${{ matrix.os }}
37+
strategy:
38+
fail-fast: true
39+
matrix:
40+
os: [ubuntu-20.04] # cannot test on macOS as docker isn't supported on Mac
41+
rai_v: [1.2.4, 1.2.5] # verisons of RedisAI
42+
43+
# Service containers to run with docker tests
44+
services:
45+
# Label used to access the service container
46+
redis:
47+
# Docker Hub image
48+
image: redislabs/redisai:${{ matrix.rai_v }}-cpu-xenial
49+
# Set health checks to wait until redis has started
50+
options: >-
51+
--health-cmd "redis-cli ping"
52+
--health-interval 10s
53+
--health-timeout 5s
54+
--health-retries 5
55+
ports:
56+
# map port 6379 on service container to the host
57+
- 6379:6379
58+
steps:
59+
- name: 'Checkout SmartRedis'
60+
uses: actions/checkout@v2
61+
- name: 'Build base SmartRedis docker image'
62+
run: |
63+
cd ./images
64+
./build.sh
65+
cd ../
66+
- name: 'Build C++ docker application'
67+
run: |
68+
cd ./tests/docker/cpp
69+
docker build -t cpp_docker_test .
70+
cd ../../../
71+
docker run -d --env SSDB="redis:6379" cpp_docker_test
72+
- name: 'Build C docker application'
73+
run: |
74+
cd ./tests/docker/c
75+
docker build -t c_docker_test .
76+
docker run -d --env SSDB="redis:6379" c_docker_test
77+
cd ../../../
78+
- name: 'Build Fortran docker application'
79+
run: |
80+
cd ./tests/docker/fortran
81+
docker build -t fortran_docker_test .
82+
docker run -d --env SSDB="redis:6379" fortran_docker_test
83+
cd ../../../
84+
- name: 'Build Python docker application'
85+
run: |
86+
cd ./tests/docker/python
87+
docker build -t python_docker_test .
88+
docker run -d --env SSDB="redis:6379" python_docker_test
89+
cd ../../../

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ jobs:
3333
- name: Install cibuildwheel
3434
run: python -m pip install cibuildwheel==1.10.0
3535

36-
- name: Set up common
37-
run: python -m pip install --upgrade cmake
38-
3936
- name: Install GFortran Linux
4037
if: contains(matrix.os, 'ubuntu')
4138
run: |
@@ -46,6 +43,10 @@ jobs:
4643
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V}
4744
sudo apt-get install -y libtool automake
4845
46+
- name: Install Cmake Linux
47+
if: contains(matrix.os, 'ubuntu')
48+
run: sudo apt-get install cmake
49+
4950
- name: Install GFortran macOS
5051
if: contains(matrix.os, 'macos')
5152
run: brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true
@@ -54,6 +55,10 @@ jobs:
5455
if: contains(matrix.os, 'macos')
5556
run: brew install automake || true
5657

58+
- name: Install cmake macOS
59+
if: contains(matrix.os, 'macos')
60+
run: brew install cmake || true
61+
5762
- name: Build wheels
5863
run: python -m cibuildwheel --output-dir wheelhouse
5964

@@ -74,7 +79,7 @@ jobs:
7479

7580
- name: Build sdist
7681
run: |
77-
python -m pip install cmake>=3.10
82+
sudo apt-get install cmake
7883
python setup.py sdist
7984
8085
- uses: actions/upload-artifact@v2

.github/workflows/run_tests.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: run_tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
pull_request:
9+
branches:
10+
- master
11+
- develop
12+
13+
env:
14+
HOMEBREW_NO_ANALYTICS: "ON" # Make Homebrew installation a little quicker
15+
HOMEBREW_NO_AUTO_UPDATE: "ON"
16+
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON"
17+
HOMEBREW_NO_GITHUB_API: "ON"
18+
HOMEBREW_NO_INSTALL_CLEANUP: "ON"
19+
SSDB: "127.0.0.1:6379"
20+
SMARTREDIS_TEST_CLUSTER: False
21+
22+
jobs:
23+
24+
run_tests:
25+
name: Run smartredis tests using ${{ matrix.os }}, Python ${{ matrix.py_v }}, RedisAI ${{ matrix.rai_v }}, and compiler ${{ matrix.compiler }}
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os: [ubuntu-20.04] # cannot test on macOS as docker isn't supported on Mac
31+
compiler: [intel, 8, 9, 10, 11] # intel compiler, and versions of GNU compiler
32+
rai_v: [1.2.4, 1.2.5] # verisons of RedisAI
33+
py_v: ['3.7.x', '3.8.x', '3.9.x'] # versions of Python
34+
env:
35+
FC: gfortran-${{ matrix.compiler }}
36+
GCC_V: ${{ matrix.compiler }} # used when the compiler is gcc/gfortran
37+
38+
# Service containers to run with `container-job`
39+
services:
40+
# Label used to access the service container
41+
redis:
42+
# Docker Hub image
43+
image: redislabs/redisai:${{ matrix.rai_v }}-cpu-xenial
44+
45+
# Set health checks to wait until redis has started
46+
options: >-
47+
--health-cmd "redis-cli ping"
48+
--health-interval 10s
49+
--health-timeout 5s
50+
--health-retries 5
51+
ports:
52+
# map port 6379 on service container to the host
53+
- 6379:6379
54+
55+
steps:
56+
# download a copy of SmartRedis before running CI tests
57+
- uses: actions/checkout@v2
58+
59+
- uses: actions/setup-python@v2
60+
with:
61+
python-version: ${{ matrix.py_v }}
62+
63+
- name: Install GFortran Linux
64+
if: "!contains( matrix.compiler, 'intel' )" # if using GNU compiler
65+
run: |
66+
sudo apt-get update &&
67+
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test &&
68+
sudo apt-get update &&
69+
sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V} &&
70+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
71+
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V}
72+
73+
- name: Install Intel compiler
74+
if: "contains( matrix.compiler, 'intel' )" # if using intel compiler
75+
run: |
76+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB &&
77+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB &&
78+
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB &&
79+
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list &&
80+
sudo apt-get update &&
81+
sudo apt-get install intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
82+
source /opt/intel/oneapi/setvars.sh &&
83+
printenv >> $GITHUB_ENV &&
84+
echo "CC=icc" >> $GITHUB_ENV &&
85+
echo "CXX=icpc" >> $GITHUB_ENV &&
86+
echo "FC=ifort" >> $GITHUB_ENV
87+
88+
- name: Install Cmake Linux
89+
if: contains(matrix.os, 'ubuntu')
90+
run: sudo apt-get install cmake
91+
92+
- name: Build SmartRedis python and install
93+
run: python -m pip install -e .[dev]
94+
95+
- name: Build and run tests
96+
run: |
97+
mkdir -p ./third-party &&
98+
cd ./third-party &&
99+
bash ../build-scripts/build-lcov.sh &&
100+
bash ../build-scripts/build-catch.sh &&
101+
cd ../ &&
102+
make test-verbose
103+
104+
- name: Run Python coverage tests
105+
run: python -m pytest --cov=./src/python/module/smartredis/ --cov-report=xml --cov-append -vv ./tests/python/
106+
107+
- name: Run C++ coverage tests # unit tests already built
108+
run: bash ./build-scripts/build_cpp_cov.sh
109+
110+
- name: Upload Python coverage to Codecov
111+
uses: codecov/codecov-action@v2
112+
with:
113+
files: ./coverage.xml
114+
115+
- name: Upload C++ coverage to Codecov
116+
uses: codecov/codecov-action@v2
117+
with:
118+
files: ./tests/cpp/unit-tests/build/CMakeFiles/cpp_unit_tests.dir/coverage.info

CMakeLists.txt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ option(BUILD_PYTHON "Build the python module" ON)
66

77
set(CMAKE_BUILD_TYPE RELEASE)
88
set(CMAKE_CXX_STANDARD 17)
9-
set(CMAKE_EXE_LINKER_FLAGS "-lpthread")
109
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install)
10+
add_link_options(-lpthread)
11+
12+
add_compile_options(-fvisibility=default)
13+
14+
if (WERROR)
15+
add_compile_options(-Wall -Werror)
16+
endif()
1117

1218
find_library(REDISPP redis++ PATHS ${CMAKE_SOURCE_DIR}/install/lib NO_DEFAULT_PATH REQUIRED)
1319
find_library(HIREDIS hiredis PATHS ${CMAKE_SOURCE_DIR}/install/lib NO_DEFAULT_PATH REQUIRED)
@@ -17,9 +23,20 @@ set(EXT_CLIENT_LIBRARIES ${REDISPP} ${HIREDIS})
1723
set(CLIENT_SRC
1824
src/c/c_client.cpp
1925
src/c/c_dataset.cpp
26+
src/c/c_error.cpp
2027
src/cpp/client.cpp
2128
src/cpp/dataset.cpp
2229
src/cpp/command.cpp
30+
src/cpp/keyedcommand.cpp
31+
src/cpp/nonkeyedcommand.cpp
32+
src/cpp/multikeycommand.cpp
33+
src/cpp/singlekeycommand.cpp
34+
src/cpp/compoundcommand.cpp
35+
src/cpp/addressatcommand.cpp
36+
src/cpp/addressanycommand.cpp
37+
src/cpp/clusterinfocommand.cpp
38+
src/cpp/dbinfocommand.cpp
39+
src/cpp/gettensorcommand.cpp
2340
src/cpp/commandlist.cpp
2441
src/cpp/metadata.cpp
2542
src/cpp/tensorbase.cpp

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 2-Clause License
22

3-
Copyright (c) 2021, Hewlett Packard Enterprise
3+
Copyright (c) 2021-2022, Hewlett Packard Enterprise
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

0 commit comments

Comments
 (0)