Skip to content
Closed

fix:CI #3199

Show file tree
Hide file tree
Changes from 2 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
34 changes: 31 additions & 3 deletions .github/workflows/pika.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ jobs:
# Build your program with the given configuration
run: cmake --build build --config ${{ env.BUILD_TYPE }}

- name: Cleanup
- name: Cleanup Build Artifacts
run: |
rm -rf ./buildtrees
rm -rf ./deps/src
rm -rf ./build/CMakeFiles
df -h

- uses: actions/upload-artifact@v4
with:
Expand All @@ -65,6 +68,17 @@ jobs:
run: ./pikatests.sh all clean

# master on port 9221, slave on port 9231, all with 2 db
- name: Check Disk Space
run: |
echo "Checking disk space before starting codis..."
df -h
echo "Cleaning up additional space if needed..."
docker system prune -af || true
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /opt/ghc || true
sudo rm -rf /usr/local/share/boost || true
df -h

- name: Start codis, pika master and pika slave
working-directory: ${{ github.workspace }}/build
run: |
Expand Down Expand Up @@ -105,9 +119,12 @@ jobs:
source /opt/rh/devtoolset-10/enable
cmake --build build --config ${{ env.BUILD_TYPE }}

- name: Cleanup
- name: Cleanup Build Artifacts
run: |
rm -rf ./buildtrees
rm -rf ./deps/src
rm -rf ./build/CMakeFiles
df -h

- name: Test
working-directory: ${{ github.workspace }}/build
Expand All @@ -117,6 +134,14 @@ jobs:
working-directory: ${{ github.workspace }}
run: ./pikatests.sh all clean

