Skip to content

Commit b8d1ecf

Browse files
author
Sam Partee
authored
Merge pull request #130 from CrayLabs/develop
v0.2.0
2 parents 95ca568 + 6314710 commit b8d1ecf

File tree

121 files changed

+7471
-7158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+7471
-7158
lines changed

.github/workflows/build_wheels.yml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -58,43 +58,3 @@ jobs:
5858
- uses: actions/upload-artifact@v2
5959
with:
6060
path: ./wheelhouse/*.whl
61-
62-
build_sdist:
63-
name: Build source distribution
64-
runs-on: ubuntu-latest
65-
steps:
66-
- uses: actions/checkout@v2
67-
68-
- uses: actions/setup-python@v2
69-
name: Install Python
70-
with:
71-
python-version: '3.8'
72-
73-
- name: Build sdist
74-
run: |
75-
python -m pip install cmake>=3.10
76-
python setup.py sdist
77-
78-
- uses: actions/upload-artifact@v2
79-
with:
80-
path: dist/*.tar.gz
81-
82-
83-
upload_pypi:
84-
needs: [build_wheels, build_sdist]
85-
runs-on: ubuntu-latest
86-
# upload to PyPI on every tag starting with 'v'
87-
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
88-
# Publish when a GitHub Release is created
89-
if: github.event_name == 'release' && github.event.action == 'published'
90-
steps:
91-
- uses: actions/download-artifact@v2
92-
with:
93-
name: artifact
94-
path: dist
95-
96-
- uses: pypa/gh-action-pypi-publish@master
97-
with:
98-
user: __token__
99-
password: ${{ secrets.PYPI }}
100-
#repository_url: https://test.pypi.org/legacy/

.github/workflows/release.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: deploy-release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
HOMEBREW_NO_ANALYTICS: "ON" # Make Homebrew installation a little quicker
9+
HOMEBREW_NO_AUTO_UPDATE: "ON"
10+
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON"
11+
HOMEBREW_NO_GITHUB_API: "ON"
12+
HOMEBREW_NO_INSTALL_CLEANUP: "ON"
13+
CIBW_SKIP: "pp* *i686*" # skip building for PyPy
14+
CIBW_ARCHES: x86_64
15+
16+
jobs:
17+
build_wheels:
18+
name: Build wheels on ${{ matrix.os }}
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-20.04, macos-10.15]
24+
gcc_v: [8] # Version of GFortran we want to use.
25+
env:
26+
FC: gfortran-${{ matrix.gcc_v }}
27+
GCC_V: ${{ matrix.gcc_v }}
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: actions/setup-python@v2
32+
33+
- name: Install cibuildwheel
34+
run: python -m pip install cibuildwheel==1.10.0
35+
36+
- name: Set up common
37+
run: python -m pip install --upgrade cmake
38+
39+
- name: Install GFortran Linux
40+
if: contains(matrix.os, 'ubuntu')
41+
run: |
42+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
43+
sudo apt-get update
44+
sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V}
45+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
46+
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V}
47+
sudo apt-get install -y libtool automake
48+
49+
- name: Install GFortran macOS
50+
if: contains(matrix.os, 'macos')
51+
run: brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true
52+
53+
- name: Install automake macOS
54+
if: contains(matrix.os, 'macos')
55+
run: brew install automake || true
56+
57+
- name: Build wheels
58+
run: python -m cibuildwheel --output-dir wheelhouse
59+
60+
- uses: actions/upload-artifact@v2
61+
with:
62+
path: ./wheelhouse/*.whl
63+
64+
build_sdist:
65+
name: Build source distribution
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v2
69+
70+
- uses: actions/setup-python@v2
71+
name: Install Python
72+
with:
73+
python-version: '3.8'
74+
75+
- name: Build sdist
76+
run: |
77+
python -m pip install cmake>=3.10
78+
python setup.py sdist
79+
80+
- uses: actions/upload-artifact@v2
81+
with:
82+
path: dist/*.tar.gz
83+
84+
85+
upload_pypi:
86+
needs: [build_wheels, build_sdist]
87+
runs-on: ubuntu-latest
88+
steps:
89+
- uses: actions/download-artifact@v2
90+
with:
91+
name: artifact
92+
path: dist
93+
94+
- uses: pypa/gh-action-pypi-publish@master
95+
with:
96+
user: __token__
97+
password: ${{ secrets.PYPI }}
98+
#repository_url: https://test.pypi.org/legacy/

CMakeLists.txt

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ cmake_minimum_required(VERSION 3.10)
44

55
option(BUILD_PYTHON "Build the python module" ON)
66

7-
set(CMAKE_BUILD_TYPE Release)
7+
set(CMAKE_BUILD_TYPE RELEASE)
88
set(CMAKE_CXX_STANDARD 17)
99
set(CMAKE_EXE_LINKER_FLAGS "-lpthread")
1010
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install)
1111

1212
find_library(REDISPP redis++ PATHS ${CMAKE_SOURCE_DIR}/install/lib NO_DEFAULT_PATH REQUIRED)
1313
find_library(HIREDIS hiredis PATHS ${CMAKE_SOURCE_DIR}/install/lib NO_DEFAULT_PATH REQUIRED)
14-
find_library(PROTOBUF protobuf PATHS ${CMAKE_SOURCE_DIR}/install/lib NO_DEFAULT_PATH REQUIRED)
1514

16-
set(EXT_CLIENT_LIBRARIES ${REDISPP} ${HIREDIS} ${PROTOBUF})
15+
set(EXT_CLIENT_LIBRARIES ${REDISPP} ${HIREDIS})
1716

1817
set(CLIENT_SRC
1918
src/c/c_client.cpp
@@ -30,15 +29,15 @@ set(CLIENT_SRC
3029
src/cpp/redisserver.cpp
3130
src/cpp/rediscluster.cpp
3231
src/cpp/redis.cpp
33-
utils/protobuf/smartredis.pb.cc
32+
src/cpp/metadatafield.cpp
33+
src/cpp/stringfield.cpp
3434
src/fortran/fortran_c_interop.F90
3535
src/fortran/dataset.F90
3636
src/fortran/client.F90)
3737

3838
include_directories(SYSTEM
39-
install/include/
4039
include
41-
utils/protobuf
40+
install/include
4241
src/fortran
4342
)
4443

@@ -57,12 +56,6 @@ install(DIRECTORY "${CMAKE_SOURCE_DIR}/include/"
5756
PATTERN "*.h" PATTERN "*.tcc" PATTERN "*.inc"
5857
)
5958

60-
install(DIRECTORY "${CMAKE_SOURCE_DIR}/utils/protobuf/"
61-
DESTINATION "include"
62-
FILES_MATCHING
63-
PATTERN "*.h" PATTERN "*.tcc"
64-
)
65-
6659
if(BUILD_PYTHON)
6760
message("-- Python client build enabled")
6861
add_subdirectory(${CMAKE_SOURCE_DIR}/third-party/pybind

Makefile

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ test-deps-gpu:
4545
.PHONY: build-tests
4646
build-tests: lib
4747
./build-scripts/build_cpp_tests.sh
48+
./build-scripts/build_cpp_unit_tests.sh
4849
./build-scripts/build_c_tests.sh
4950
./build-scripts/build_fortran_tests.sh
5051

@@ -53,7 +54,12 @@ build-tests: lib
5354
.PHONY: build-test-cpp
5455
build-test-cpp: lib
5556
./build-scripts/build_cpp_tests.sh
57+
./build-scripts/build_cpp_unit_tests.sh
5658

59+
# help: build-unit-test-cpp - build the C++ unit tests
60+
.PHONY: build-unit-test-cpp
61+
build-unit-test-cpp: lib
62+
./build-scripts/build_cpp_unit_tests.sh
5763

5864
# help: build-test-c - build the C tests
5965
.PHONY: build-test-c
@@ -169,14 +175,14 @@ cov:
169175
.PHONY: test
170176
test: build-tests
171177
test:
172-
@python -m pytest -vv ./tests
178+
@PYTHONFAULTHANDLER=1 python -m pytest -vv ./tests
173179

174180

175181
# help: test-verbose - Build and run all tests [verbosely]
176182
.PHONY: test-verbose
177183
test-verbose: build-tests
178184
test-verbose:
179-
@python -m pytest -vv -s ./tests
185+
@PYTHONFAULTHANDLER=1 python -m pytest -vv -s ./tests
180186

181187
# help: test-c - Build and run all C tests
182188
.PHONY: test-c
@@ -187,14 +193,20 @@ test-c:
187193
# help: test-cpp - Build and run all C++ tests
188194
.PHONY: test-cpp
189195
test-cpp: build-test-cpp
196+
test-cpp: build-unit-test-cpp
190197
test-cpp:
191198
@python -m pytest -vv -s ./tests/cpp/
192199

200+
# help: unit-test-cpp - Build and run unit tests for C++
201+
.PHONY: unit-test-cpp
202+
unit-test-cpp: build-unit-test-cpp
203+
unit-test-cpp:
204+
@python -m pytest -vv -s ./tests/cpp/unit-tests/
193205

194206
# help: test-py - run python tests
195207
.PHONY: test-py
196208
test-py:
197-
@python -m pytest -vv ./tests/python/
209+
@PYTHONFAULTHANDLER=1 python -m pytest -vv ./tests/python/
198210

199211
# help: test-fortran - run fortran tests
200212
.PHONY: test-fortran
@@ -204,5 +216,9 @@ test-fortran: build-test-fortran
204216
# help: testpy-cov - run python tests with coverage
205217
.PHONY: testpy-cov
206218
testpy-cov:
207-
@python -m pytest --cov=./src/python/module/smartredis/ -vv ./tests/python/
219+
@PYTHONFAULTHANDLER=1 python -m pytest --cov=./src/python/module/smartredis/ -vv ./tests/python/
208220

221+
# help: testcpp-cov - run cpp unit tests with coverage
222+
.PHONY: testcpp-cov
223+
testcpp-cov: unit-test-cpp
224+
./build-scripts/build_cpp_cov.sh

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
[![License](https://img.shields.io/github/license/CrayLabs/SmartSim)](https://github.com/CrayLabs/SmartRedis/blob/master/LICENSE.md)
2020
![GitHub last commit](https://img.shields.io/github/last-commit/CrayLabs/SmartRedis)
21+
![PyPI - Wheel](https://img.shields.io/pypi/wheel/smartredis)
2122
![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/CrayLabs/SmartRedis)
23+
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/smartredis)
2224
![Language](https://img.shields.io/github/languages/top/CrayLabs/SmartRedis)
2325
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
2426

@@ -32,7 +34,7 @@ SmartRedis provides clients in the following languages:
3234

3335
| Language | Version/Standard |
3436
|------------|:-----------------:|
35-
| Python | 3.7+ |
37+
| Python | 3.7, 3.8, 3.9 |
3638
| C++ | C++17 |
3739
| C | C99 |
3840
| Fortran | Fortran 2018 |
@@ -60,8 +62,6 @@ SmartRedis utilizes the following libraries.
6062
- [NumPy](https://github.com/numpy/numpy)
6163
- [Hiredis](https://github.com/redis/hiredis) 1.0.0
6264
- [Redis-plus-plus](https://github.com/sewenew/redis-plus-plus) 1.2.3
63-
- [protobuf](https://github.com/protocolbuffers/protobuf) 3.11.3
64-
6565

6666
## Publications
6767

build-scripts/build-catch.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# Install Catch
4+
if [[ -f ./catch/catch.hpp ]]; then
5+
echo "Catch has already been download and installed"
6+
else
7+
echo "Installing Catch"
8+
if [[ ! -d "./catch" ]]; then
9+
wget https://github.com/catchorg/Catch2/releases/download/v2.13.6/catch.hpp -P catch
10+
else
11+
echo "Catch downloaded"
12+
fi
13+
echo "Finished installing Catch"
14+
fi

build-scripts/build-lcov.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Install LCOV
4+
if [[ -f ./lcov/install/usr/local/bin/lcov ]]; then
5+
echo "LCOV has already been download and installed"
6+
else
7+
echo "Installing LCOV"
8+
if [[ ! -d "./lcov" ]]; then
9+
git clone https://github.com/linux-test-project/lcov.git --branch v1.15 --depth=1 lcov
10+
else
11+
echo "LCOV downloaded"
12+
fi
13+
cd lcov
14+
mkdir install
15+
echo "Building LCOV v1.15"
16+
CC=gcc CXX=g++ DESTDIR="install/" make install
17+
cd ../
18+
fi

build-scripts/build-redisai-cpu.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#!/bin/bash
22

3+
# get the number of processors
4+
NPROC=$(python -c "import multiprocessing as mp; print(mp.cpu_count())")
5+
36
#Install RedisAI
47
if [[ -f ./RedisAI/install-cpu/redisai.so ]]; then
58
echo "RedisAI CPU has already been downloaded and installed"
69
else
710
if [[ ! -d "./RedisAI" ]]; then
8-
git clone --recursive https://github.com/RedisAI/RedisAI.git --branch v1.2.2 --depth=1 RedisAI
11+
GIT_LFS_SKIP_SMUDGE=1 git clone --recursive https://github.com/RedisAI/RedisAI.git --branch v1.2.3 --depth=1 RedisAI
912
cd RedisAI
1013
cd ..
1114
else
@@ -15,7 +18,7 @@ else
1518
echo "Downloading RedisAI CPU dependencies"
1619
CC=gcc CXX=g++ WITH_PT=1 WITH_TF=1 WITH_TFLITE=0 WITH_ORT=0 bash get_deps.sh cpu
1720
echo "Building RedisAI"
18-
CC=gcc CXX=g++ GPU=0 WITH_PT=1 WITH_TF=1 WITH_TFLITE=0 WITH_ORT=0 WITH_UNIT_TESTS=0 make -C opt clean build
21+
CC=gcc CXX=g++ GPU=0 WITH_PT=1 WITH_TF=1 WITH_TFLITE=0 WITH_ORT=0 WITH_UNIT_TESTS=0 make -j $NPROC -C opt clean build
1922

2023
if [ -f "./install-cpu/redisai.so" ]; then
2124
echo "Finished installing RedisAI"

build-scripts/build-redisai-gpu.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22

3+
# get the number of processors
4+
NPROC=$(python -c "import multiprocessing as mp; print(mp.cpu_count())")
5+
36
#Install RedisAI
47
if [[ -f ./RedisAI/install-gpu/redisai.so ]]; then
58
echo "RedisAI GPU has already been downloaded and installed"
@@ -43,17 +46,17 @@ else
4346

4447

4548
if [[ ! -d "./RedisAI" ]]; then
46-
git clone --recursive https://github.com/RedisAI/RedisAI.git --branch v1.2.2 --depth=1 RedisAI
49+
GIT_LFS_SKIP_SMUDGE=1 git clone --recursive https://github.com/RedisAI/RedisAI.git --branch v1.2.3 --depth=1 RedisAI
4750
cd RedisAI
4851
cd ..
4952
else
5053
echo "RedisAI downloaded"
5154
fi
5255
cd RedisAI
5356
echo "Downloading RedisAI CPU dependencies"
54-
CC=gcc CXX=g++ WITH_PT=1 WITH_TF=1 WITH_TFLITE=0 WITH_ORT=0 bash get_deps.sh cpu
57+
CC=gcc CXX=g++ WITH_PT=1 WITH_TF=1 WITH_TFLITE=0 WITH_ORT=0 bash get_deps.sh gpu
5558
echo "Building RedisAI"
56-
CC=gcc CXX=g++ GPU=1 WITH_PT=1 WITH_TF=1 WITH_TFLITE=0 WITH_ORT=0 WITH_UNIT_TESTS=0 make -C opt clean build
59+
CC=gcc CXX=g++ GPU=1 WITH_PT=1 WITH_TF=1 WITH_TFLITE=0 WITH_ORT=0 WITH_UNIT_TESTS=0 make -j $NPROC -C opt clean build
5760

5861
if [ -f "./install-gpu/redisai.so" ]; then
5962
echo "Finished installing RedisAI"

0 commit comments

Comments
 (0)