Skip to content

Commit 07e43d6

Browse files
committed
fix:CI
1 parent e5bab9f commit 07e43d6

5 files changed

Lines changed: 76 additions & 14 deletions

File tree

.github/workflows/pika.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ jobs:
4545
# Build your program with the given configuration
4646
run: cmake --build build --config ${{ env.BUILD_TYPE }}
4747

48-
- name: Cleanup
48+
- name: Cleanup Build Artifacts
4949
run: |
5050
rm -rf ./buildtrees
51+
rm -rf ./deps/src
52+
rm -rf ./build/CMakeFiles
53+
df -h
5154
5255
- uses: actions/upload-artifact@v4
5356
with:
@@ -65,6 +68,17 @@ jobs:
6568
run: ./pikatests.sh all clean
6669

6770
# master on port 9221, slave on port 9231, all with 2 db
71+
- name: Check Disk Space
72+
run: |
73+
echo "Checking disk space before starting codis..."
74+
df -h
75+
echo "Cleaning up additional space if needed..."
76+
docker system prune -af || true
77+
sudo rm -rf /usr/share/dotnet || true
78+
sudo rm -rf /opt/ghc || true
79+
sudo rm -rf /usr/local/share/boost || true
80+
df -h
81+
6882
- name: Start codis, pika master and pika slave
6983
working-directory: ${{ github.workspace }}/build
7084
run: |
@@ -105,9 +119,12 @@ jobs:
105119
source /opt/rh/devtoolset-10/enable
106120
cmake --build build --config ${{ env.BUILD_TYPE }}
107121
108-
- name: Cleanup
122+
- name: Cleanup Build Artifacts
109123
run: |
110124
rm -rf ./buildtrees
125+
rm -rf ./deps/src
126+
rm -rf ./build/CMakeFiles
127+
df -h
111128
112129
- name: Test
113130
working-directory: ${{ github.workspace }}/build
@@ -117,6 +134,14 @@ jobs:
117134
working-directory: ${{ github.workspace }}
118135
run: ./pikatests.sh all clean
119136

137+
- name: Check Disk Space
138+
run: |
139+
echo "Checking disk space before starting codis..."
140+
df -h
141+
echo "Cleaning up additional space if needed..."
142+
rm -rf /tmp/* || true
143+
df -h
144+
120145
- name: Start codis, pika master and pika slave
121146
working-directory: ${{ github.workspace }}/build
122147
run: |
@@ -165,11 +190,14 @@ jobs:
165190
run: |
166191
cmake --build build --config ${{ env.BUILD_TYPE }}
167192
168-
- name: Cleanup
193+
- name: Cleanup Build Artifacts
169194
run: |
170195
cp deps/lib/libz.1.dylib .
171196
cp deps/lib/libz.1.dylib tests/integration/
172197
rm -rf ./buildtrees
198+
rm -rf ./deps/src
199+
rm -rf ./build/CMakeFiles
200+
df -h
173201
174202
- name: Test
175203
working-directory: ${{ github.workspace }}/build

codis/admin/codis-dashboard-admin.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,18 @@ CODIS_DASHBOARD_CONF_FILE=$CODIS_CONF_DIR/dashboard.toml
2020
echo $CODIS_DASHBOARD_CONF_FILE
2121

2222
if [ ! -d $CODIS_LOG_DIR ]; then
23-
mkdir -p $CODIS_LOG_DIR
23+
# Try to create directory, but handle failure gracefully
24+
mkdir -p $CODIS_LOG_DIR || {
25+
echo "WARNING: Failed to create log directory at $CODIS_LOG_DIR"
26+
# Use /tmp directory as fallback
27+
CODIS_LOG_DIR="/tmp"
28+
echo "Using fallback directory: $CODIS_LOG_DIR"
29+
}
2430
fi
2531

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

2736
case $1 in
2837
start)

codis/admin/codis-fe-admin.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,18 @@ CODIS_FE_ADDR="0.0.0.0:9090"
2222
echo $CODIS_FE_CONF_FILE
2323

2424
if [ ! -d $CODIS_LOG_DIR ]; then
25-
mkdir -p $CODIS_LOG_DIR
25+
# Try to create directory, but handle failure gracefully
26+
mkdir -p $CODIS_LOG_DIR || {
27+
echo "WARNING: Failed to create log directory at $CODIS_LOG_DIR"
28+
# Use /tmp directory as fallback
29+
CODIS_LOG_DIR="/tmp"
30+
echo "Using fallback directory: $CODIS_LOG_DIR"
31+
}
2632
fi
2733

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

2938
case $1 in
3039
start)

codis/admin/codis-proxy-admin.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,18 @@ CODIS_DASHBOARD_ADDR="127.0.0.1:18080"
2121
echo $CODIS_PROXY_CONF_FILE
2222

2323
if [ ! -d $CODIS_LOG_DIR ]; then
24-
mkdir -p $CODIS_LOG_DIR
24+
# Try to create directory, but handle failure gracefully
25+
mkdir -p $CODIS_LOG_DIR || {
26+
echo "WARNING: Failed to create log directory at $CODIS_LOG_DIR"
27+
# Use /tmp directory as fallback
28+
CODIS_LOG_DIR="/tmp"
29+
echo "Using fallback directory: $CODIS_LOG_DIR"
30+
}
2531
fi
2632

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

2837
case $1 in
2938
start)

tests/integration/start_codis.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
#!/bin/bash
22

3-
#pkill -9 pika
4-
#pkill -9 codis
5-
#rm -rf /tmp/codis
6-
#rm -rf codis_data_1
7-
#rm -rf codis_data_2
3+
# Clean up processes and temporary files
4+
pkill -9 pika || true
5+
pkill -9 codis || true
6+
rm -rf /tmp/codis || true
7+
rm -rf codis_data_1 || true
8+
rm -rf codis_data_2 || true
9+
10+
# Clean up temporary directories in codis to free space
11+
rm -rf ../codis/bin || true
12+
rm -rf ../codis/log || true
13+
mkdir -p ../codis/bin
14+
mkdir -p ../codis/log
15+
16+
# Display available disk space
17+
df -h
818

919
CODIS_DASHBOARD_ADDR=127.0.0.1:18080
1020

@@ -55,6 +65,3 @@ echo 'resync all groups'
5565

5666
#ensure codis are ready
5767
sleep 10
58-
59-
60-

0 commit comments

Comments
 (0)