Skip to content

CircleCI: added QA automation #660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 31, 2021
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
51 changes: 45 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ jobs:

build-and-test:
docker:
- image: redisfab/rmbuilder:6.0.9-x64-buster
- image: redisfab/rmbuilder:6.2.1-x64-buster
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you set the builder image as a parameter? instead of copy-paste?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're working on a config.yml abstraction, but the build logic sets up it's own redis version anyway. I'm considering removing the redis version spec from rmbuilder altogether.

steps:
- build-steps:
platform: debian
Expand All @@ -183,7 +183,7 @@ jobs:

coverage:
docker:
- image: redisfab/rmbuilder:6.0.9-x64-buster
- image: redisfab/rmbuilder:6.2.1-x64-buster
steps:
- abort_for_docs
- checkout
Expand Down Expand Up @@ -217,7 +217,7 @@ jobs:
type: string
default: "CLUSTER=0 AOF=0"
docker:
- image: redisfab/rmbuilder:6.0.9-x64-buster
- image: redisfab/rmbuilder:6.2.1-x64-buster
steps:
- abort_for_docs
- checkout
Expand Down Expand Up @@ -325,7 +325,7 @@ jobs:
location:
type: string
docker:
- image: redisfab/rmbuilder:6.0.9-x64-buster
- image: redisfab/rmbuilder:6.2.1-x64-buster
steps:
- abort_for_docs
- early_return_for_forked_pull_requests
Expand All @@ -342,7 +342,7 @@ jobs:

deploy-snapshot:
docker:
- image: redisfab/rmbuilder:6.0.9-x64-buster
- image: redisfab/rmbuilder:6.2.1-x64-buster
steps:
- abort_for_docs
- early_return_for_forked_pull_requests
Expand All @@ -365,7 +365,7 @@ jobs:

deploy-release:
docker:
- image: redisfab/rmbuilder:6.0.9-x64-buster
- image: redisfab/rmbuilder:6.2.1-x64-buster
steps:
- abort_for_docs
- early_return_for_forked_pull_requests
Expand All @@ -380,6 +380,26 @@ jobs:
aws s3 cp --no-progress $f s3://redismodules/$PACKAGE_NAME/ --acl public-read
done

release-automation:
docker:
- image: redisfab/rmbuilder:6.2.1-x64-buster
steps:
- checkout
- setup-automation
- run:
name: Run QA Automation
command: MODULE_VERSION=$CIRCLE_TAG VERBOSE=1 TEST=release ./tests/qa/run

nightly-automation:
docker:
- image: redisfab/rmbuilder:6.2.1-x64-buster
steps:
- checkout
- setup-automation
- run:
name: Run QA Automation
command: MODULE_VERSION=$CIRCLE_BRANCH VERBOSE=1 TEST=nightly QUICK=1 ./tests/qa/run


on-any-branch: &on-any-branch
filters:
Expand Down Expand Up @@ -408,6 +428,17 @@ on-integ-branch: &on-integ-branch
only:
- master
- /^\d+\.\d+.*$/
- /^feature-.*$/
tags:
ignore: /.*/

not-on-integ-branch: &not-on-integ-branch
filters:
branches:
ignore:
- master
- /^\d+\.\d+.*$/
- /^feature-.*$/
tags:
ignore: /.*/

Expand All @@ -424,6 +455,7 @@ on-integ-and-version-tags: &on-integ-and-version-tags
only:
- master
- /^\d+\.\d+.*$/
- /^feature-.*$/
tags:
only: /^v[0-9].*/

Expand Down Expand Up @@ -493,6 +525,11 @@ workflows:
context: common
<<: *after-platform-builds
<<: *on-version-tags
- release-automation:
context: common
<<: *on-version-tags
requires:
- deploy-release

nightly:
triggers:
Expand All @@ -504,3 +541,5 @@ workflows:
jobs:
- build-macos:
<<: *never # temporarily disabled
- nightly-automation:
context: common
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,18 @@ RUN if [ "$DEPS_ARGS" = "" ]; then ./get_deps.sh cpu; else env $DEPS_ARGS ./get_

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

ARG PACK
ARG TEST

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

RUN set -e ;\
if [ "$TEST" = "1" ]; then \
TEST= make -C opt test $BUILD_ARGS NO_LFS=1 ;\
bash -l -c "TEST= make -C opt test $BUILD_ARGS NO_LFS=1" ;\
if [[ -d test/logs ]]; then \
tar -C test/logs -czf bin/artifacts/test-logs-cpu.tgz . ;\
fi ;\
Expand Down
14 changes: 6 additions & 8 deletions Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,21 @@ RUN if [ "$DEPS_ARGS" = "" ]; then ./get_deps.sh gpu; else env $DEPS_ARGS ./get_

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

ARG PACK
ARG TEST

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

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

#----------------------------------------------------------------------------------------------
Expand Down
7 changes: 3 additions & 4 deletions Dockerfile.gpu-test
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,14 @@ ARG BUILD_ARGS=""
ADD ./ /build
RUN set -e ;\
. venv/bin/activate ;\
. ./opt/readies/bin/sourced ./profile.d ;\
make -C opt build GPU=1 $BUILD_ARGS SHOW=1
bash -l -c "make -C opt build GPU=1 $BUILD_ARGS SHOW=1"

