Skip to content

Commit b8784e6

Browse files
chayimTomerHekmatigkorlandalonre24DvirDukhan
authored
1.2 cherries (#774)
Co-authored-by: tomerhekredis <72793005+tomerhekredis@users.noreply.github.com> Co-authored-by: Guy Korland <gkorland@gmail.com> Co-authored-by: alonre24 <alonreshef24@gmail.com> Co-authored-by: DvirDukhan <dvir@redislabs.com>
1 parent 3f192eb commit b8784e6

File tree

14 files changed

+157
-102
lines changed

14 files changed

+157
-102
lines changed

.circleci/config.yml

Lines changed: 128 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@ commands:
4343
circleci step halt
4444
fi
4545
46+
only_run_if_forked_pull_request:
47+
description: >-
48+
If this build is from an internal (i.e not a forked) pull request, then end early.
49+
This is required when we want different behaviours for external, versus internal PRs.
50+
steps:
51+
- run:
52+
name: Return early if not a forked pull request
53+
command: |
54+
if [[ ! -n "$CIRCLE_PR_NUMBER" ]]; then
55+
echo "Not a forked PR so marking as successfull and exiting"
56+
circleci step halt
57+
fi
58+
4659
relocate-docker-storage:
4760
steps:
4861
- run:
@@ -127,6 +140,64 @@ commands:
127140
- store_artifacts:
128141
path: tests/logs
129142

143+
valgrind-general-steps:
144+
parameters:
145+
test_args:
146+
type: string
147+
default: "CLUSTER=0 AOF=0"
148+
steps:
149+
- abort_for_docs
150+
- abort_for_noci
151+
- checkout-all
152+
- restore_cache:
153+
keys:
154+
- build-dependencies-{{ checksum "get_deps.sh" }}
155+
# If no exact match is found will get dependencies from source
156+
- setup-build-system
157+
- run:
158+
name: Install dependencies
159+
command: |
160+
./opt/readies/bin/getredis -v 6.0 --valgrind --force
161+
./get_deps.sh cpu
162+
- run:
163+
name: Build for valgrind
164+
command: |
165+
make -C opt all VALGRIND=1 SHOW=1
166+
- run:
167+
name: Test with valgrind
168+
command: |
169+
make -C opt test VALGRIND=1 <<parameters.test_args>>
170+
no_output_timeout: 120m
171+
172+
build-and-test-gpu-steps:
173+
steps:
174+
- abort_for_docs
175+
- abort_for_noci
176+
- checkout-all
177+
- run:
178+
name: Relocate docker overlay2 dir
179+
command: |
180+
sudo systemctl stop docker
181+
sudo mkdir -p /var2/lib/docker
182+
sudo mv /var/lib/docker/overlay2 /var2/lib/docker
183+
sudo mkdir /var/lib/docker/overlay2
184+
sudo mount --bind /var2/lib/docker/overlay2 /var/lib/docker/overlay2
185+
sudo systemctl start docker
186+
- run:
187+
name: Build
188+
command: |
189+
docker build -f Dockerfile.gpu-test --no-cache -t redisai-gpu:latest-x64-bionic-test .
190+
- run:
191+
name: Test
192+
command: |
193+
mkdir -p $HOME/tests
194+
docker run --gpus all -v $HOME/tests:/build/tests/logs -it --rm redisai-gpu:latest-x64-bionic-test
195+
no_output_timeout: 40m
196+
- store_artifacts:
197+
path: tests/logs
198+
199+
200+
130201
jobs:
131202
lint:
132203
docker:
@@ -218,7 +289,7 @@ jobs:
218289
parameters:
219290
test_args:
220291
type: string
221-
default: "CLUSTER=0 AOF=0"
292+
default: "CLUSTER=0"
222293
docker:
223294
- image: redisfab/rmbuilder:6.2.1-x64-buster
224295
steps:
@@ -245,37 +316,18 @@ jobs:
245316
make -C opt test VALGRIND=1 <<parameters.test_args>>
246317
no_output_timeout: 120m
247318

319+
valgrind-general-for-forked-prs:
320+
docker:
321+
- image: redisfab/rmbuilder:6.2.1-x64-buster
322+
steps:
323+
- only_run_if_forked_pull_request
324+
- valgrind-general-steps
325+
248326
valgrind-general:
249-
parameters:
250-
test_args:
251-
type: string
252-
default: "CLUSTER=0 AOF=0"
253327
docker:
254328
- image: redisfab/rmbuilder:6.2.1-x64-buster
255329
steps:
256-
- abort_for_docs
257-
- abort_for_noci
258-
- early_return_for_forked_pull_requests
259-
- checkout-all
260-
- restore_cache:
261-
keys:
262-
- build-dependencies-{{ checksum "get_deps.sh" }}
263-
# If no exact match is found will get dependencies from source
264-
- setup-build-system
265-
- run:
266-
name: Install dependencies
267-
command: |
268-
./opt/readies/bin/getredis -v 6.0 --valgrind --force
269-
./get_deps.sh cpu
270-
- run:
271-
name: Build for valgrind
272-
command: |
273-
make -C opt all VALGRIND=1 SHOW=1
274-
- run:
275-
name: Test with valgrind
276-
command: |
277-
make -C opt test VALGRIND=1 <<parameters.test_args>>
278-
no_output_timeout: 120m
330+
- valgrind-general-steps
279331

280332
# build-macos:
281333
# macos:
@@ -316,6 +368,8 @@ jobs:
316368
# make build
317369
# sudo make publish
318370

371+
# internal PRs execute build-and-test either in a workflow or
372+
# via a github action trigger
319373
build-and-test-gpu:
320374
machine:
321375
enabled: true
@@ -324,30 +378,20 @@ jobs:
324378
image: ubuntu-1604-cuda-11.1:202012-01
325379

326380
steps:
327-
- abort_for_docs
328-
- abort_for_noci
329-
- checkout-all
330-
- run:
331-
name: Relocate docker overlay2 dir
332-
command: |
333-
sudo systemctl stop docker
334-
sudo mkdir -p /var2/lib/docker
335-
sudo mv /var/lib/docker/overlay2 /var2/lib/docker
336-
sudo mkdir /var/lib/docker/overlay2
337-
sudo mount --bind /var2/lib/docker/overlay2 /var/lib/docker/overlay2
338-
sudo systemctl start docker
339-
- run:
340-
name: Build
341-
command: |
342-
docker build -f Dockerfile.gpu-test --no-cache -t redisai-gpu:latest-x64-bionic-test .
343-
- run:
344-
name: Test
345-
command: |
346-
mkdir -p $HOME/tests
347-
docker run --gpus all -v $HOME/tests:/build/tests/logs -it --rm redisai-gpu:latest-x64-bionic-test
348-
no_output_timeout: 40m
349-
- store_artifacts:
350-
path: tests/logs
381+
- build-and-test-gpu-steps
382+
383+
# in the case of a forked PR, we want to run the GPU steps
384+
# hence we check if we're forked, explicitly
385+
build-and-test-gpu-for-forked-prs:
386+
machine:
387+
enabled: true
388+
docker_layer_caching: true
389+
resource_class: gpu.nvidia.small
390+
image: ubuntu-1604-cuda-11.1:202012-01
391+
392+
steps:
393+
- only_run_if_forked_pull_request
394+
- build-and-test-gpu-steps
351395

352396
deploy-artifacts:
353397
parameters:
@@ -414,16 +458,20 @@ jobs:
414458
- run:
415459
name: Run QA Automation
416460
command: MODULE_VERSION=$CIRCLE_TAG VERBOSE=1 TEST=release ./tests/qa/run
417-
418-
nightly-automation:
419-
docker:
420-
- image: redisfab/rmbuilder:6.2.1-x64-buster
421-
steps:
422-
- checkout
423-
- setup-automation
424461
- run:
425-
name: Run QA Automation
426-
command: MODULE_VERSION=$CIRCLE_BRANCH VERBOSE=1 TEST=nightly QUICK=1 ./tests/qa/run
462+
name: Run QA Automation (AILite)
463+
command: MODULE_VERSION=$CIRCLE_TAG VERBOSE=1 TEST=release VARIANT=lite ./tests/qa/run
464+
465+
466+
# nightly-automation:
467+
# docker:
468+
# - image: redisfab/rmbuilder:6.2.1-x64-buster
469+
# steps:
470+
# - checkout
471+
# - setup-automation
472+
# - run:
473+
# name: Run QA Automation
474+
# command: MODULE_VERSION=$CIRCLE_BRANCH VERBOSE=1 TEST=nightly QUICK=1 ./tests/qa/run
427475

428476

429477
on-any-branch: &on-any-branch
@@ -512,6 +560,12 @@ workflows:
512560
- build-and-test:
513561
<<: *on-any-branch
514562
<<: *after-linter
563+
- build-and-test-gpu:
564+
<<: *on-integ-branch
565+
<<: *after-linter
566+
- build-and-test-gpu-for-forked-prs:
567+
<<: *on-any-branch
568+
<<: *after-linter
515569
- platforms-build:
516570
<<: *after-build-and-test
517571
<<: *on-master-version-tags-and-dockertests
@@ -532,16 +586,11 @@ workflows:
532586
<<: *after-linter
533587
- valgrind:
534588
name: valgrind-cluster
535-
test_args: GEN=0 AOF=0
589+
test_args: GEN=0
536590
<<: *on-integ-branch
537591
<<: *after-linter
538-
- valgrind:
539-
name: valgrind-aof
540-
test_args: GEN=0 CLUSTER=0
541-
<<: *on-integ-branch
542-
<<: *after-linter
543-
- build-and-test-gpu:
544-
<<: *on-integ-branch
592+
- valgrind-general-for-forked-prs:
593+
<<: *on-any-branch
545594
<<: *after-linter
546595
- deploy-snapshot:
547596
context: common
@@ -557,15 +606,15 @@ workflows:
557606
requires:
558607
- deploy-release
559608

560-
nightly:
561-
triggers:
562-
- schedule:
563-
cron: "20 17 * * *"
564-
filters:
565-
branches:
566-
only: master
567-
jobs:
609+
# nightly:
610+
# triggers:
611+
# - schedule:
612+
# cron: "20 17 * * *"
613+
# filters:
614+
# branches:
615+
# only: master
616+
# jobs:
568617
# - build-macos:
569618
# <<: *never # temporarily disabled
570-
- nightly-automation:
571-
context: common
619+
# - nightly-automation:
620+
# context: common

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# BUILD redisfab/redisai:${VERSION}-cpu-${ARCH}-${OSNICK}
22

3-
ARG REDIS_VER=6.0.9
3+
ARG REDIS_VER=6.2.3
44

55
# OSNICK=bionic|stretch|buster
66
ARG OSNICK=buster
@@ -37,6 +37,9 @@ ADD ./tests/flow/ tests/flow/
3737

3838
RUN FORCE=1 ./opt/readies/bin/getpy3
3939
RUN ./opt/system-setup.py
40+
RUN apt-get update -qq
41+
RUN apt-get upgrade -yqq
42+
RUN rm -rf /var/cache/apt
4043

4144
ARG DEPS_ARGS=""
4245
COPY ./get_deps.sh .

Dockerfile.arm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# BUILD redisfab/redisai:${VERSION}-cpu-${ARCH}-${OSNICK}
22

3-
ARG REDIS_VER=6.0.9
3+
ARG REDIS_VER=6.2.3
44

55
# OSNICK=bionic|stretch|buster
66
ARG OSNICK=buster

Dockerfile.gpu

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# BUILD redisfab/redisai:${VERSION}-gpu-${ARCH}-${OSNICK}
22

3-
ARG REDIS_VER=6.0.9
3+
ARG REDIS_VER=6.2.3
44

55
# OSNICK=bionic|centos7|centos6
66
ARG OSNICK=bionic
@@ -42,6 +42,9 @@ ADD ./tests/flow/ tests/flow/
4242

4343
RUN FORCE=1 ./opt/readies/bin/getpy3
4444
RUN ./opt/system-setup.py
45+
RUN apt-get update -qq
46+
RUN apt-get upgrade -yqq
47+
RUN rm -rf /var/cache/apt
4548

4649
ARG DEPS_ARGS=""
4750
COPY ./get_deps.sh .

Dockerfile.gpu-test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# BUILD redisfab/redisai:${VERSION}-gpu-${ARCH}-${OSNICK}-test
22

3-
ARG REDIS_VER=6.0.9
3+
ARG REDIS_VER=6.2.3
44

55
# OSNICK=bionic|centos7|centos6
66
ARG OSNICK=bionic

Dockerfile.jetson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# BUILD redisfab/redisai:${VERSION}-jetson-${ARCH}-${OSNICK}
22

3-
ARG REDIS_VER=6.0.9
3+
ARG REDIS_VER=6.2.3
44

55
# OSNICK=bionic|centos7|centos6
66
ARG OSNICK=bionic

opt/Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ endif
240240

241241
export GEN ?= 1
242242
export SLAVES ?= 1
243-
export AOF ?= 1
244243
export CLUSTER ?= 1
245244

246245
define UNIT_TESTS
@@ -256,7 +255,7 @@ $(SHOW)\
256255
DEVICE=$(DEVICE) \
257256
MODULE=$(realpath $(INSTALLED_TARGET)) \
258257
CLUSTER=$(CLUSTER) \
259-
GEN=$(GEN) AOF=$(AOF) SLAVES=$(SLAVES) \
258+
GEN=$(GEN) SLAVES=$(SLAVES) \
260259
VALGRIND=$(VALGRIND) \
261260
$(ROOT)/tests/flow/tests_setup/tests.sh
262261
endef
@@ -272,7 +271,7 @@ flow_tests: build
272271
DEVICE=$(DEVICE) \
273272
MODULE=$(realpath $(INSTALLED_TARGET)) \
274273
CLUSTER=$(CLUSTER) \
275-
GEN=$(GEN) AOF=$(AOF) SLAVES=$(SLAVES) \
274+
GEN=$(GEN) SLAVES=$(SLAVES) \
276275
VALGRIND=$(VALGRIND) \
277276
REDIS=$(REDIS) \
278277
$(ROOT)/tests/flow/tests_setup/tests.sh
@@ -290,7 +289,7 @@ test: build
290289
MODULE=$(realpath $(INSTALLED_TARGET)) \
291290
TESTMOD=$(realpath $(BINDIR)/tests/module/testmod.so) \
292291
CLUSTER=$(CLUSTER) \
293-
GEN=$(GEN) AOF=$(AOF) SLAVES=$(SLAVES) \
292+
GEN=$(GEN) SLAVES=$(SLAVES) \
294293
VALGRIND=$(VALGRIND) \
295294
REDIS=$(REDIS) \
296295
$(ROOT)/tests/flow/tests_setup/tests.sh

opt/build/docker/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ REPO=redisai
1111
# LATEST_BRANCH=1.2
1212
INT_BRANCHES=1.2
1313

14-
REDIS_VER:=6.0.9
14+
REDIS_VER:=6.2.3
1515
REDISAI_LITE:=0
1616

1717
export ART_DIR=$(ROOT)/bin/artifacts

0 commit comments

Comments
 (0)