- name: Check Disk Space
run: |
echo "Checking disk space before starting codis..."
df -h
echo "Cleaning up additional space if needed..."
rm -rf /tmp/* || true
df -h

- name: Start codis, pika master and pika slave
working-directory: ${{ github.workspace }}/build
run: |
Expand Down Expand Up @@ -165,11 +190,14 @@ jobs:
run: |
cmake --build build --config ${{ env.BUILD_TYPE }}

- name: Cleanup
- name: Cleanup Build Artifacts
run: |
cp deps/lib/libz.1.dylib .
cp deps/lib/libz.1.dylib tests/integration/
rm -rf ./buildtrees
rm -rf ./deps/src
rm -rf ./build/CMakeFiles
df -h

- name: Test
working-directory: ${{ github.workspace }}/build
Expand Down
11 changes: 10 additions & 1 deletion codis/admin/codis-dashboard-admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,18 @@ CODIS_DASHBOARD_CONF_FILE=$CODIS_CONF_DIR/dashboard.toml
echo $CODIS_DASHBOARD_CONF_FILE

if [ ! -d $CODIS_LOG_DIR ]; then
mkdir -p $CODIS_LOG_DIR
# Try to create directory, but handle failure gracefully
mkdir -p $CODIS_LOG_DIR || {
echo "WARNING: Failed to create log directory at $CODIS_LOG_DIR"
# Use /tmp directory as fallback
CODIS_LOG_DIR="/tmp"
echo "Using fallback directory: $CODIS_LOG_DIR"
}
fi

# Clean up old log files to save space
find $CODIS_LOG_DIR -name "codis-*.log" -type f -mtime +1 -delete 2>/dev/null || true


case $1 in
start)
Expand Down
11 changes: 10 additions & 1 deletion codis/admin/codis-fe-admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@ CODIS_FE_ADDR="0.0.0.0:9090"
echo $CODIS_FE_CONF_FILE

if [ ! -d $CODIS_LOG_DIR ]; then
mkdir -p $CODIS_LOG_DIR
# Try to create directory, but handle failure gracefully
mkdir -p $CODIS_LOG_DIR || {
echo "WARNING: Failed to create log directory at $CODIS_LOG_DIR"
# Use /tmp directory as fallback
CODIS_LOG_DIR="/tmp"
echo "Using fallback directory: $CODIS_LOG_DIR"
}
fi

# Clean up old log files to save space
find $CODIS_LOG_DIR -name "codis-*.log" -type f -mtime +1 -delete 2>/dev/null || true


case $1 in
start)
Expand Down
11 changes: 10 additions & 1 deletion codis/admin/codis-proxy-admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ CODIS_DASHBOARD_ADDR="127.0.0.1:18080"
echo $CODIS_PROXY_CONF_FILE

if [ ! -d $CODIS_LOG_DIR ]; then
mkdir -p $CODIS_LOG_DIR
# Try to create directory, but handle failure gracefully
mkdir -p $CODIS_LOG_DIR || {
echo "WARNING: Failed to create log directory at $CODIS_LOG_DIR"
# Use /tmp directory as fallback
CODIS_LOG_DIR="/tmp"
echo "Using fallback directory: $CODIS_LOG_DIR"
}
fi

# Clean up old log files to save space
find $CODIS_LOG_DIR -name "codis-*.log" -type f -mtime +1 -delete 2>/dev/null || true


case $1 in
start)
Expand Down
6 changes: 5 additions & 1 deletion pikatests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ function cleanup() {
rm -rf ./log[0-9]*
rm -rf ./db[0-9]*
rm -rf dbsync/
rm src/redis-server
rm -f src/redis-server
echo "Cleanup completed"
}

# Add trap to ensure cleanup is executed on script exit, even if there's an error
trap cleanup EXIT

# check if tcl is installed
function check_tcl {
if [ -z "$(which tclsh)" ]; then
Expand Down
16 changes: 8 additions & 8 deletions tests/conf/pika.conf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ db-path : ./db/
# but this will generate heavier IO load when flushing from buffer to disk,
# you should configure it based on you usage scenario.
# Supported Units [K|M|G], write-buffer-size default unit is in [bytes].
write-buffer-size : 256M
write-buffer-size : 64M

# The size of one block in arena memory allocation.
# If <= 0, a proper value is automatically calculated.
Expand Down Expand Up @@ -150,7 +150,7 @@ maxclients : 20000
# the price is that the number of sst files could be huge. On the contrary, the bigger the sst file size, the lower
# the performance and the higher the merge cost, while the number of files is fewer.
# Supported Units [K|M|G], target-file-size-base default unit is in [bytes] and the default value is 20M.
target-file-size-base : 20M
target-file-size-base : 10M

# Expire-time of binlog(write2file) files that stored within log-path.
# Any binlog(write2file) files that exceed this expire time will be cleaned up.
Expand All @@ -163,7 +163,7 @@ expire-logs-days : 7
# automatic cleaning will start to ensure the maximum number
# of binlog files is equal to expire-logs-nums.
# The [Minimum value] of this parameter is 10.
expire-logs-nums : 10
expire-logs-nums : 3

# The number of guaranteed connections for root user.
# This parameter guarantees that there are 2(By default) connections available
Expand Down Expand Up @@ -280,7 +280,7 @@ write-binlog : yes
# [NOTICE] Master and slaves must have exactly the same value for the binlog-file-size.
# The [value range] of binlog-file-size is [1K, 2G].
# Supported Units [K|M|G], binlog-file-size default unit is in [bytes] and the default value is 100M.
binlog-file-size : 104857600
binlog-file-size : 10485760

# Automatically triggers a small compaction according to statistics
# Use the cache to store up to 'max-cache-statistic-keys' keys
Expand All @@ -299,7 +299,7 @@ small-compaction-duration-threshold : 10000
# exceeds max-write-buffer-size when next write operation is issued.
# [RocksDB-Basic-Tuning](https://github.com/facebook/rocksdb/wiki/Setup-Options-and-Basic-Tuning)
# Supported Units [K|M|G], max-write-buffer-size default unit is in [bytes].
max-write-buffer-size : 10737418240
max-write-buffer-size : 1073741824

# The maximum number of write buffers(memtables) that are built up in memory for one ColumnFamily in DB.
# The default and the minimum number is 2. It means that Pika(RocksDB) will write to a write buffer
Expand Down Expand Up @@ -365,7 +365,7 @@ max-background-compactions : 2
max-background-jobs : 3

# maximum value of RocksDB cached open file descriptors
max-cache-files : 5000
max-cache-files : 1000

# The ratio between the total size of RocksDB level-(L+1) files and the total size of RocksDB level-L files for all L.
# Its default value is 10(x). You can also change it to 5(x).
Expand Down Expand Up @@ -520,8 +520,8 @@ zset-cache-field-num-per-key : 512
# If zset-cache-start-direction is -1, cache the last 512[zset-cache-field-num-per-key] elements
zset-cache-start-direction : 0

# the cache maxmemory of every db, configuration 10G
cache-maxmemory : 10737418240
# the cache maxmemory of every db, configuration 512M
cache-maxmemory : 536870912

# cache-maxmemory-policy
# 0: volatile-lru -> Evict using approximated LRU among the keys with an expire set.
Expand Down
23 changes: 15 additions & 8 deletions tests/integration/start_codis.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
#!/bin/bash

#pkill -9 pika
#pkill -9 codis
#rm -rf /tmp/codis
#rm -rf codis_data_1
#rm -rf codis_data_2
# Clean up processes and temporary files
pkill -9 pika || true
pkill -9 codis || true
rm -rf /tmp/codis || true
rm -rf codis_data_1 || true
rm -rf codis_data_2 || true

# Clean up temporary directories in codis to free space
rm -rf ../codis/bin || true
rm -rf ../codis/log || true
mkdir -p ../codis/bin
mkdir -p ../codis/log

# Display available disk space
df -h

CODIS_DASHBOARD_ADDR=127.0.0.1:18080

Expand Down Expand Up @@ -55,6 +65,3 @@ echo 'resync all groups'

#ensure codis are ready
sleep 10



Loading