Skip to content

Commit 7060702

Browse files
committed
[1.0] CircleCI: added QA automation (#660)
1 parent 44f035d commit 7060702

File tree

10 files changed

+268
-51
lines changed

10 files changed

+268
-51
lines changed

.circleci/config.yml

Lines changed: 83 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143

144144
build-and-test:
145145
docker:
146-
- image: redisfab/rmbuilder:6.0.9-x64-buster
146+
- image: redisfab/rmbuilder:6.2.1-x64-buster
147147
steps:
148148
- build-steps:
149149
platform: debian
@@ -159,7 +159,7 @@ jobs:
159159

160160
coverage:
161161
docker:
162-
- image: redisfab/rmbuilder:6.0.9-x64-buster
162+
- image: redisfab/rmbuilder:6.2.1-x64-buster
163163
steps:
164164
- abort_for_docs
165165
- checkout
@@ -180,12 +180,45 @@ jobs:
180180
name: Build for coverage
181181
command: |
182182
make -C opt all COV=1 SHOW=1
183-
# - run:
184-
# name: Test with coverage
185-
# command: |
186-
# make -C opt test SHOW=1 COV=1 CLUSTER=1
187-
# make -C opt cov-upload
188-
# no_output_timeout: 30m
183+
- run:
184+
name: Test with coverage
185+
command: |
186+
make -C opt test SHOW=1 COV=1 CLUSTER=1
187+
make -C opt cov-upload
188+
no_output_timeout: 30m
189+
190+
valgrind:
191+
parameters:
192+
test_args:
193+
type: string
194+
default: "CLUSTER=0 AOF=0"
195+
docker:
196+
- image: redisfab/rmbuilder:6.2.1-x64-buster
197+
steps:
198+
- abort_for_docs
199+
- checkout
200+
- run:
201+
name: Submodule checkout
202+
command: git submodule update --init --recursive
203+
- restore_cache:
204+
keys:
205+
- build-dependencies-{{ checksum "get_deps.sh" }}
206+
# If no exact match is found will get dependencies from source
207+
- setup-automation
208+
- run:
209+
name: Install dependencies
210+
command: |
211+
./opt/readies/bin/getredis -v 6 --valgrind --force
212+
./get_deps.sh cpu
213+
- run:
214+
name: Build for valgrind
215+
command: |
216+
make -C opt all VALGRIND=1 SHOW=1
217+
- run:
218+
name: Test with valgrind
219+
command: |
220+
make -C opt test VALGRIND=1 <<parameters.test_args>>
221+
no_output_timeout: 120m
189222

190223
build-macos:
191224
macos:
@@ -262,7 +295,7 @@ jobs:
262295
location:
263296
type: string
264297
docker:
265-
- image: redisfab/rmbuilder:6.0.9-x64-buster
298+
- image: redisfab/rmbuilder:6.2.1-x64-buster
266299
steps:
267300
- abort_for_docs
268301
- early_return_for_forked_pull_requests
@@ -278,7 +311,7 @@ jobs:
278311
279312
deploy-snapshot:
280313
docker:
281-
- image: redisfab/rmbuilder:6.0.9-x64-buster
314+
- image: redisfab/rmbuilder:6.2.1-x64-buster
282315
steps:
283316
- abort_for_docs
284317
- early_return_for_forked_pull_requests
@@ -299,7 +332,7 @@ jobs:
299332
300333
deploy-release:
301334
docker:
302-
- image: redisfab/rmbuilder:6.0.9-x64-buster
335+
- image: redisfab/rmbuilder:6.2.1-x64-buster
303336
steps:
304337
- abort_for_docs
305338
- early_return_for_forked_pull_requests
@@ -313,6 +346,26 @@ jobs:
313346
aws s3 cp --no-progress $f s3://redismodules/$PACKAGE_NAME/ --acl public-read
314347
done
315348
349+
release-automation:
350+
docker:
351+
- image: redisfab/rmbuilder:6.2.1-x64-buster
352+
steps:
353+
- checkout
354+
- setup-automation
355+
- run:
356+
name: Run QA Automation
357+
command: MODULE_VERSION=$CIRCLE_TAG VERBOSE=1 TEST=release ./tests/qa/run
358+
359+
nightly-automation:
360+
docker:
361+
- image: redisfab/rmbuilder:6.2.1-x64-buster
362+
steps:
363+
- checkout
364+
- setup-automation
365+
- run:
366+
name: Run QA Automation
367+
command: MODULE_VERSION=$CIRCLE_BRANCH VERBOSE=1 TEST=nightly QUICK=1 ./tests/qa/run
368+
316369

317370
on-any-branch: &on-any-branch
318371
filters:
@@ -341,6 +394,17 @@ on-integ-branch: &on-integ-branch
341394
only:
342395
- master
343396
- /^\d+\.\d+.*$/
397+
- /^feature-.*$/
398+
tags:
399+
ignore: /.*/
400+
401+
not-on-integ-branch: &not-on-integ-branch
402+
filters:
403+
branches:
404+
ignore:
405+
- master
406+
- /^\d+\.\d+.*$/
407+
- /^feature-.*$/
344408
tags:
345409
ignore: /.*/
346410

@@ -357,6 +421,7 @@ on-integ-and-version-tags: &on-integ-and-version-tags
357421
only:
358422
- master
359423
- /^\d+\.\d+.*$/
424+
- /^feature-.*$/
360425
tags:
361426
only: /^v[0-9].*/
362427

@@ -403,6 +468,11 @@ workflows:
403468
context: common
404469
<<: *after-platform-builds
405470
<<: *on-version-tags
471+
- release-automation:
472+
context: common
473+
<<: *on-version-tags
474+
requires:
475+
- deploy-release
406476

407477
nightly:
408478
triggers:
@@ -414,3 +484,5 @@ workflows:
414484
jobs:
415485
- build-macos:
416486
<<: *never # temporarily disabled
487+
- nightly-automation:
488+
context: common

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,18 @@ RUN if [ "$DEPS_ARGS" = "" ]; then ./get_deps.sh cpu; else env $DEPS_ARGS ./get_
4040

4141
ARG BUILD_ARGS=""
4242
ADD ./ /build
43-
RUN bash -c "set -e ;\
44-
. ./opt/readies/bin/sourced ./profile.d ;\
45-
make -C opt build $BUILD_ARGS SHOW=1"
43+
RUN bash -l -c "make -C opt build $BUILD_ARGS SHOW=1"
4644

4745
ARG PACK
4846
ARG TEST
4947

5048
RUN mkdir -p bin/artifacts
5149
RUN set -e ;\
52-
if [ "$PACK" = "1" ]; then make -C opt pack; fi
50+
if [ "$PACK" = "1" ]; then bash -l -c "make -C opt pack"; fi
5351

5452
RUN set -e ;\
5553
if [ "$TEST" = "1" ]; then \
56-
TEST= make -C opt test $BUILD_ARGS NO_LFS=1 ;\
54+
bash -l -c "TEST= make -C opt test $BUILD_ARGS NO_LFS=1" ;\
5755
if [[ -d test/logs ]]; then \
5856
tar -C test/logs -czf bin/artifacts/test-logs-cpu.tgz . ;\
5957
fi ;\

Dockerfile.gpu

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,18 @@ RUN if [ "$DEPS_ARGS" = "" ]; then ./get_deps.sh gpu; else env $DEPS_ARGS ./get_
4646

4747
ARG BUILD_ARGS=""
4848
ADD ./ /build
49-
RUN bash -c "set -e ;\
50-
. ./opt/readies/bin/sourced ./profile.d ;\
51-
make -C opt build GPU=1 $BUILD_ARGS SHOW=1"
49+
RUN bash -l -c "make -C opt build GPU=1 $BUILD_ARGS SHOW=1"
5250

5351
ARG PACK
5452
ARG TEST
5553

5654
RUN mkdir -p bin/artifacts
5755
RUN set -e ;\
58-
if [ "$PACK" = "1" ]; then make -C opt pack GPU=1; fi
56+
if [ "$PACK" = "1" ]; then bash -l -c "make -C opt pack GPU=1"; fi
5957

6058
RUN set -e ;\
6159
if [ "$TEST" = "1" ]; then \
62-
TEST= make -C opt test GPU=1 $BUILD_ARGS NO_LFS=1 ;\
60+
bash -l -c "TEST= make -C opt test GPU=1 $BUILD_ARGS NO_LFS=1" ;\
6361
if [[ -d test/logs ]]; then \
6462
tar -C test/logs -czf bin/artifacts/test-logs-gpu.tgz . ;\
6563
fi ;\

Dockerfile.gpu-test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ ARG BUILD_ARGS=""
5151
ADD ./ /build
5252
RUN set -e ;\
5353
. venv/bin/activate ;\
54-
. ./opt/readies/bin/sourced ./profile.d ;\
55-
make -C opt build GPU=1 $BUILD_ARGS SHOW=1
54+
bash -l -c "make -C opt build GPU=1 $BUILD_ARGS SHOW=1"
5655

5756
ARG PACK
5857

5958
RUN set -e ;\
6059
if [[ $PACK == 1 ]]; then \
6160
. venv/bin/activate ;\
6261
make -C opt pack GPU=1 VERBOSE=1 ;\
62+
bash -l -c "make -C opt pack GPU=1 VERBOSE=1" ;\
6363
fi
6464

6565
RUN git remote set-url origin https://github.com/RedisAI/RedisAI

opt/pack.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ RAMP_PROG="python3 -m RAMP.ramp"
5050
BINDIR=$(realpath $BINDIR)
5151
INSTALL_DIR=$(realpath $INSTALL_DIR)
5252

53-
. $READIES/enable-utf8
53+
$READIES/enable-utf8
54+
source /etc/profile.d/utf8.sh
5455

5556
export ARCH=$($READIES/platform --arch)
5657
export OS=$($READIES/platform --os)

opt/system-setup.py

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
HERE = os.path.abspath(os.path.dirname(__file__))
88
ROOT = os.path.abspath(os.path.join(HERE, ".."))
99
sys.path.insert(0, os.path.join(HERE, "readies"))
10+
READIES = os.path.join(ROOT, "opt/readies")
11+
sys.path.insert(0, READIES)
1012
import paella
1113

1214
#----------------------------------------------------------------------------------------------
@@ -17,37 +19,30 @@ def __init__(self, nop=False):
1719

1820
def common_first(self):
1921
self.install_downloaders()
20-
self.setup_pip()
21-
self.pip_install("wheel virtualenv")
22-
# if self.osnick == 'xenial':
23-
# self.pip_install("setuptools --upgrade")
24-
# self.pip_install("-IU --force-reinstall setuptools")
22+
self.pip_install("wheel")
2523

26-
if self.os == 'linux':
27-
self.install("ca-certificates")
28-
self.install("git unzip wget patchelf")
29-
self.install("coreutils") # for realpath
24+
self.install("git unzip patchelf")
25+
if self.osnick != 'centos8':
26+
self.install("coreutils") # for realpath
3027

3128
def debian_compat(self):
29+
self.run("%s/bin/enable-utf8" % READIES)
30+
self.run("%s/bin/getgcc" % READIES)
3231
self.install("gawk")
33-
self.install("build-essential cmake")
32+
self.install("libssl-dev")
3433
self.install("python3-regex")
35-
self.install("python3-psutil python3-networkx python3-numpy") # python3-skimage
34+
self.install("python3-networkx python3-numpy")
35+
if self.platform.is_arm():
36+
self.install("python3-dev") # python3-skimage
37+
self.install("libmpich-dev libopenblas-dev") # for libtorch
3638
self.install_git_lfs_on_linux()
3739

3840
def redhat_compat(self):
41+
self.run("%s/bin/enable-utf8" % READIES)
42+
self.run("%s/bin/getepel" % READIES)
3943
self.install("redhat-lsb-core")
40-
self.run("%s/readies/bin/enable-utf8" % HERE)
4144

42-
self.group_install("'Development Tools'")
43-
self.install("cmake3")
44-
self.run("ln -sf `command -v cmake3` /usr/local/bin/cmake")
45-
46-
self.install("centos-release-scl")
47-
self.install("devtoolset-8")
48-
self.run("cp /opt/rh/devtoolset-8/enable /etc/profile.d/scl-devtoolset-8.sh")
49-
paella.mkdir_p("%s/profile.d" % ROOT)
50-
self.run("cp /opt/rh/devtoolset-8/enable %s/profile.d/scl-devtoolset-8.sh" % ROOT)
45+
self.run("%s/bin/getgcc --modern" % READIES)
5146

5247
self.run("""
5348
dir=$(mktemp -d /tmp/tar.XXXXXX)
@@ -58,19 +53,15 @@ def redhat_compat(self):
5853
if not self.dist == "amzn":
5954
self.install("epel-release")
6055
self.install("python3-devel libaec-devel")
61-
self.install("python36-psutil")
6256
else:
6357
self.run("amazon-linux-extras install epel", output_on_error=True)
6458
self.install("python3-devel")
65-
self.pip_install("psutil")
6659

6760
self.install_git_lfs_on_linux()
6861

6962
def fedora(self):
70-
self.group_install("'Development Tools'")
71-
self.install("cmake")
72-
self.run("ln -sf `command -v cmake3` /usr/local/bin/cmake")
73-
self.install("python3 python3-psutil python3-networkx")
63+
self.run("%s/bin/getepel" % READIES)
64+
self.install("python3-networkx")
7465
self.install_git_lfs_on_linux()
7566

7667
def macosx(self):

tests/qa/RS_VERSIONS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
6.0.12-41
2+
5.4.14-37
3+
6.0.8-30
4+
100.0.0-2199

tests/qa/nightly.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"service_id": "single_module_test_cycle",
3+
"name": "redisai automation-testing",
4+
"properties": {
5+
"sut_version": "master",
6+
"email_recipients": "redisaidev-aaaacob2o7eeecrhkqwua77kku@redislabs.slack.com",
7+
"sut_environments": [],
8+
"tools_environment": {},
9+
"modules_version": "master",
10+
"test_names_modules": [
11+
"{{RS_MODULE}}"
12+
],
13+
"cycle_environments_setup": [
14+
{
15+
"teardown": true,
16+
"name": "bionic-amd64-aws",
17+
"concurrency": 1,
18+
"module_url": "http://redismodules.s3.amazonaws.com/{{RS_MODULE_FILE_PREFIX}}/snapshots/{{RS_MODULE_FILE_PREFIX}}-cpu.linux-bionic-x64.master.zip"
19+
}
20+
]
21+
}
22+
}

tests/qa/release.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"service_id": "single_module_test_cycle",
3+
"name": "redisai automation-testing",
4+
"properties": {
5+
"sut_version": "{{RS_VERSION}}",
6+
"email_recipients": "redisaidev-aaaacob2o7eeecrhkqwua77kku@redislabs.slack.com",
7+
"sut_environments": [],
8+
"tools_environment": {},
9+
"modules_version": "{{MODULE_VERSION}}",
10+
"test_names_modules": [
11+
"{{RS_MODULE}}"
12+
],
13+
"cycle_environments_setup": [
14+
{
15+
"teardown": true,
16+
"name": "xenial-amd64-aws",
17+
"concurrency": 1,
18+
"module_url": "http://redismodules.s3.amazonaws.com/{{RS_MODULE_FILE_PREFIX}}/{{RS_MODULE_FILE_PREFIX}}-cpu.linux-xenial-x64.{{MODULE_VERSION}}.zip"
19+
},
20+
{
21+
"teardown": true,
22+
"name": "bionic-amd64-aws",
23+
"concurrency": 1,
24+
"module_url": "http://redismodules.s3.amazonaws.com/{{RS_MODULE_FILE_PREFIX}}/{{RS_MODULE_FILE_PREFIX}}-cpu.linux-bionic-x64.{{MODULE_VERSION}}.zip"
25+
}
26+
]
27+
}
28+
}

0 commit comments

Comments
 (0)