You need to sign in or sign up before continuing.
Commit 6499d200 authored by jerrrrry's avatar jerrrrry
Browse files

Update .gitlab-ci.yml

parent a8de9d8f
......@@ -67,7 +67,7 @@ benchmark_wan2.1:
fi
- echo "========================================="
- echo "Step 5 Running benchmark tests with different seeds"
- echo "Step 5 Running benchmark tests with file detection"
- echo "========================================="
# 创建结果目录
- mkdir -p results
......@@ -83,48 +83,35 @@ benchmark_wan2.1:
# 记录开始时间
start_time=$(date +%s)
# 运行测试并捕获输出
python temp_test1.py 2>&1 | tee results/test1_output.log
# 运行测试
python temp_test1.py > results/test1_output.log 2>&1 &
export TEST1_PID=$!
# 记录结束时间和计算执行时间
end_time=$(date +%s)
duration=$((end_time - start_time))
echo "Test 1 execution time $duration seconds" >> results/performance.log
- echo "========================================="
- echo "Step 6 Waiting for first test to complete"
- echo "========================================="
# 等待第一次测试完成,检查output目录中是否有新的webp文件
- |
echo "Waiting for webp file to be generated..."
timeout=600 # 最多等待10分钟
echo "Waiting for first webp file to be generated..."
# 等待第一个webp文件生成,最多等待10分钟
timeout=600
count=0
webp_found=false
while [ $count -lt $timeout ]; do
# 检查output目录中是否有webp文件
if find output -name "*.webp" -type f | head -1 | grep -q .; then
echo "Found webp file! First test completed."
webp_found=true
break
fi
# 检查是否有错误信息
if grep -q "error\|Error\|ERROR\|failed\|Failed\|FAILED" results/test1_output.log; then
echo "Error detected in test 1 output!"
webp_count=$(find output -name "*.webp" -type f | wc -l)
if [ $webp_count -gt 0 ]; then
echo "First webp file detected! Count: $webp_count"
break
fi
echo "Waiting... ($count/$timeout seconds)"
sleep 5
count=$((count+5))
sleep 2
count=$((count+2))
echo "Waiting... ${count}s elapsed, webp count: $webp_count"
done
if [ "$webp_found" = false ]; then
echo "Warning: No webp file found after waiting $timeout seconds"
echo "Output directory contents:"
ls -la output/ || echo "Output directory not found"
if [ $count -eq $timeout ]; then
echo "Timeout waiting for first webp file"
exit 1
fi
# 记录结束时间和计算执行时间
end_time=$(date +%s)
duration=$((end_time - start_time))
echo "Test 1 execution time $duration seconds" >> results/performance.log
echo "Test 1 completed in $duration seconds"
# 运行第二次测试(seed=1234567890)
- echo "Running second test with seed=1234567890"
......@@ -135,56 +122,58 @@ benchmark_wan2.1:
# 记录开始时间
start_time=$(date +%s)
# 运行测试并捕获输出
python temp_test2.py 2>&1 | tee results/test2_output.log
# 运行测试
python temp_test2.py > results/test2_output.log 2>&1 &
export TEST2_PID=$!
# 记录结束时间和计算执行时间
end_time=$(date +%s)
duration=$((end_time - start_time))
echo "Test 2 execution time $duration seconds" >> results/performance.log
- echo "========================================="
- echo "Step 7 Waiting for second test to complete"
- echo "========================================="
# 等待第二次测试完成
- |
echo "Waiting for second webp file to be generated..."
timeout=600 # 最多等待10分钟
# 等待第二个webp文件生成,最多等待10分钟
timeout=600
count=0
webp_count_before=$(find output -name "*.webp" -type f | wc -l)
while [ $count -lt $timeout ]; do
webp_count_current=$(find output -name "*.webp" -type f | wc -l)
# 如果webp文件数量增加,说明第二个测试完成了
if [ $webp_count_current -gt $webp_count_before ]; then
echo "Second webp file found! Second test completed."
webp_count=$(find output -name "*.webp" -type f | wc -l)
if [ $webp_count -gt 1 ]; then
echo "Second webp file detected! Total count: $webp_count"
break
fi
# 检查是否有错误信息
if grep -q "error\|Error\|ERROR\|failed\|Failed\|FAILED" results/test2_output.log; then
echo "Error detected in test 2 output!"
break
fi
echo "Waiting... ($count/$timeout seconds)"
sleep 5
count=$((count+5))
sleep 2
count=$((count+2))
echo "Waiting... ${count}s elapsed, webp count: $webp_count"
done
if [ $count -eq $timeout ]; then
echo "Timeout waiting for second webp file"
exit 1
fi
# 记录结束时间和计算执行时间
end_time=$(date +%s)
duration=$((end_time - start_time))
echo "Test 2 execution time $duration seconds" >> results/performance.log
echo "Test 2 completed in $duration seconds"
- echo "========================================="
- echo "Step 8 Collecting results"
- echo "Step 6 Verifying and collecting results"
- echo "========================================="
# 查找并复制输出文件
- |
# 查找最新的.webp文件
# 验证两个webp文件都已生成
webp_count=$(find output -name "*.webp" -type f | wc -l)
echo "Total webp files found: $webp_count"
if [ $webp_count -lt 2 ]; then
echo "ERROR: Expected 2 webp files, but found $webp_count"
find output -name "*.webp" -type f -ls
exit 1
fi
# 查找并复制最新的两个webp文件
find output -name "*.webp" -type f -exec ls -lt {} + | head -n 2 > results/latest_files.txt
# 复制最新的两个.webp文件到结果目录
# 复制文件到结果目录
while read line; do
filepath=$(echo "$line" | awk '{print $NF}')
cp "$filepath" results/
echo "Copied: $filepath"
done < results/latest_files.txt
# 创建结果摘要
......@@ -194,14 +183,14 @@ benchmark_wan2.1:
echo "" >> results/summary.txt
echo "Test 2 (seed=1234567890):" >> results/summary.txt
grep "Prompt executed in" results/test2_output.log >> results/summary.txt
# 显示最终生成的文件数量
total_webp=$(find output -name "*.webp" -type f | wc -l)
echo "" >> results/summary.txt
echo "Total webp files generated: $total_webp" >> results/summary.txt
echo "Generated files:" >> results/summary.txt
ls results/*.webp >> results/summary.txt
echo "All tests completed successfully!"
- echo "========================================="
- echo "Step 9 Cleaning up"
- echo "Step 7 Cleaning up"
- echo "========================================="
# 停止ComfyUI服务器
- kill $COMFYUI_PID || true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment