Skip to content
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

Replacing the redis and redis-stack-server images with redis-libs-tests image in test infrastructure #3505

Merged
merged 5 commits into from
Feb 13, 2025
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
15 changes: 5 additions & 10 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,9 @@ runs:
- name: Setup Test environment
env:
REDIS_VERSION: ${{ inputs.redis-version }}
REDIS_IMAGE: "redis:${{ inputs.redis-version }}"
CLIENT_LIBS_TEST_IMAGE: "redislabs/client-libs-test:${{ inputs.redis-version }}"
CLIENT_LIBS_TEST_IMAGE_TAG: ${{ inputs.redis-version }}
run: |
set -e

if [ "${{inputs.redis-version}}" == "8.0-M04-pre" ]; then
export REDIS_IMAGE=redis:8.0-M03
fi

echo "::group::Installing dependencies"
pip install -U setuptools wheel
Expand All @@ -60,13 +55,13 @@ runs:

# Mapping of redis version to stack version
declare -A redis_stack_version_mapping=(
["7.4.2"]="7.4.0-v2"
["7.2.7"]="7.2.0-v14"
["6.2.17"]="6.2.6-v18"
["7.4.2"]="rs-7.4.0-v2"
["7.2.7"]="rs-7.2.0-v14"
["6.2.17"]="rs-6.2.6-v18"
)

if [[ -v redis_stack_version_mapping[$REDIS_VERSION] ]]; then
export REDIS_STACK_IMAGE="redis/redis-stack-server:${redis_stack_version_mapping[$REDIS_VERSION]}"
export CLIENT_LIBS_TEST_STACK_IMAGE_TAG=${redis_stack_version_mapping[$REDIS_VERSION]}
echo "REDIS_MOD_URL=redis://127.0.0.1:6479/0" >> $GITHUB_ENV
else
echo "Version not found in the mapping."
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# this speeds up coverage with Python 3.12: https://github.com/nedbat/coveragepy/issues/1665
COVERAGE_CORE: sysmon
REDIS_IMAGE: redis:latest
REDIS_STACK_IMAGE: redis/redis-stack-server:latest
CURRENT_CLIENT_LIBS_TEST_STACK_IMAGE_TAG: 'rs-7.4.0-v2'
CURRENT_REDIS_VERSION: '7.4.2'

jobs:
Expand Down Expand Up @@ -180,9 +179,8 @@ jobs:
python-version: 3.9
- name: Run installed unit tests
env:
REDIS_VERSION: ${{ env.CURRENT_REDIS_VERSION }}
REDIS_IMAGE: "redis:${{ env.CURRENT_REDIS_VERSION }}"
CLIENT_LIBS_TEST_IMAGE: "redislabs/client-libs-test:${{ env.CURRENT_REDIS_VERSION }}"
CLIENT_LIBS_TEST_IMAGE_TAG: ${{ env.CURRENT_REDIS_VERSION }}
CLIENT_LIBS_TEST_STACK_IMAGE_TAG: ${{ env.CURRENT_CLIENT_LIBS_TEST_STACK_IMAGE_TAG }}
run: |
bash .github/workflows/install_and_test.sh ${{ matrix.extension }}

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ docker/stunnel/keys
/dockers/*/tls/*
/dockers/standalone/
/dockers/cluster/
/dockers/replica/
/dockers/sentinel/
/dockers/redis-stack/
70 changes: 31 additions & 39 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---
x-client-libs-stack-image: &client-libs-stack-image
image: "redislabs/client-libs-test:${CLIENT_LIBS_TEST_STACK_IMAGE_TAG:-rs-7.4.0-v2}"

x-client-libs-image: &client-libs-image
image: "redislabs/client-libs-test:${CLIENT_LIBS_TEST_IMAGE_TAG:-7.4.2}"

services:

redis:
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:7.4.1}
<<: *client-libs-image
container_name: redis-standalone
environment:
- TLS_ENABLED=yes
Expand All @@ -24,20 +29,26 @@ services:
- all

replica:
image: ${REDIS_IMAGE:-redis:7.4.1}
<<: *client-libs-image
container_name: redis-replica
depends_on:
- redis
command: redis-server --replicaof redis 6379 --protected-mode no --save ""
environment:
- TLS_ENABLED=no
- REDIS_CLUSTER=no
- PORT=6380
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --replicaof redis 6379 --protected-mode no --save ""}
ports:
- 6380:6379
- 6380:6380
volumes:
- "./dockers/replica:/redis/work"
profiles:
- replica
- all-stack
- all

cluster:
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:7.4.1}
<<: *client-libs-image
container_name: redis-cluster
environment:
- REDIS_CLUSTER=yes
Expand All @@ -58,57 +69,38 @@ services:
- all

sentinel:
image: ${REDIS_IMAGE:-redis:7.4.1}
<<: *client-libs-image
container_name: redis-sentinel
depends_on:
- redis
entrypoint: "redis-sentinel /redis.conf --port 26379"
environment:
- REDIS_CLUSTER=no
- NODES=3
- PORT=26379
command: ${REDIS_EXTRA_ARGS:---sentinel}
ports:
- 26379:26379
volumes:
- "./dockers/sentinel.conf:/redis.conf"
profiles:
- sentinel
- all-stack
- all

sentinel2:
image: ${REDIS_IMAGE:-redis:7.4.1}
container_name: redis-sentinel2
depends_on:
- redis
entrypoint: "redis-sentinel /redis.conf --port 26380"
ports:
- 26380:26380
volumes:
- "./dockers/sentinel.conf:/redis.conf"
profiles:
- sentinel
- all-stack
- all

sentinel3:
image: ${REDIS_IMAGE:-redis:7.4.1}
container_name: redis-sentinel3
depends_on:
- redis
entrypoint: "redis-sentinel /redis.conf --port 26381"
ports:
- 26381:26381
volumes:
- "./dockers/sentinel.conf:/redis.conf"
- "./dockers/sentinel.conf:/redis/config-default/redis.conf"
- "./dockers/sentinel:/redis/work"
profiles:
- sentinel
- all-stack
- all

redis-stack:
image: ${REDIS_STACK_IMAGE:-redis/redis-stack-server:latest}
<<: *client-libs-stack-image
container_name: redis-stack
environment:
- REDIS_CLUSTER=no
- PORT=6379
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --save ""}
ports:
- 6479:6379
environment:
- "REDIS_ARGS=${REDIS_STACK_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --save ''}"
volumes:
- "./dockers/redis-stack:/redis/work"
profiles:
- standalone
- all-stack
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
long_description_content_type="text/markdown",
keywords=["Redis", "key-value store", "database"],
license="MIT",
version="5.1.1",
version="5.2.1",
packages=find_packages(
include=[
"redis",
Expand Down
Loading