ARG PACK

RUN set -e ;\
if [[ $PACK == 1 ]]; then \
. venv/bin/activate ;\
make -C opt pack GPU=1 VERBOSE=1 ;\
. venv/bin/activate ;\
bash -l -c "make -C opt pack GPU=1 VERBOSE=1" ;\
fi

RUN git remote set-url origin https://github.com/RedisAI/RedisAI
Expand Down
3 changes: 2 additions & 1 deletion opt/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ RAMP_PROG="python3 -m RAMP.ramp"
BINDIR=$(realpath $BINDIR)
INSTALL_DIR=$(realpath $INSTALL_DIR)

. $READIES/enable-utf8
$READIES/enable-utf8
source /etc/profile.d/utf8.sh

export ARCH=$($READIES/platform --arch)
export OS=$($READIES/platform --os)
Expand Down
20 changes: 10 additions & 10 deletions opt/system-setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import argparse

HERE = os.path.abspath(os.path.dirname(__file__))
READIES = os.path.join(HERE, "readies")
ROOT = os.path.abspath(os.path.join(HERE, ".."))
READIES = os.path.join(ROOT, "opt/readies")
sys.path.insert(0, READIES)
import paella

Expand All @@ -21,43 +21,43 @@ def common_first(self):
self.pip_install("wheel")

self.install("git unzip patchelf")
self.install("coreutils") # for realpath
if self.osnick != 'centos8':
self.install("coreutils") # for realpath

def debian_compat(self):
self.run("%s/bin/enable-utf8" % READIES)
self.run("%s/bin/getgcc" % READIES)
self.install("gawk")
self.install("build-essential")
self.install("libssl-dev")
self.install("python3-regex")
self.install("python3-psutil python3-networkx python3-numpy")
self.install("python3-networkx python3-numpy")
if self.platform.is_arm():
self.install("python3-dev") # python3-skimage
self.install("libmpich-dev libopenblas-dev") # for libtorch
self.install_git_lfs_on_linux()

def redhat_compat(self):
self.install("redhat-lsb-core")
self.run("%s/bin/enable-utf8" % READIES)
self.run("%s/bin/getepel" % READIES)
self.install("redhat-lsb-core")

self.run("%s/bin/getgcc --modern" % READIES)
# self.install("llvm-toolset-7")

if self.arch == 'x64':
self.install_linux_gnu_tar()

if not self.dist == "amzn":
self.install("epel-release")
self.install("python3-devel libaec-devel")
self.install("python36-psutil")
else:
self.run("amazon-linux-extras install epel", output_on_error=True)
self.install("python3-devel")
self.pip_install("psutil")

self.install_git_lfs_on_linux()

def fedora(self):
self.group_install("'Development Tools'")
self.install("python3 python3-psutil python3-networkx")
self.run("%s/bin/getepel" % READIES)
self.install("python3-networkx")
self.install_git_lfs_on_linux()

def linux_last(self):
Expand Down
4 changes: 4 additions & 0 deletions tests/qa/RS_VERSIONS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
6.0.12-41
5.4.14-37
6.0.8-30
100.0.0-2199
22 changes: 22 additions & 0 deletions tests/qa/nightly.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"service_id": "single_module_test_cycle",
"name": "redisai automation-testing",
"properties": {
"sut_version": "master",
"email_recipients": "redisaidev-aaaacob2o7eeecrhkqwua77kku@redislabs.slack.com",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is our slack channel?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"sut_environments": [],
"tools_environment": {},
"modules_version": "master",
"test_names_modules": [
"{{RS_MODULE}}"
],
"cycle_environments_setup": [
{
"teardown": true,
"name": "bionic-amd64-aws",
"concurrency": 1,
"module_url": "http://redismodules.s3.amazonaws.com/{{RS_MODULE_FILE_PREFIX}}/snapshots/{{RS_MODULE_FILE_PREFIX}}-cpu.linux-bionic-x64.master.zip"
}
]
}
}
28 changes: 28 additions & 0 deletions tests/qa/release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"service_id": "single_module_test_cycle",
"name": "redisai automation-testing",
"properties": {
"sut_version": "{{RS_VERSION}}",
"email_recipients": "redisaidev-aaaacob2o7eeecrhkqwua77kku@redislabs.slack.com",
"sut_environments": [],
"tools_environment": {},
"modules_version": "{{MODULE_VERSION}}",
"test_names_modules": [
"{{RS_MODULE}}"
],
"cycle_environments_setup": [
{
"teardown": true,
"name": "xenial-amd64-aws",
"concurrency": 1,
"module_url": "http://redismodules.s3.amazonaws.com/{{RS_MODULE_FILE_PREFIX}}/{{RS_MODULE_FILE_PREFIX}}-cpu.linux-xenial-x64.{{MODULE_VERSION}}.zip"
},
{
"teardown": true,
"name": "bionic-amd64-aws",
"concurrency": 1,
"module_url": "http://redismodules.s3.amazonaws.com/{{RS_MODULE_FILE_PREFIX}}/{{RS_MODULE_FILE_PREFIX}}-cpu.linux-bionic-x64.{{MODULE_VERSION}}.zip"
}
]
}
}
Loading