Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions opt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ make build # compile and link
PROFILE=1 # enable profiling compile flags (and debug symbols) for release type.
# You can consider this as build type release with debug symbols and -fno-omit-frame-pointer
VARIANT=name # build variant `name`
WHY=1 # explain CMake decisions (into /tmp/cmake.why)
WHY=1 # explain CMake decisions (into /tmp/cmake.why)
make clean # remove build artifacts
ALL=1 # remove entire artifacts directory
make install # create ready-to-run scheme (module and engines)
Expand Down Expand Up @@ -79,7 +79,7 @@ device selection options (fetch, build, and test):
JETSON=1 # build for Nvidia Jetson
endef

#----------------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------------

override GPU:=$(or $(findstring $(CUDA),1),$(findstring $(GPU),1))

Expand All @@ -97,7 +97,7 @@ DEPS_FLAGS += CPU=1
DEVICE=cpu
endif

#----------------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------------

SRCDIR=..
BINDIR=$(BINROOT)/src
Expand All @@ -110,7 +110,7 @@ INSTALLED_TARGET=$(INSTALL_DIR)/redisai.so

BACKENDS_PATH ?= $(INSTALL_DIR)/backends

#----------------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------------

CMAKE_FILES += \
$(SRCDIR)/CMakeLists.txt \
Expand Down Expand Up @@ -165,7 +165,7 @@ include $(MK)/defs

include $(MK)/rules

#----------------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------------

#prebuild:
# $(SHOW)if [ ! -d $(DEPS_DIR) ]; then echo $$'Dependencies are not in place.\nPlease run \'make fetch\'.'; exit 1; fi
Expand All @@ -190,7 +190,7 @@ else
-$(SHOW)$(MAKE) -C $(BINDIR) clean
endif

#----------------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------------

setup:
@echo Setting up system...
Expand Down Expand Up @@ -222,9 +222,9 @@ endif
pack: $(INSTALLED_TARGET)
$(SHOW)find $(INSTALL_DIR) -name "*.so" -exec chmod +x {} \;
$(SHOW)mkdir -p $(ROOT)/bin/artifacts
$(SHOW)DEVICE=$(DEVICE) BINDIR=$(ROOT)/bin/artifacts INSTALL_DIR=$(INSTALL_DIR) BRANCH=$(BRANCH) DEPS=$(PACK_DEPS) ./pack.sh
$(SHOW)DEVICE=$(DEVICE) BINDIR=$(ROOT)/bin/artifacts INSTALL_DIR=$(INSTALL_DIR) BRANCH=$(BRANCH) DEPS=$(PACK_DEPS) VARIANT=lite ./pack.sh
$(SHOW)DEVICE=$(DEVICE) BINDIR=$(ROOT)/bin/artifacts INSTALL_DIR=$(INSTALL_DIR) BRANCH=$(BRANCH) DEPS=$(PACK_DEPS) VARIANT=rce ./pack.sh
$(SHOW)DEVICE=$(DEVICE) BINDIR=$(ROOT)/bin/artifacts INSTALL_DIR=$(INSTALL_DIR) BRANCH=$(BRANCH) RAMP=1 DEPS=$(PACK_DEPS) ./pack.sh
$(SHOW)DEVICE=$(DEVICE) BINDIR=$(ROOT)/bin/artifacts INSTALL_DIR=$(INSTALL_DIR) BRANCH=$(BRANCH) RAMP=1 DEPS=$(PACK_DEPS) VARIANT=lite ./pack.sh
$(SHOW)DEVICE=$(DEVICE) BINDIR=$(ROOT)/bin/artifacts INSTALL_DIR=$(INSTALL_DIR) BRANCH=$(BRANCH) RAMP=1 DEPS=$(PACK_DEPS) VARIANT=rce ./pack.sh

#----------------------------------------------------------------------------------------------

Expand Down
12 changes: 6 additions & 6 deletions opt/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi
if [[ $1 == --help || $1 == help ]]; then
cat <<-END
pack.sh [cpu|gpu] [--help|help]

Argument variables:
DEVICE=cpu|gpu CPU or GPU variants
RAMP=1 Build RAMP file
Expand Down Expand Up @@ -81,7 +81,7 @@ pack_ramp() {
local packdir=snapshots
local s3base=snapshots/
fi

local fq_package=$stem.${verspec}.zip

[[ ! -d $BINDIR/$packdir ]] && mkdir -p $BINDIR/$packdir
Expand All @@ -104,7 +104,7 @@ pack_ramp() {
if [[ -z $VARIANT ]]; then
local rampfile=ramp.yml
else
local rampfile=ramp-${VARIANT}.yml
local rampfile=ramp${VARIANT}.yml
fi

python3 $READIES/xtx \
Expand All @@ -124,21 +124,21 @@ pack_ramp() {

pack_deps() {
local depname="$1"

cd $ROOT

local platform="$OS-$OSNICK-$ARCH"
local stem=${PACKAGE_NAME}-${DEVICE}-${depname}.${platform}
local fq_package=$stem.${SEMVER}${VARIANT}.tgz
local tar_path=$BINDIR/$fq_package
local backends_prefix_dir=""

if [[ $depname == all ]]; then
local backends_dir=.
else
local backends_dir=${PRODUCT}_$depname
fi

cd $INSTALL_DIR/backends
{ find $backends_dir -name "*.so*" | \
xargs tar -c --sort=name --owner=root:0 --group=root:0 --mtime='UTC 1970-01-01' --transform "s,^,$backends_prefix_dir," 2>> /tmp/pack.err | \
Expand Down