-
Notifications
You must be signed in to change notification settings - Fork 106
Makefile: added pack and test targets #169
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
6c2ff5f
Makefile: added pack and test targets
rafie 70736cc
Added deps/readies and system-setup.py
rafie b5c47be
Fixed docker functionality, fixed tests, setup changes
rafie dc3c06d
CircleCI: refactoring
rafie 01fa83f
CircleCI: refactoring #2
rafie f019e7c
CircleCI: github ssh keys for git lfs
rafie d8a3f04
CircleCI: revert to old image
rafie 9d8e775
CircleCI: disabled cache restore
rafie aa3f03a
CircleCI: added sudo
rafie 602d990
CircleCI: fixed git lfs handling
rafie 7b36716
CircleCI: try redis:5.0.5-buster image once again
rafie bd95c70
CircleCI: so maybe python:3.7.4-buster
rafie 1ad534c
Moved Paella to Python 3, bumped version to 0.3.2
rafie 94db1a8
Merge branch 'rafi-pack2' of ssh://github.com/RedisAI/RedisAI into ra…
rafie 34e788a
Added getpy to readies/paella
rafie 34713c9
Build fix #1
rafie 2bdc9d9
Merge remote-tracking branch 'origin/master' into rafi-pack2
rafie 9022159
Build fix #2
rafie 70afcd6
Dockerfile sh syntax, DEBUG flag in Makefile
rafie ea8d2bc
system-setup: added popen.communicate()
rafie 1be1bfb
Merge remote-tracking branch 'origin/master' into rafi-pack2
rafie 04e6cff
Build: better cpu/gpu separation
rafie 521bcd2
Docker fixes
rafie 3e1f757
Build fix #3
rafie 0f8d2ee
Build fix #4
rafie 923bb76
Fixes from review, updated README
rafie a2fc02d
Fixes from review #2
rafie 0250daa
Fixes from review #3
rafie 4b1f91f
Fixes from review #4
rafie ff16afa
Fixes from review #5
rafie 4b03775
Fixes from review #6
rafie ba62dfd
Fixes from review #7
rafie 50e6770
CircleCI cache hacking
rafie 5a99f14
Merge remote-tracking branch 'origin/master' into rafi-pack2
rafie d24b7d3
CircleCI cache: cancelled fallback
rafie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
deps/* | ||
install/* | ||
/deps/ | ||
/build/ | ||
/install*/ | ||
**/*.o | ||
**/*.so | ||
**/*.so | ||
.venv/ | ||
venv*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
|
||
ROOT:=.. | ||
|
||
override GPU:=$(or $(findstring $(CUDA),1),$(findstring $(GPU),1)) | ||
|
||
ifeq ($(GPU),1) | ||
ifeq ($(CPU),1) | ||
$(error CPU=1 and GPU=1 (or CUDA=1) are conflicting) | ||
endif | ||
DEPS_FLAGS=gpu | ||
DEVICE=gpu | ||
else | ||
DEPS_FLAGS=cpu | ||
DEVICE=cpu | ||
endif | ||
|
||
GIT_BRANCH:=$(shell git rev-parse --abbrev-ref HEAD) | ||
GIT_COMMIT:=$(shell git describe --always --abbrev=7 --dirty="+") | ||
|
||
ifeq ($(VERSION),) | ||
PACK_VER:=$(GIT_BRANCH)-$(GIT_COMMIT) | ||
else | ||
PACK_VER:=$(VERSION) | ||
endif | ||
|
||
BINDIR=$(PWD)/build | ||
INSTALL_DIR=$(PWD)/install-$(DEVICE) | ||
|
||
BACKENDS_PATH ?= $(INSTALL_DIR)/backends | ||
|
||
RAMP:=ramp | ||
|
||
ifeq ($(DEBUG),1) | ||
CMAKE_FLAGS += -DCMAKE_BUILD_TYPE=Debug | ||
endif | ||
|
||
#---------------------------------------------------------------------------------------------- | ||
|
||
.PHONY: all setup build clean deps pack pack_ramp pack_deps test | ||
|
||
all: build | ||
|
||
build: | ||
ifeq ($(wildcard build/Makefile),) | ||
mkdir -p $(ROOT)/build | ||
cd $(ROOT)/build; \ | ||
cmake -DDEVICE=$(DEVICE) -DDEPS_PATH=$(ROOT)/deps/install $(CMAKE_FLAGS) $(ROOT) | ||
endif | ||
$(MAKE) -C $(ROOT)/build | ||
$(MAKE) -C $(ROOT)/build install | ||
cd $(ROOT) ;\ | ||
[ ! -e install ] && ln -sf install-$(DEVICE) install | ||
|
||
clean: | ||
ifeq ($(ALL),1) | ||
cd $(ROOT) ;\ | ||
rm -rf build install deps/dlpack deps/install-$(DEVICE) deps/*.tar.gz deps/*.zip deps/*.tgz | ||
else | ||
$(MAKE) -C $(ROOT)/build clean | ||
endif | ||
|
||
deps fetch: | ||
@echo Fetching dependencies... | ||
$(ROOT)/get_deps.sh $(DEPS_FLAGS) | ||
|
||
pack: pack_ramp pack_deps | ||
|
||
pack_ramp: | ||
@[ ! -z `command -v redis-server` ] || { echo "Cannot find redis-server - aborting."; exit 1; } | ||
@echo "Building RAMP file ..." | ||
@set -e ;\ | ||
cd $(ROOT) ;\ | ||
RAMPOUT=$$(mktemp /tmp/ramp.XXXXXX) ;\ | ||
$(RAMP) pack -m $(PWD)/ramp.yml -o "build/redisai.{os}-{architecture}.{semantic_version}.zip" $(INSTALL_DIR)/redisai.so 2> /dev/null | grep '.zip' > $$RAMPOUT ;\ | ||
tail -1 $$RAMPOUT > $(BINDIR)/PACKAGE ;\ | ||
cat $(BINDIR)/PACKAGE | sed -e "s/[^.]*\.[^.]*\.\(.*\)\.zip/\1/" > $(BINDIR)/VERSION ;\ | ||
VERSION=$$(cat $(BINDIR)/VERSION) ;\ | ||
$(RAMP) pack -m $(PWD)/ramp.yml -o "build/redisai.{os}-{architecture}.{semantic_version}.zip" \ | ||
-c "BACKENDSPATH /opt/redislabs/lib/redisai-cpu-$$VERSION/backends" $(INSTALL_DIR)/redisai.so 2> /dev/null | grep '.zip' > $$RAMPOUT ;\ | ||
rm -f $$RAMPOUT ;\ | ||
echo "Done." | ||
|
||
pack_deps: pack_ramp | ||
@echo "Building dependencies file ..." | ||
@set -e ;\ | ||
cd $(ROOT) ;\ | ||
PACK_FNAME=$$(basename `cat $(BINDIR)/PACKAGE`) ;\ | ||
ARCHOSVER=$$(echo "$$PACK_FNAME" | sed -e "s/^redisai\.\([^.]*\..*\)\.zip/\1/") ;\ | ||
VERSION=$$(cat $(BINDIR)/VERSION) ;\ | ||
cd install-$(DEVICE) ;\ | ||
rm -rf redisai-$(DEVICE)-$$VERSION ;\ | ||
mkdir redisai-$(DEVICE)-$$VERSION ;\ | ||
mv backends redisai-$(DEVICE)-$$VERSION ;\ | ||
ln -sf redisai-$(DEVICE)-$$VERSION/backends backends ;\ | ||
find redisai-$(DEVICE)-$$VERSION -name "*.so*" | xargs tar pczf redisai-$(DEVICE)-dependencies.$$ARCHOSVER.tgz ;\ | ||
echo "Done." | ||
|
||
test: | ||
@git lfs install | ||
@git lfs pull | ||
@set -e ;\ | ||
cd $(ROOT)/test ;\ | ||
python3 -m RLTest $(TEST_ARGS) --test basic_tests.py --module $(INSTALL_DIR)/redisai.so |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.