-
Notifications
You must be signed in to change notification settings - Fork 653
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
WIP--Fix CI validator break issue and remove several redis marks in several files #42
Conversation
Signed-off-by: hwware <[email protected]>
3e095f1
to
307ee97
Compare
@@ -1,4 +1,4 @@ | |||
# example systemd service unit file for redis-server | |||
# example systemd service unit file for placeholderkv-server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is covered here: https://github.com/placeholderkv/placeholderkv/pull/29/files
@@ -20,15 +20,15 @@ proc run-tests branches { | |||
exec -ignorestderr make 2> /dev/null | |||
|
|||
if {$branch_id == 0} { | |||
puts " copy redis-benchmark from unstable to /tmp..." | |||
exec -ignorestderr cp ./redis-benchmark /tmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bold statement by me, maybe we just delete this file? Has anybody ever run this? I've never seen this before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me check if this file is necessary. I never use it before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I run the daily CI without this file, all test cases pass. I think we could remove it safely. (Here is the result https://github.com/hwware/redis/actions/runs/8454862841)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, let's delete it.
@@ -24,7 +24,7 @@ case "$1" in | |||
then | |||
echo "$PIDFILE exists, process is already running or crashed" | |||
else | |||
echo "Starting Redis server..." | |||
echo "Starting Placeholderkv server..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo "Starting Placeholderkv server..." | |
echo "Starting server..." |
So we're touching these files just once, let's make it engine agnostic where it makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, either "server" or use a variable defined only once at the top of the file. In an init script, think it's useful to know which service has been started or stopped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good, minor suggestions.
@@ -38,10 +38,10 @@ case "$1" in | |||
$CLIEXEC -p $REDISPORT shutdown | |||
while [ -x /proc/${PID} ] | |||
do | |||
echo "Waiting for Redis to shutdown ..." | |||
echo "Waiting for Placeholderkv to shutdown ..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo "Waiting for Placeholderkv to shutdown ..." | |
echo "Waiting for server to shutdown ..." |
sleep 1 | ||
done | ||
echo "Redis stopped" | ||
echo "Placeholderkv stopped" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo "Placeholderkv stopped" | |
echo "server stopped" |
@@ -241,7 +241,7 @@ def fetch_schemas(cli, port, args, docs): | |||
|
|||
while True: | |||
try: | |||
print('Connecting to Redis...') | |||
print('Connecting to Placeholderkv...') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print('Connecting to Placeholderkv...') | |
print('Connecting to server...') |
# Fetch schemas from a Placeholderkv instance | ||
print('Starting Placeholderkv server') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Fetch schemas from a Placeholderkv instance | |
print('Starting Placeholderkv server') | |
# Fetch schemas from a server instance | |
print('Starting server') |
redis_args = [args.server, '--port', str(args.port)] | ||
for module in args.module: | ||
redis_args += ['--loadmodule', 'tests/modules/%s.so' % module] | ||
|
||
fetch_schemas(args.cli, args.port, redis_args, docs) | ||
|
||
# Fetch schemas from a sentinel | ||
print('Starting Redis sentinel') | ||
print('Starting Placeholderkv sentinel') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print('Starting Placeholderkv sentinel') | |
print('Starting sentinel instance') |
echo "stop -- Stop Server Cluster instances." | ||
echo "restart -- Restart Server Cluster instances." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo "stop -- Stop Server Cluster instances." | |
echo "restart -- Restart Server Cluster instances." | |
echo "stop -- Stop Cluster instances." | |
echo "restart -- Restart Cluster instances." |
@@ -131,10 +131,10 @@ then | |||
fi | |||
|
|||
echo "Usage: $0 [start|create|stop|restart|watch|tail|tailall|clean|clean-logs|call]" | |||
echo "start -- Launch Redis Cluster instances." | |||
echo "start -- Launch Server Cluster instances." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo "start -- Launch Server Cluster instances." | |
echo "start -- Launch Cluster instances." |
@@ -28,7 +28,7 @@ then | |||
while [ $((PORT < ENDPORT)) != "0" ]; do | |||
PORT=$((PORT+1)) | |||
echo "Starting $PORT" | |||
$BIN_PATH/redis-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS} | |||
$BIN_PATH/placeholderkv-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid spelling out "placeholderkv" everywhere, because we will change it soon and backporting these changes will be a PITA.
Let's define near the top of the file
SERVER_BIN=$BIN_PATH/placeholderkv-server
CLI_BIN=$BIN_PATH/placeholderkv-cli
And then use it within this file everywhere, like
$BIN_PATH/placeholderkv-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS} | |
$SERVER_BIN --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I can temporarily set this PR as WIP, and wait for our project offical name.
@@ -44,7 +44,7 @@ then | |||
if [ "$2" == "-f" ]; then | |||
OPT_ARG="--cluster-yes" | |||
fi | |||
$BIN_PATH/redis-cli --cluster create $HOSTS --cluster-replicas $REPLICAS $OPT_ARG | |||
$BIN_PATH/placeholderkv-cli --cluster create $HOSTS --cluster-replicas $REPLICAS $OPT_ARG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$BIN_PATH/placeholderkv-cli --cluster create $HOSTS --cluster-replicas $REPLICAS $OPT_ARG | |
$CLI_BIN --cluster create $HOSTS --cluster-replicas $REPLICAS $OPT_ARG |
@@ -53,7 +53,7 @@ then | |||
while [ $((PORT < ENDPORT)) != "0" ]; do | |||
PORT=$((PORT+1)) | |||
echo "Stopping $PORT" | |||
$BIN_PATH/redis-cli -p $PORT shutdown nosave | |||
$BIN_PATH/placeholderkv-cli -p $PORT shutdown nosave |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$BIN_PATH/placeholderkv-cli -p $PORT shutdown nosave | |
$CLI_BIN -p $PORT shutdown nosave |
@@ -70,7 +70,7 @@ then | |||
while [ $((PORT < ENDPORT)) != "0" ]; do | |||
PORT=$((PORT+1)) | |||
echo "Starting $PORT" | |||
$BIN_PATH/redis-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS} | |||
$BIN_PATH/placeholderkv-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$BIN_PATH/placeholderkv-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS} | |
$SERVER_BIN --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS} |
@@ -81,7 +81,7 @@ then | |||
while [ 1 ]; do | |||
clear | |||
date | |||
$BIN_PATH/redis-cli -p $PORT cluster nodes | head -30 | |||
$BIN_PATH/placeholderkv-cli -p $PORT cluster nodes | head -30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$BIN_PATH/placeholderkv-cli -p $PORT cluster nodes | head -30 | |
$CLI_BIN -p $PORT cluster nodes | head -30 |
parser.add_argument('--port', type=int, default=6534) | ||
parser.add_argument('--cli', type=str, default='%s/redis-cli' % srcdir) | ||
parser.add_argument('--cli', type=str, default='%s/placeholderkv-cli' % srcdir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a variable for this and define it in the top of the file.
puts " copy placeholderkv-benchmark from unstable to /tmp..." | ||
exec -ignorestderr cp ./placeholderkv-benchmark /tmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a variable for this and define it in the top of the file.
Example:
puts " copy placeholderkv-benchmark from unstable to /tmp..." | |
exec -ignorestderr cp ./placeholderkv-benchmark /tmp | |
puts " copy $benchmark from unstable to /tmp..." | |
exec -ignorestderr cp ./$benchmark /tmp |
# Start the Placeholderkv server | ||
puts " starting the server... [exec ./placeholderkv-server -v]" | ||
set pids [exec echo "port $::port\nloglevel warning\n" | ./placeholderkv-server - > /dev/null 2> /dev/null &] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Start the Placeholderkv server | |
puts " starting the server... [exec ./placeholderkv-server -v]" | |
set pids [exec echo "port $::port\nloglevel warning\n" | ./placeholderkv-server - > /dev/null 2> /dev/null &] | |
# Start the server | |
puts " starting the server... [exec ./$server -v]" | |
set pids [exec echo "port $::port\nloglevel warning\n" | ./$server - > /dev/null 2> /dev/null &] |
@@ -38,7 +38,7 @@ proc run-tests branches { | |||
puts " redis INFO shows version: [lindex [split $i] 0]" | |||
$r close | |||
|
|||
set output [exec /tmp/redis-benchmark -n $::requests -t $::tests -d $::datasize --csv -p $::port] | |||
set output [exec /tmp/placeholderkv-benchmark -n $::requests -t $::tests -d $::datasize --csv -p $::port] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set output [exec /tmp/placeholderkv-benchmark -n $::requests -t $::tests -d $::datasize --csv -p $::port] | |
set output [exec /tmp/$benchmark -n $::requests -t $::tests -d $::datasize --csv -p $::port] |
@@ -1,26 +1,26 @@ | |||
# example systemd template service unit file for multiple redis-servers | |||
# example systemd template service unit file for multiple placeholderkv-server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in every other file, I think we shouldn't use "placeholderkv" more than once in each script for defining a variable at the top of the file.
In comments, we can just say server instance and similar words.
@hwware are we still moving forward with this PR? |
CI result here:
https://github.com/hwware/placeholderkv/actions/runs/8441388671/job/23120455887