Skip to content
Draft
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
17 changes: 17 additions & 0 deletions .github/actions/sentinel-cluster/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Bring up Redis Sentinel Cluster
description: >-
Installs docker-compose and runs Redis Sentinel cluster
with ports 16379-16380 for redis and
26379-26380 for sentinel
runs:
using: composite
steps:
- name: Set up Docker Compose
uses: docker/setup-compose-action@364cc21a5de5b1ee4a7f5f9d3fa374ce0ccde746

- name: Run Sentinel cluster
env:
ACTION_PATH: ${{ github.action_path }}
shell: bash
run: |
docker compose --file "${ACTION_PATH}/docker-compose.yml" up --detach
78 changes: 78 additions & 0 deletions .github/actions/sentinel-cluster/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
services:
redis-master:
image: ghcr.io/getsentry/image-mirror-library-redis:5.0-alpine
container_name: redis-master
command:
- redis-server
- --port
- "16379"
ports:
- "16379:16379"
networks:
- sentinel-cluster

redis-replica:
image: ghcr.io/getsentry/image-mirror-library-redis:5.0-alpine
container_name: redis-replica
command:
- redis-server
- --port
- "16380"
- --replicaof
- redis-master
- "16379"
depends_on:
- redis-master
ports:
- "16380:16380"
networks:
- sentinel-cluster

redis-sentinel-1:
image: ghcr.io/getsentry/image-mirror-library-redis:5.0-alpine
container_name: redis-sentinel-1
command:
- sh
- -ec
- |
cat <<EOF > /sentinel.conf
port 26379
sentinel monitor redis-sentry redis-master 16379 2
sentinel down-after-milliseconds redis-sentry 5000
sentinel parallel-syncs redis-sentry 1
sentinel failover-timeout redis-sentry 10000
EOF
exec redis-server /sentinel.conf --sentinel
depends_on:
- redis-master
- redis-replica
ports:
- "26379:26379"
networks:
- sentinel-cluster

redis-sentinel-2:
image: ghcr.io/getsentry/image-mirror-library-redis:5.0-alpine
container_name: redis-sentinel-2
command:
- sh
- -ec
- |
cat <<EOF > /sentinel.conf
port 26380
sentinel monitor redis-sentry redis-master 16379 2
sentinel down-after-milliseconds redis-sentry 5000
sentinel parallel-syncs redis-sentry 1
sentinel failover-timeout redis-sentry 10000
EOF
exec redis-server /sentinel.conf --sentinel
depends_on:
- redis-master
- redis-replica
ports:
- "26380:26380"
networks:
- sentinel-cluster

networks:
sentinel-cluster:
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,9 @@ jobs:
with:
python-version: "3.11"

- name: Start Redis Sentinel cluster
uses: ./.github/actions/sentinel-cluster

- run: make test-integration
env:
PYTEST_N: 6
Expand Down
16 changes: 9 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ criterion = "0.5.1"
crossbeam-channel = "0.5.15"
data-encoding = "2.6.0"
deadpool = "0.12.2"
deadpool-redis = "0.20.0"
deadpool-redis = "0.21.1"
debugid = "0.8.0"
dialoguer = "0.11.0"
dynfmt = "0.1.5"
Expand Down Expand Up @@ -158,7 +158,7 @@ rand = "0.9.1"
rand_pcg = "0.9.0"
rdkafka = "0.36.2"
rdkafka-sys = "4.8.0"
redis = { version = "0.29.2", default-features = false }
redis = { version = "0.31.0", default-features = false }
regex = "1.11.1"
regex-lite = "0.1.6"
reqwest = "0.12.9"
Expand Down
109 changes: 107 additions & 2 deletions devservices/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ x-sentry-service-config:
repo_name: sentry-shared-redis
branch: main
repo_link: https://github.com/getsentry/sentry-shared-redis.git
redis-master:
description: Master instance of redis to be used with sentinel
redis-replica:
description: Replica instance of redis to be used with sentinel
redis-sentinel-1:
description: Instance of redis-sentinel
redis-sentinel-2:
description: Another instance of redis-sentinel
kafka:
description: Shared instance of kafka used by sentry services
remote:
Expand All @@ -18,8 +26,8 @@ x-sentry-service-config:
relay:
description: Service that pushes some functionality from the Sentry SDKs as well as the Sentry server into a proxy process.
modes:
default: [redis, kafka]
containerized: [redis, kafka, relay]
default: [redis, kafka, redis-sentinel-1, redis-sentinel-2, redis-master, redis-replica]
containerized: [redis, kafka, relay, redis-sentinel-1, redis-sentinel-2, redis-master, redis-replica]

x-programs:
devserver:
Expand Down Expand Up @@ -47,6 +55,103 @@ services:
labels:
- orchestrator=devservices
restart: unless-stopped
redis-master:
image: ghcr.io/getsentry/image-mirror-library-redis:5.0-alpine
healthcheck:
test: redis-cli -p 16379 ping | grep PONG
interval: 5s
timeout: 5s
retries: 3
command:
- redis-server
- --appendonly
- yes
- --port
- "16379"
ports:
- "16379:16379"
labels:
- orchestrator=devservices
networks:
- devservices
restart: unless-stopped
redis-replica:
image: ghcr.io/getsentry/image-mirror-library-redis:5.0-alpine
healthcheck:
test: redis-cli -p 16380 ping | grep PONG
interval: 5s
timeout: 5s
retries: 3
command:
- redis-server
- --appendonly
- yes
- --port
- "16380"
- --replicaof
- redis-master
- "16379"
depends_on:
- redis-master
ports:
- "16380:16380"
labels:
- orchestrator=devservices
networks:
- devservices
restart: unless-stopped
redis-sentinel-1:
image: ghcr.io/getsentry/image-mirror-library-redis:5.0-alpine
healthcheck:
test: redis-cli -p 26379 ping | grep PONG
interval: 5s
timeout: 5s
retries: 3
command:
- sh
- -ec
- |
mkdir -p /etc/redis
cp -n /sentinel.bootstrap.conf /etc/redis/sentinel.conf
redis-server /etc/redis/sentinel.conf --sentinel --port 26379
depends_on:
- redis-master
- redis-replica
ports:
- "26379:26379"
labels:
- orchestrator=devservices
networks:
- devservices
volumes:
- ./config/sentinel.bootstrap.conf:/sentinel.bootstrap.conf:ro
restart: unless-stopped
redis-sentinel-2:
image: ghcr.io/getsentry/image-mirror-library-redis:5.0-alpine
healthcheck:
test: redis-cli -p 26380 ping | grep PONG
interval: 5s
timeout: 5s
retries: 3
command:
- sh
- -ec
- |
mkdir -p /etc/redis
cp -n /sentinel.bootstrap.conf /etc/redis/sentinel.conf
redis-server /etc/redis/sentinel.conf --sentinel --port 26380
depends_on:
- redis-master
- redis-replica
ports:
- "26380:26380"
labels:
- orchestrator=devservices
networks:
- devservices
volumes:
- ./config/sentinel.bootstrap.conf:/sentinel.bootstrap.conf:ro
restart: unless-stopped

networks:
devservices:
Expand Down
1 change: 1 addition & 0 deletions devservices/config/sentinel.bootstrap.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sentinel monitor redis-sentry redis-master 16379 2
Loading