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
64 changes: 59 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ commands:
cd tests/pytest/logs
rm -f *.aof *.rdb
fi
when: always
- store_artifacts:
path: tests/pytest/logs

Expand Down Expand Up @@ -194,14 +195,47 @@ commands:
make publish OSNICK="<<parameters.platform>>" VERSION=$CIRCLE_TAG BRANCH=$CIRCLE_BRANCH OFFICIAL=0 SHOW=1 VERBOSE=1
- persist-artifacts

vm-build-platforms-steps:
parameters:
platform:
type: string
steps:
- early-returns
- checkout
- setup-automation
- run:
name: Install Docker
command: bash <(curl -fsSL https://raw.githubusercontent.com/docker/docker-install/master/install.sh)
- run:
name: Build for platform
command: |
ROOT=$PWD
# make -C build/docker build DOCKER_SUFFIX=".<<parameters.platform>>" OSNICK=<<parameters.platform>> PACK=1 TEST=1 VERBOSE=1
cd build/platforms
make build OSNICK="<<parameters.platform>>" VERSION=$CIRCLE_TAG BRANCH=$CIRCLE_BRANCH ARTIFACTS=1 TEST=1 SHOW=1
cd $ROOT
mkdir -p tests/pytest/logs
tar -C tests/pytest/logs -xzf bin/artifacts/pytest-logs*.tgz
no_output_timeout: 30m
- save-tests-logs
- early-return-for-forked-pull-requests
- run:
name: Build for platform (publish)
command: |
docker login -u redisfab -p $DOCKER_REDISFAB_PWD
# make -C build/docker build DOCKER_SUFFIX=".<<parameters.platform>>" OSNICK=<<parameters.platform>> PACK=1 TEST=1 VERBOSE=1 PUBLISH=1 DOCKERWRAPPER_EXTRA_VARS="DOCKER_PUSH_ONLY=1"
cd build/platforms
make publish OSNICK="<<parameters.platform>>" VERSION=$CIRCLE_TAG BRANCH=$CIRCLE_BRANCH OFFICIAL=0 SHOW=1 VERBOSE=1
- persist-artifacts

benchmark-steps:
parameters:
github_actor:
type: string
default: $CIRCLE_USERNAME
module_path:
type: string
default: ../../target/release/rejson.so
default: bin/linux-x64-release/rejson.so
steps:
- run:
name: Install remote benchmark tool dependencies
Expand All @@ -215,15 +249,16 @@ commands:
timeout: 60m
no_output_timeout: 30m
command: |
cd ./tests/benchmarks
ROOT="$PWD"
cd tests/benchmarks
export AWS_ACCESS_KEY_ID=$PERFORMANCE_EC2_ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=$PERFORMANCE_EC2_SECRET_KEY
export AWS_DEFAULT_REGION=$PERFORMANCE_EC2_REGION
export EC2_PRIVATE_PEM=$PERFORMANCE_EC2_PRIVATE_PEM

redisbench-admin run-remote \
--required-module ReJSON \
--module_path "<< parameters.module_path >>" \
--module_path "$ROOT/<< parameters.module_path >>" \
--github_actor "<< parameters.github_actor >>" \
--github_repo $CIRCLE_PROJECT_REPONAME \
--github_org $CIRCLE_PROJECT_USERNAME \
Expand All @@ -248,11 +283,22 @@ jobs:
platform:
type: string
docker:
- image: debian:buster
- image: debian:bullseye
steps:
- platforms-build-steps:
platform: <<parameters.platform>>

build-arm-platforms:
parameters:
platform:
type: string
machine:
image: ubuntu-2004:202101-01
resource_class: arm.medium
steps:
- vm-build-platforms-steps:
platform: <<parameters.platform>>

build-macos:
macos:
xcode: 11.6.0
Expand Down Expand Up @@ -388,6 +434,12 @@ workflows:
matrix:
parameters:
platform: [focal, bionic, xenial, centos8, centos7, bullseye]
- build-arm-platforms:
<<: *on-integ-and-version-tags
context: common
matrix:
parameters:
platform: [focal]
- build-macos:
<<: *on-integ-and-version-tags
- deploy-artifacts:
Expand All @@ -397,15 +449,18 @@ workflows:
<<: *on-integ-branch
requires:
- platforms-build
- build-arm-platforms
- build-macos
- deploy-artifacts:
name: deploy_release
context: common
<<: *on-version-tags
requires:
- platforms-build
- build-arm-platforms
- build-macos
- release-automation:
context: common
<<: *on-version-tags
requires:
- deploy_release
Expand All @@ -425,4 +480,3 @@ workflows:
jobs:
- performance-automation:
context: common

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ RUN mkdir -p /var/opt/redislabs/artifacts
RUN chown -R redis:redis /var/opt/redislabs
COPY --from=builder /build/bin/artifacts/ /var/opt/redislabs/artifacts
RUN true
COPY --from=builder /build/target/release/rejson.so "$LIBDIR"
COPY --from=builder /build/bin/linux-${ARCH}-release/rejson.so "$LIBDIR"
RUN true
COPY --from=builder /build/bin/redisearch.so "$LIBDIR"

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ bench benchmark: $(TARGET)
#----------------------------------------------------------------------------------------------

pack:
$(SHOW)./sbin/pack.sh
$(SHOW)MODULE=$(abspath $(TARGET)) ./sbin/pack.sh

.PHONY: pack

Expand Down
8 changes: 5 additions & 3 deletions build/docker/dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@ RUN set -e ;\
rm -f *.aof *.rdb ;\
tar -czf /build/bin/artifacts/pytest-logs-{{REDIS_ARCH}}-{{REDIS_OSNICK}}.tgz .
{% endif %}
RUN BRANCH={{REDISEARCH_VERSION}} ./sbin/get-redisearch
RUN BRANCH={{REDISEARCH_VERSION}} ./sbin/get-redisearch ;\
cp /build/bin/linux-${REDIS_OSNICK}-${REDIS_ARCH}/RediSearch/redisearch.so /build/bin/

#----------------------------------------------------------------------------------------------
FROM redisfab/redis:{{REDIS_VERSION}}-{{REDIS_ARCH}}-{{REDIS_OSNICK}}
WORKDIR /data
{% set LIBDIR= "/usr/lib/redis/modules" %}
RUN mkdir -p {{LIBDIR}}

COPY --from=builder /build/target/release/rejson.so {{LIBDIR}}/rejson.so
COPY --from=builder /build/bin/linux-{{REDIS_OSNICK}}-{{REDIS_ARCH}}/RediSearch/module-enterprise.so {{LIBDIR}}/redisearch.so
COPY --from=builder /build/bin/linux-${{REDIS_ARCH}}-release/rejson.so {{LIBDIR}}/rejson.so
RUN true
COPY --from=builder /build/bin/redisearch.so {{LIBDIR}}/redisearch.so
RUN chown -R redis:redis {{LIBDIR}}
EXPOSE 6379
CMD ["redis-server", "--loadmodule", "{{LIBDIR}}/rejson.so", "--loadmodule", "{{LIBDIR}}/redisearch.so"]
2 changes: 1 addition & 1 deletion build/platforms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ RUN mkdir -p /var/opt/redislabs/artifacts
RUN chown -R redis:redis /var/opt/redislabs
COPY --from=builder /build/bin/artifacts/ /var/opt/redislabs/artifacts
RUN true
COPY --from=builder /build/target/release/rejson.so "$LIBDIR"
COPY --from=builder /build/bin/linux-${ARCH}-release/rejson.so "$LIBDIR"

EXPOSE 6379
CMD ["redis-server", \
Expand Down
2 changes: 1 addition & 1 deletion deps/readies
Submodule readies updated 2 files
+3 −5 bin/getclang
+1 −1 bin/getepel
10 changes: 4 additions & 6 deletions sbin/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ if [[ $1 == --help || $1 == help ]]; then
[ARGVARS...] pack.sh [--help|help]

Argument variables:
MODULE=path Path of module .so

RAMP=1|0 Build RAMP file
DEPS=0|1 Build dependencies file
SYM=0|1 Build debug symbols file
Expand All @@ -25,7 +27,6 @@ if [[ $1 == --help || $1 == help ]]; then
GITSHA=1 Append Git SHA to shapshot package names

ARTDIR=dir Directory in which packages are created (default: bin/artifacts)
BINDIR=dir Directory in which binaries are found (default: target/release)

VERBOSE=1 Print commands
IGNERR=1 Do not abort on error
Expand All @@ -43,9 +44,6 @@ RAMP=${RAMP:-1}
DEPS=${DEPS:-1}
SYM=${SYM:-1}

[[ -z $BINDIR ]] && BINDIR=target/release
BINDIR=$(cd $BINDIR && pwd)

[[ -z $ARTDIR ]] && ARTDIR=bin/artifacts
mkdir -p $ARTDIR $ARTDIR/snapshots
ARTDIR=$(cd $ARTDIR && pwd)
Expand Down Expand Up @@ -88,7 +86,7 @@ pack_ramp() {
local fq_package=$stem.${verspec}.zip

local packfile="$ARTDIR/$fq_package"
local product_so="$BINDIR/$PRODUCT.so"
local product_so="$MODULE"

local xtx_vars=""
local dep_fname=${PACKAGE_NAME}.${platform}.${verspec}.tgz
Expand Down Expand Up @@ -164,7 +162,7 @@ pack_deps() {

prepare_symbols_dep() {
echo "Preparing debug symbols dependencies ..."
echo $BINDIR > $ARTDIR/debug.dir
echo $(cd "$(dirname $MODULE)" && pwd) > $ARTDIR/debug.dir
echo $PRODUCT.so.debug > $ARTDIR/debug.files
echo "" > $ARTDIR/debug.prefix
pack_deps debug
Expand Down