-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed CI to use valkey image directly
- Loading branch information
1 parent
f4716cf
commit 8be3169
Showing
7 changed files
with
365 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
|
||
--- | ||
|
||
services: | ||
|
||
valkey: | ||
image: valkey/valkey:latest | ||
container_name: valkey-standalone | ||
ports: | ||
- "6379:6379" | ||
profiles: | ||
- standalone | ||
- sentinel | ||
- replica | ||
- all | ||
command: ['valkey-server', '--save', '""'] | ||
|
||
|
||
cluster: | ||
container_name: valkey-cluster | ||
build: | ||
context: . | ||
dockerfile: dockers/Dockerfile.cluster | ||
ports: | ||
- "16379:16379" | ||
- "16380:16380" | ||
- "16381:16381" | ||
- "16382:16382" | ||
- "16383:16383" | ||
- "16384:16384" | ||
volumes: | ||
- "./dockers/cluster.valkey.conf:/valkey.conf:ro" | ||
profiles: | ||
- cluster | ||
- all | ||
|
||
sentinel: | ||
image: valkey/valkey:latest | ||
container_name: valkey-sentinel | ||
depends_on: | ||
- valkey | ||
entrypoint: "/usr/local/bin/valkey-sentinel /valkey.conf --port 26379" | ||
ports: | ||
- "26379:26379" | ||
volumes: | ||
- "./dockers/sentinel.conf:/valkey.conf" | ||
profiles: | ||
- sentinel | ||
- all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM valkey/valkey:latest as rss | ||
|
||
COPY dockers/create_cluster.sh /create_cluster.sh | ||
RUN chmod a+x /create_cluster.sh | ||
|
||
ENTRYPOINT [ "/create_cluster.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
protected-mode no | ||
enable-debug-command yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#! /bin/bash | ||
|
||
mkdir -p /nodes | ||
touch /nodes/nodemap | ||
if [ -z ${START_PORT} ]; then | ||
START_PORT=16379 | ||
fi | ||
if [ -z ${END_PORT} ]; then | ||
END_PORT=16384 | ||
fi | ||
if [ ! -z "$3" ]; then | ||
START_PORT=$2 | ||
START_PORT=$3 | ||
fi | ||
echo "STARTING: ${START_PORT}" | ||
echo "ENDING: ${END_PORT}" | ||
|
||
for PORT in `seq ${START_PORT} ${END_PORT}`; do | ||
mkdir -p /nodes/$PORT | ||
if [[ -e /valkey.conf ]]; then | ||
cp /valkey.conf /nodes/$PORT/valkey.conf | ||
else | ||
touch /nodes/$PORT/valkey.conf | ||
fi | ||
cat << EOF >> /nodes/$PORT/valkey.conf | ||
port ${PORT} | ||
cluster-enabled yes | ||
daemonize yes | ||
logfile /valkey.log | ||
dir /nodes/$PORT | ||
EOF | ||
|
||
set -x | ||
/usr/local/bin/valkey-server /nodes/$PORT/valkey.conf | ||
sleep 1 | ||
if [ $? -ne 0 ]; then | ||
echo "Valkey failed to start, exiting." | ||
continue | ||
fi | ||
echo 127.0.0.1:$PORT >> /nodes/nodemap | ||
done | ||
if [ -z "${VALKEY_PASSWORD}" ]; then | ||
echo yes | /usr/local/bin/valkey-cli --cluster create `seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}` --cluster-replicas 1 | ||
else | ||
echo yes | /usr/local/bin/valkey-cli -a ${VALKEY_PASSWORD} --cluster create `seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}` --cluster-replicas 1 | ||
fi | ||
tail -f /valkey.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sentinel resolve-hostnames yes | ||
sentinel monitor mymaster valkey 6379 1 | ||
sentinel down-after-milliseconds mymaster 5000 | ||
sentinel failover-timeout mymaster 60000 | ||
sentinel parallel-syncs mymaster 1 |
Oops, something went wrong.